gpt4 book ai didi

java - Java 中使用 Jersey 和 Moxi 出现 NoClassDef 异常

转载 作者:太空宇宙 更新时间:2023-11-04 14:57:02 26 4
gpt4 key购买 nike

我是 Jersey 的新手,我已经启动并运行了应用程序,但是当我尝试使用 moxy 进行 Json 处理时,我陷入了困境。我已经克服了几个问题。添加这两个JARS后没有:

  • 泽西媒体-moxy-2.7
  • Jersey 实体过滤-2.3

我收到以下错误:

    Apr 15, 2014 10:20:34 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet jersey-serlvet
java.lang.NoClassDefFoundError: org/glassfish/jersey/moxy/json/internal/ConfigurableMoxyJsonProvider
at org.glassfish.jersey.moxy.json.MoxyJsonFeature.configure(MoxyJsonFeature.java:79)
at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:680)
at org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:610)
at org.glassfish.jersey.server.ResourceConfig.configureMetaProviders(ResourceConfig.java:800)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:385)
at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:162)
at org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:322)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:289)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:286)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:286)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:319)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:284)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:311)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:168)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:358)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:864)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:134)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

非常感谢您的帮助。我没有使用 Maven 或任何其他构建或依赖工具。

最佳答案

解决了!

我使用Json处理api jsonp。在我的代码中,我正在“低级别”上处理 moxi 不支持低级别。

关于java - Java 中使用 Jersey 和 Moxi 出现 NoClassDef 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23077040/

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