gpt4 book ai didi

java - Jade Agents 中出现 NoClassDefFoundError?

转载 作者:行者123 更新时间:2023-12-01 15:21:32 25 4
gpt4 key购买 nike

我创建了两个代理,并且运行良好。但是当我添加本体类并注册本体时,我无法创建代理...我收到以下错误..

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

类路径是正确的。本体类路径也是正确的。这是什么原因?请帮助我…………我发现错误..它在我的本体类上..谢谢..

最佳答案

关键的错误消息似乎是:

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 Reflection。

关于java - Jade Agents 中出现 NoClassDefFoundError?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10844123/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com