I have a simple program (written in Java) which uses the google protocol buffer and it works fine on a windows machine.
But when I run it on a linux machine I get the following exception :
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)
I use the same jar file for the protocol buffer in both machines.
Protoc and the protobuf runtime library (jar) are tightly coupled. You cannot use an older protoc with a newer runtime nor vice versa. Please double-check that you use exactly the same version of the protobuf jar file on Windows and on Linux, and this version is the same as version of protoc you used to generate Java code.