找不到转换器转换为接口javax.jms.TextMessage

时间:2016-06-22 22:15:42

标签: spring-boot groovy apache-camel activemq

我正在运行一个Spring Boot应用程序,它从我的Spring STS环境作为消费者连接到activeMQ。然后我从我的JBoss Developer Studio应用程序运行我的骆驼蓝图。

以下是我的听众的代码:

>> pkg install -forge dicom
dicomread.cpp:27:38: fatal error: gdcm-2.0/gdcmImageReader.h: No such file or directory
compilation terminated.
make: *** [Makefile:44: dicomread.oct] Error 1
make: *** Waiting for unfinished jobs....
dicominfo.cpp:45:33: fatal error: gdcm-2.0/gdcmReader.h: No such file or directory
compilation terminated.
dicomlookup.cpp:23:31: fatal error: gdcm-2.0/gdcmDict.h: No such file or directory
compilation terminated.
make: *** [Makefile:51: dicominfo.o] Error 1
dicomdict.cpp:30:31: fatal error: gdcm-2.0/gdcmDict.h: No such file or directory
compilation terminated.
make: *** [Makefile:60: dicomlookup.o] Error 1
make: *** [Makefile:57: dicomdict.o] Error 1
make: Entering directory '/tmp/oct-5jTUbJ/dicom/src'
mkoctfile -c  -g dicominfo.cpp
mkoctfile -c  -g dicomdict.cpp
mkoctfile  -L/usr/local/lib -lgdcmcharls  -lgdcmjpeg8 -lgdcmjpeg12 -lgdcmjpeg16 -lgdcmCommon -lgdcmDICT -lgdcmDSED -lgdcmIOD -lgdcmMSFF   -g dicomread.cpp
mkoctfile -c  -g dicomlookup.cpp
make: Leaving directory '/tmp/oct-5jTUbJ/dicom/src'

pkg: error running `make' for the dicom package.
error: called from 'configure_make' in file /usr/share/octave/4.0.1/m/pkg/private/configure_make.m near line 96, column 9
>>

当消息点击消费者时,我得到以下异常:

@JmsListener(destination = '${tripRequest.updateStatus.destination}')
void handle(TextMessage message) {

我知道我们已经使用其他应用程序发送的短信对此进行了测试,此消息正常。我不明白为什么它从我的骆驼路线失败了。当我查看消息时,它似乎是格式良好的XML。这是:

org.springframework.jms.listener.adapter.ListenerExecutionFailedException: Listener method could not be invoked with incoming message
Endpoint handler details:
Method [public void com.xxx.trip.request.messaging.status.TripRequestUpdateStatusListener.handle(javax.jms.TextMessage)]
Bean [com.xxx.trip.request.messaging.status.TripRequestUpdateStatusListener@1a99744a]
; nested exception is org.springframework.messaging.converter.MessageConversionException: No converter found to convert to interface javax.jms.TextMessage, message=GenericMessage [payload=byte[197], headers={CamelFileLastModified=1466448102155, CamelFileParent=C:\Users\Thom\git\brms-poc-esb\rule-cancel\data, CamelFilePath=C:\Users\Thom\git\brms-poc-esb\rule-cancel\data\one.json, CamelFileLength=22, jms_destination=queue://tripRequest.updateStatus.v1.0, jms_priority=4, CamelFileAbsolute=true, jms_timestamp=1466631945834, CamelFileName=one.json, jms_redelivered=false, jms_deliveryMode=2, CamelFileNameConsumed=one.json, breadcrumbId=ID-ThomasLaptop-55017-1466631942306-0-1, jms_replyTo=temp-queue://ID:ThomasLaptop-55022-1466631945608-1:1:1, CamelFileRelativePath=one.json, jms_correlationId=Camel-ID-ThomasLaptop-55017-1466631942306-0-3, id=3c38a185-44c7-4df2-fefb-1f3320e0262f, CamelFileAbsolutePath=C:\Users\Thom\git\brms-poc-esb\rule-cancel\data\one.json, jms_expiration=1466631965834, jms_messageId=ID:ThomasLaptop-55022-1466631945608-1:1:2:1:1, CamelFileNameOnly=one.json, timestamp=1466631945924}]
    at org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:94) ~[spring-jms-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    at org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter.onMessage(MessagingMessageListenerAdapter.java:66) ~[spring-jms-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:721) ~[spring-jms-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:681) ~[spring-jms-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:651) ~[spring-jms-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:315) [spring-jms-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:253) [spring-jms-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1158) [spring-jms-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1150) [spring-jms-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1047) [spring-jms-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    at java.lang.Thread.run(Unknown Source) [na:1.8.0_91]
Caused by: org.springframework.messaging.converter.MessageConversionException: No converter found to convert to interface javax.jms.TextMessage, message=GenericMessage [payload=byte[197], headers={CamelFileLastModified=1466448102155, CamelFileParent=C:\Users\Thom\git\brms-poc-esb\rule-cancel\data, CamelFilePath=C:\Users\Thom\git\brms-poc-esb\rule-cancel\data\one.json, CamelFileLength=22, jms_destination=queue://tripRequest.updateStatus.v1.0, jms_priority=4, CamelFileAbsolute=true, jms_timestamp=1466631945834, CamelFileName=one.json, jms_redelivered=false, jms_deliveryMode=2, CamelFileNameConsumed=one.json, breadcrumbId=ID-ThomasLaptop-55017-1466631942306-0-1, jms_replyTo=temp-queue://ID:ThomasLaptop-55022-1466631945608-1:1:1, CamelFileRelativePath=one.json, jms_correlationId=Camel-ID-ThomasLaptop-55017-1466631942306-0-3, id=3c38a185-44c7-4df2-fefb-1f3320e0262f, CamelFileAbsolutePath=C:\Users\Thom\git\brms-poc-esb\rule-cancel\data\one.json, jms_expiration=1466631965834, jms_messageId=ID:ThomasLaptop-55022-1466631945608-1:1:2:1:1, CamelFileNameOnly=one.json, timestamp=1466631945924}]
    at org.springframework.messaging.handler.annotation.support.PayloadArgumentResolver.resolveArgument(PayloadArgumentResolver.java:118) ~[spring-messaging-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    at org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:98) ~[spring-messaging-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:138) ~[spring-messaging-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:107) ~[spring-messaging-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    at org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:90) ~[spring-jms-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    ... 10 common frames omitted

为什么我在发送文本时首先需要转换?为什么转换失败?

1 个答案:

答案 0 :(得分:1)

我猜你在找到问题之后创建了一个新问题,但忘记在这个问题中提到这个问题:How to send text message instead of byte message

您将消息作为字节有效内容发送,以便JMS使用者将消息有效内容作为javax.jms.BytesMessage接收,Spring Integration无法将其转换为javax.jms.TextMessage。因此,您可以更改代码以使用javax.jms.BytesMessage代替。或者让发件人将JMS消息作为基于文本而不是字节发送。