AnsweredAssumed Answered

JMSBytesMessage cannot be cast to javax.jms.TextMessage Error

Question asked by sandb8_b on May 13, 2016
Latest reply on Jan 17, 2017 by norre01

Hi All,

We are testing REST API which is talking to LISA MQ, we are seeing below error at client end (LISA Rest step) "JMSBytesMessage cannot be cast to javax.jms.TextMessage". We have got the msg.format=MQSTR in metadata response for each mq responses, this is still failing. As anyone seen this before please? let me know if we have some solution around getting this working. Apologies for pasting complete message was thinking if someone needs complete message to look out for error.

 

 

HTTP Status 500 - Request failed.

-------------------------------------------------------------------------------

type Exception report

message Request failed.

description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.lang.ClassCastException: com.ibm.jms.JMSBytesMessage cannot be cast to javax.jms.TextMessage

  org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:485)

  org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:386)

  org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:334)

  org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)

  org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

java.lang.ClassCastException: com.ibm.jms.JMSBytesMessage cannot be cast to javax.jms.TextMessage

  com.capitalone.webservice.utilities.JmsAdapter.sendMessage(JmsAdapter.java:98)

  com.capitalone.uk.coreapi.directdebit.dao.SetUpDirectDebitDaoImpl.setUpFixedPaymentDetails(SetUpDirectDebitDaoImpl.java:201)

  com.capitalone.uk.coreapi.directdebit.dao.SetUpDirectDebitDaoImpl$$FastClassBySpringCGLIB$$28fa0f1d.invoke(<generated>)

  org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

  org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717)

  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

  org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)

  com.capitalone.uk.coreapi.directdebit.aop.LoggerAOP.logAround(LoggerAOP.java:39)

  sun.reflect.GeneratedMethodAccessor500.invoke(Unknown Source)

  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

  java.lang.reflect.Method.invoke(Method.java:606)

  org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)

  org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)

  org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:68)

  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

  org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)

  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

  org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)

  com.capitalone.uk.coreapi.directdebit.dao.SetUpDirectDebitDaoImpl$$EnhancerBySpringCGLIB$$a7090f23.setUpFixedPaymentDetails(<generated>)

  com.capitalone.uk.coreapi.directdebit.service.SetUpDirectDebitServiceImpl.setUpDirectDebit(SetUpDirectDebitServiceImpl.java:70)

  com.capitalone.uk.coreapi.directdebit.service.SetUpDirectDebitServiceImpl$$FastClassBySpringCGLIB$$e358bd63.invoke(<generated>)

  org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

  org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717)

  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

  org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)

  com.capitalone.uk.coreapi.directdebit.aop.LoggerAOP.logAround(LoggerAOP.java:39)

  sun.reflect.GeneratedMethodAccessor500.invoke(Unknown Source)

  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

  java.lang.reflect.Method.invoke(Method.java:606)

  org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)

  org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)

  org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:68)

  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

  org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)

  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

  org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)

  com.capitalone.uk.coreapi.directdebit.service.SetUpDirectDebitServiceImpl$$EnhancerBySpringCGLIB$$dacfaaa9.setUpDirectDebit(<generated>)

  com.capitalone.uk.coreapi.directdebit.endpoint.SetUpDirectDebitEndpoint.setUpDirectDebit(SetUpDirectDebitEndpoint.java:112)

  com.capitalone.uk.coreapi.directdebit.endpoint.SetUpDirectDebitEndpoint$$FastClassBySpringCGLIB$$305b5741.invoke(<generated>)

  org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

  org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717)

  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

  org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)

  com.capitalone.uk.coreapi.directdebit.aop.LoggerAOP.logAround(LoggerAOP.java:39)

  sun.reflect.GeneratedMethodAccessor500.invoke(Unknown Source)

  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

  java.lang.reflect.Method.invoke(Method.java:606)

  org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)

  org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)

  org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:68)

  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

  org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:58)

  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

  org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)

  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

  org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)

  com.capitalone.uk.coreapi.directdebit.endpoint.SetUpDirectDebitEndpoint$$EnhancerBySpringCGLIB$$30e236f0.setUpDirectDebit(<generated>)

  sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

  java.lang.reflect.Method.invoke(Method.java:606)

  org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)

  org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)

  org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)

  org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)

  org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)

  org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)

  org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)

  org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)

  org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:309)

  org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)

  org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)

  org.glassfish.jersey.internal.Errors.process(Errors.java:315)

  org.glassfish.jersey.internal.Errors.process(Errors.java:297)

  org.glassfish.jersey.internal.Errors.process(Errors.java:267)

  org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)

  org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:292)

  org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1139)

  org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:460)

  org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:386)

  org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:334)

  org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)

  org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Outcomes