我有一个使用 google 协议缓冲区的简单程序(用 Java 编写),它在 Windows 机器上运行良好。
但是当我在 linux 机器上运行它时,我得到以下异常:
com.google.protobuf.Descriptors$FileDescriptor.internalBuildGeneratedFileFrom(Ljava/lang/String;[Lcom/google/protobuf/Descriptors$FileDescriptor;Lcom/google/protobuf/Descriptors$FileDescriptor$InternalDescriptorAssigner;
at com.test.integration.protocols.protocolBuffers.messages.TestMsgs.<clinit>(TestMsgs.java:5111)
at com.test.integration.protocols.protocolBuffers.messages.TestMsgs$SessionInfo.<clinit>(TestMsgs.java:3346)
at com.test.integration.protocols.protocolBuffers.messages.TestMsgs$TestRequest.<init>(TestMsgs.java:782)
at com.test.integration.protocols.protocolBuffers.messages.TestMsgs$TestRequest.<clinit>(TestMsgs.java:760)
at com.test.simulators.TestJmsListener.onMessage(TestJmsListener.java:80)
at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1215)
at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:131)
at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:202)
at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:122)
at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:43)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
我对两台机器的协议缓冲区使用相同的 jar 文件。