Question

I created two agents and it runs well. but when I add Ontology class and registered the ontology I can't create the agents... I got following errors..

Jun 1, 2012 8:56:55 AM jade.core.BaseService init
INFO: Service jade.core.management.AgentManagement initialized
Jun 1, 2012 8:56:55 AM jade.core.BaseService init
INFO: Service jade.core.messaging.Messaging initialized
Jun 1, 2012 8:56:55 AM jade.core.BaseService init
INFO: Service jade.core.mobility.AgentMobility initialized
Jun 1, 2012 8:56:55 AM jade.core.BaseService init
INFO: Service jade.core.event.Notification initialized
Jun 1, 2012 8:56:55 AM jade.core.messaging.MessagingService clearCachedSlice
INFO: Clearing cache
Jun 1, 2012 8:56:55 AM jade.mtp.http.HTTPServer <init>
INFO: HTTP-MTP Using XML parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
Jun 1, 2012 8:56:55 AM jade.core.messaging.MessagingService boot
INFO: MTP addresses:
http://169.254.108.164:7778/acc
Jun 1, 2012 8:56:55 AM jade.core.AgentContainerImpl startBootstrapAgents
SEVERE: Cannot create agent STMAgent: An undeclared exception was thrown [nested   java.lang.ExceptionInInitializerError]
Jun 1, 2012 8:56:55 AM jade.core.AgentContainerImpl startBootstrapAgents
SEVERE: Cannot create agent REquestAgent: An undeclared exception was thrown [nested java.lang.NoClassDefFoundError: Could not initialize class FruitOntology.FruitOntology]
Jun 1, 2012 8:56:55 AM jade.core.AgentContainerImpl joinPlatform

class paths are correct. Ontology class paths are also correct.. What is the reason for this? Plz help me............ I found error.. it is on my ontology class.. Thank you..

Was it helpful?

Solution

The crucial error message seems to be:

SEVERE: Cannot create agent REquestAgent: An undeclared exception was thrown 
  [nested java.lang.NoClassDefFoundError: 
   Could not initialize class FruitOntology.FruitOntology]

Your code is not finding class FruitOntology in the package FruitOntology (which isn't a very good package name - normally, a package name would start with a lower-case letter, and would normally follow the convention of reversing the domain name of the organization).

As you haven't shown any of your code, we can only guess why that error arises. Have you perhaps mis-spelled the name in a configuration file somewhere? Do a grep through your project to see where FruitOntology.FruitOntology occurs. It probably isn't in normal Java code, as you would get a compilation error for missing classes, unless you're using Java Reflection for some reason.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top