gpt4 book ai didi

java - Glassfish 4.1 LogFactory 和 WSSElementFactory NoClassDefFoundError

转载 作者:行者123 更新时间:2023-12-01 14:34:21 27 4
gpt4 key购买 nike

当我在 Glassfish 4.1 服务器上运行我的 rest api 点时,我面临以下 NoClassDefFoundError,即使我将耳朵与 commons-logging 作为依赖项一起发送,即使库在WEB-INF\lib

下解压

而且看起来我在使用 Glassfish 4.0 时没有遇到问题

有什么办法解决这个问题吗?

找不到第一个 LogFactory

javax.xml.ws.WebServiceException: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processRequest(SecurityClientTube.java:252)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1136)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:1050)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:1019)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:877)
at com.sun.xml.ws.client.Stub.process(Stub.java:463)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:191)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:92)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:161)

然后 WSSElementFactory 也不是

javax.xml.ws.WebServiceException: java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.ws.security.opt.impl.util.WSSElementFactory
at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processRequest(SecurityClientTube.java:252)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1136)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:1050)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:1019)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:877)
at com.sun.xml.ws.client.Stub.process(Stub.java:463)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:191)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:92)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:161)

最佳答案

也许我的回答 一点点已经过时,但我在 Glassfish 4.1.1 中遇到了同样的问题,并设法通过更新 Metro 库解决了这个问题

这是一个说明:

  1. 下载解压https://maven.java.net/content/repositories/releases//org/glassfish/metro/metro-standalone/2.3.1/metro-standalone-2.3.1.zip
  2. 从您的 glassfish/modules 文件夹中删除(备份)一些文件:
  • jaxb-extra-osgi.jar
  • jaxb-osgi.jar
  • stax2-api.jar
  • webservices-extra-jdk-packages.jar
  • webservices-osgi.jar
  • woodstox-core-asl.jar
  1. 将它们替换为解压后的 metro/osgi 内容
  2. 停止 Glassfish
  3. 删除domain1/generateddomain1/osgi-cache 文件夹的内容
  4. 启动 Glassfish

它对我有用,两个错误都消失了

希望对大家有帮助

关于java - Glassfish 4.1 LogFactory 和 WSSElementFactory NoClassDefFoundError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45280539/

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