我正在尝试通过Camel CXF Consumer Client连接Weblogic JMS主题。但是,它给出了以下错误。
此问题可能是因为jar不兼容。
但是,我不确定哪个jar版本的spring-jms导致了这个问题?
我正在使用
骆驼版:2.11.3org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is weblogic.jms.common.JMSException: weblogic.messaging.dispatcher.DispatcherException: java.rmi.UnmarshalException: Problem deserializing error response; nested exception is:
java.io.InvalidClassException: javax.jms.JMSException; local class incompatible: stream classdesc serialVersionUID = 8951994251593378324, local class serialVersionUID = 2368476267211489441
at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:316)
at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:469)
at org.springframework.jms.core.JmsTemplate.receiveSelected(JmsTemplate.java:703)
at org.springframework.jms.core.JmsTemplate.receive(JmsTemplate.java:681)
at org.springframework.jms.core.JmsTemplate.receive(JmsTemplate.java:672)
at org.apache.camel.component.jms.JmsPollingConsumer.receive(JmsPollingConsumer.java:60)
at org.apache.camel.component.jms.JmsPollingConsumer.receive(JmsPollingConsumer.java:50)
at org.apache.camel.impl.ConsumerCache.receive(ConsumerCache.java:105)
at org.apache.camel.impl.DefaultConsumerTemplate.receive(DefaultConsumerTemplate.java:82)
at examples.TestSimpleBuilder2.main(TestSimpleBuilder2.java:65)
Caused by: weblogic.jms.common.JMSException: weblogic.messaging.dispatcher.DispatcherException: java.rmi.UnmarshalException: Problem deserializing error response; nested exception is:
java.io.InvalidClassException: javax.jms.JMSException; local class incompatible: stream classdesc serialVersionUID = 8951994251593378324, local class serialVersionUID = 2368476267211489441
at weblogic.jms.dispatcher.DispatcherAdapter.convertToJMSExceptionAndThrow(DispatcherAdapter.java:116)
at weblogic.jms.dispatcher.DispatcherAdapter.dispatchSyncNoTran(DispatcherAdapter.java:61)
at weblogic.jms.client.JMSSession.createDestination(JMSSession.java:3192)
at weblogic.jms.client.JMSSession.createTopic(JMSSession.java:2427)
at weblogic.jms.client.WLSessionImpl.createTopic(WLSessionImpl.java:1123)
at org.springframework.jms.support.destination.DynamicDestinationResolver.resolveTopic(DynamicDestinationResolver.java:82)
at org.springframework.jms.support.destination.DynamicDestinationResolver.resolveDestinationName(DynamicDestinationResolver.java:63)
at org.springframework.jms.support.destination.JmsDestinationAccessor.resolveDestinationName(JmsDestinationAccessor.java:100)
at org.springframework.jms.core.JmsTemplate.access$2(JmsTemplate.java:1)
at org.springframework.jms.core.JmsTemplate$10.doInJms(JmsTemplate.java:705)
at org.springframework.jms.core.JmsTemplate$10.doInJms(JmsTemplate.java:1)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:466)
... 8 more
Caused by: weblogic.messaging.dispatcher.DispatcherException: java.rmi.UnmarshalException: Problem deserializing error response; nested exception is:
java.io.InvalidClassException: javax.jms.JMSException; local class incompatible: stream classdesc serialVersionUID = 8951994251593378324, local class serialVersionUID = 2368476267211489441
at weblogic.messaging.dispatcher.DispatcherWrapperState.dispatchSyncTran(DispatcherWrapperState.java:345)
at weblogic.messaging.dispatcher.DispatcherWrapperState.dispatchSyncNoTran(DispatcherWrapperState.java:381)
at weblogic.jms.dispatcher.DispatcherAdapter.dispatchSyncNoTran(DispatcherAdapter.java:59)
... 18 more
Caused by: java.rmi.UnmarshalException: Problem deserializing error response; nested exception is:
java.io.InvalidClassException: javax.jms.JMSException; local class incompatible: stream classdesc serialVersionUID = 8951994251593378324, local class serialVersionUID = 2368476267211489441
at weblogic.rjvm.ResponseImpl.getThrowable(ResponseImpl.java:195)
at weblogic.messaging.dispatcher.DispatcherProxy.unmarshalResponse(DispatcherProxy.java:263)
at weblogic.messaging.dispatcher.DispatcherProxy.dispatchSyncTranFuture(DispatcherProxy.java:134)
at weblogic.messaging.dispatcher.DispatcherWrapperState.dispatchSyncTran(DispatcherWrapperState.java:334)
... 20 more
Caused by: java.io.InvalidClassException: javax.jms.JMSException; local class incompatible: stream classdesc serialVersionUID = 8951994251593378324, local class serialVersionUID = 2368476267211489441
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:604)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1601)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1514)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1601)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1514)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1970)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:498)
at java.lang.Throwable.readObject(Throwable.java:913)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1004)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1872)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1777)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:208)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:599)
at weblogic.rjvm.ResponseImpl.getThrowable(ResponseImpl.java:193)
... 23 more
答案 0 :(得分:1)
看起来发件人和收件人有不同版本的邮件类。
java.io.InvalidClassException: javax.jms.JMSException; local class incompatible: stream classdesc serialVersionUID = 8951994251593378324, local class serialVersionUID = 2368476267211489441
您是否重新生成了serialVersionUID并重新编译了生产者或消费者的一些代码?
避免此类问题的一个选择是将数据序列化为XML或JSON,而不是依赖于Java的内置序列化支持。