gpt4 book ai didi

java - Camel CXF JMS 连接问题

转载 作者:行者123 更新时间:2023-11-30 08:25:27 28 4
gpt4 key购买 nike

我正在尝试通过 Camel CXF 消费者客户端连接 Weblogic JMS 主题。但是,它给出了以下错误。

这个问题可能是因为 jars 不兼容。

但是,我不确定是哪个 jar 版本的 spring-jms 导致了这个问题?

我正在使用

Camel 版本:2.11.3
spring-jms-3.0.4.RELEASE.jar

org.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

最佳答案

看起来发送方和接收方具有不同版本的消息类。

java.io.InvalidClassException: javax.jms.JMSException; local class incompatible: stream classdesc serialVersionUID = 8951994251593378324, local class serialVersionUID = 2368476267211489441

您能否重新生成 serialVersionUID 并在生产者或消费者上重新编译一些代码?

避免此类问题的一种方法是将数据序列化为 XML 或 JSON,而不是依赖 Java 的内置序列化支持。

关于java - Camel CXF JMS 连接问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22192935/

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