我在一台机器上得到了`noclassdeffounderror`

发布于 2025-02-11 14:31:48 字数 1301 浏览 0 评论 0原文

我已经将NetTy项目打包为JAR,并且在本地和一台服务器上正常工作,但是它会抛出java.lang.noclassdeffounderror在另一台服务器上例外。此外,如果我使用JRE而不是JAVA带有JDK(同一版本)的JRE 启动JAR,则可以再次起作用。

如果此罐子在某个地方工作,则意味着罐子已经包装了所需的类,那么可能会导致问题呢?

2022-06-30 10:58:11 WARN  [io.netty.channel.DefaultChannelPipeline] : An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.lang.NoClassDefFoundError: Could not initialize class com.baidu.bjf.remoting.protobuf.utils.JDKCompilerHelper
        at com.baidu.bjf.remoting.protobuf.ProtobufProxy.doCreate(ProtobufProxy.java:397)
        at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:311)
        at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:276)
        at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:249)
        at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:208)
        at com.wjserver.ws.codec.ProtobufDecoder.decode(ProtobufDecoder.java:23)
        at com.wjserver.ws.codec.ProtobufDecoder.decode(ProtobufDecoder.java:40)
        at com.wjserver.ws.handler.WebSocketInHandler.channelRead0(WebSocketInHandler.java:41)

...

I have packaged my netty project as a jar, and it works fine locally and on one server, but it will throw java.lang.NoClassDefFoundError exception on another one. Furthermore, if I start the jar with java from jre instead of java comes with jdk (same version), it works again.

If this jar works somewhere, it means the jar has already had the required classes packaged, then what might cause the problem?

2022-06-30 10:58:11 WARN  [io.netty.channel.DefaultChannelPipeline] : An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.lang.NoClassDefFoundError: Could not initialize class com.baidu.bjf.remoting.protobuf.utils.JDKCompilerHelper
        at com.baidu.bjf.remoting.protobuf.ProtobufProxy.doCreate(ProtobufProxy.java:397)
        at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:311)
        at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:276)
        at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:249)
        at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:208)
        at com.wjserver.ws.codec.ProtobufDecoder.decode(ProtobufDecoder.java:23)
        at com.wjserver.ws.codec.ProtobufDecoder.decode(ProtobufDecoder.java:40)
        at com.wjserver.ws.handler.WebSocketInHandler.channelRead0(WebSocketInHandler.java:41)

...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文