简体   繁体   English

Jade Agents中的NoClassDefFoundError?

[英]NoClassDefFoundError in Jade Agents?

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.. 请帮助我.............我发现了错误..这是在我的本体论课上..谢谢..

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). 您的代码未在程序包FruitOntology找到类FruitOntology (这不是一个很好的程序包名称-通常,程序包名称以小写字母开头,并且通常遵循颠倒组织域名的约定)。

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. 在项目中执行grep,以查看FruitOntology.FruitOntology 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. 它可能不在普通的Java代码中,因为您会因缺少类而遇到编译错误,除非出于某种原因使用Java Reflection。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM