我创建了两个代理,它运行得很好。但是当我添加Ontology类并注册本体时,我无法创建代理...我得到了以下错误..
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类路径是正确的。本体类路径也是正确的。这是什么原因呢?请帮帮我.我发现错误..它在我的本体类上..谢谢。。
发布于 2012-06-02 03:26:39
关键的错误信息似乎是:
SEVERE: Cannot create agent REquestAgent: An undeclared exception was thrown
[nested java.lang.NoClassDefFoundError:
Could not initialize class FruitOntology.FruitOntology]您的代码没有在FruitOntology包中找到类FruitOntology (这不是一个很好的包名-通常,包名应该以小写字母开头,并且通常遵循颠倒组织域名的约定)。
由于您还没有展示任何代码,我们只能猜测为什么会出现这个错误。您是否在某个配置文件中将该名称拼写错误?在项目中执行grep以查看FruitOntology.FruitOntology发生的位置。它可能不是用普通的Java代码编写的,因为您可能会因为缺少类而得到编译错误,除非您出于某种原因使用Java反射。
https://stackoverflow.com/questions/10844123
复制相似问题