Which version of JDK are you using? >From the stack trace, it looks like you cannot cast the com.ibm.mq.jms.MQSession to com.ibm.mq.jms.MQQueueSession. I think you need to check the client code for more information.
Willem Jiang Twitter: willemjiang Weibo: 姜宁willem On Fri, Oct 18, 2019 at 11:51 PM Wang Yan <wyan...@gmail.com> wrote: > > I have problem , camel is always sending MQRFH2 headers to target > WebsphereMQ queue > > I used below code try to solve the problem but i got > Setup of JMS message listener invoker failed for destination > > - trying to recover. Cause: class com.ibm.mq.jms.MQSession cannot be cast > to class com.ibm.mq.jms.MQQueueSession (com.ibm.mq.jms.MQSession and > com.ibm.mq.jms.MQQueueSession are in unnamed module of loader > org.springframework.boot.loader.LaunchedURLClassLoader @5056dfcb) > > > IBM library i used is > // https://mvnrepository.com/artifact/com.ibm.mq/com.ibm.mq.allclient > implementation 'com.ibm.mq:com.ibm.mq.allclient:9.1.1.0' > > What could be the problem? Did I used to wrong libs? any suggestions or > feedback are more than welcome! > > > JmsComponent wmq = new JmsComponent(connectionFactory); > wmq.setDestinationResolver(new DestinationResolver() { public Destination > resolveDestinationName(Session session, String destinationName, boolean > pubSubDomain) throws JMSException { MQQueueSession wmqSession = > (MQQueueSession) session; return wmqSession.createQueue("queue:///" + > destinationName + "?targetClient=1"); } });