[jade-develop] problem when agent move to another container

Andre Schulze as8 at rcs.urz.tu-dresden.de
Fri Sep 3 11:28:33 CEST 2004


Am Fri den 03 Sep 2004 um 01:38:20AM +0000 schrieb sean Su:
> Hi, Jaders,
> 
> I try to develope a MAS in JADE, I use Protege-2000 to construct the 
> ontology, and then use BeanGenerator to export the ontology to java class. 
> In my java code, I try to move an agent to the specific container. When 
> running my code, I got following error:
> "Error in agent serialization. Abort transfer. 
> java.io.NotSerializableException: nl.uva.psy.swi.beangenerator.SlotHolder".
> can anyone give me an idea on how to solve it? Thanks in advance.
> 
I also used protege to create ontologies for jade. The generated code
contains some parts that do not seem to be needed by jade. This code
obviously prevents serialization of your objects.
I simply removed all this stuff using an ant target:

 <target name="remove-protege-source">
      <fileset id="ont" dir="de/tu_dresden/pas/agents/ontologies/" includes="**/*.java" />
      <replaceregexp flags="g" match="import nl.uva.psy.*;" replace="">
         <fileset refid="ont"/>
      </replaceregexp>
      <replaceregexp match="private static ProtegeIntrospector introspect.*;" replace="">
         <fileset refid="ont"/>
      </replaceregexp>
      <replaceregexp flags="g" match="\s+storeSlotName\(.*;" replace="">
         <fileset refid="ont"/>
      </replaceregexp>
      <replaceregexp flags="g" match="private HashMap jadeToProtege;" replace="">
         <fileset refid="ont"/>
      </replaceregexp>
      <replaceregexp flags="g" match="jadeToProtege.*;" replace="">
         <fileset refid="ont"/>
      </replaceregexp>
      <replaceregexp match="introspect.*;" replace="">
         <fileset refid="ont"/>
      </replaceregexp>
      <replaceregexp flags="s" match="// ProtegeOntology methods.*// VOCABULARY" replace="">
         <fileset refid="ont"/>
      </replaceregexp>
      <replaceregexp match="implements ProtegeTools.ProtegeOntology " replace="">
         <fileset refid="ont"/>
      </replaceregexp>
</target>

Does anybody know the purpose of this extra code?

HTH,

	andre


More information about the jade-develop mailing list