Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-5082

WebSphere MQ 8 RA - [TCK] ClassCastException when calling toString() on JMSContext

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 10.0.0.Alpha6
    • Fix Version/s: 10.1.0.CR1, 10.1.0.Final
    • Component/s: None
    • Labels:
      None

      Description

      TCK 7 tests are calling toString() on JMSContext to print trace information about jms context like:

          ...
          @TransactionAttribute(TransactionAttributeType.REQUIRED)
          public void method1a() {
          TestUtil.logMsg("CMBean1.method1a(): JMSContext context="+context); <-- this is the line
          ...
      

      This call is handled by ActiveMQ Artemis integration because it provides JMSContextProducer for CDI by which JMSContext was injected to EJB in TCK test. Problem occurs in call of JMSContextProducer#JMSContextWrapper.create():

      ...
                  ConnectionFactory cf = (ConnectionFactory) lookup(info.connectionFactoryLookup);
                  if (inTransaction) {
                      XAJMSContext xaContext = ((XAConnectionFactory) cf).createXAContext(info.userName, info.password);
                      return xaContext.getContext();
                 ...
      

      Looked up connection factory is instance of class com.ibm.mq.connector.outbound.ManagedQueueConnectionFactoryImpl which does not implement javax.jms.XAConnectionFactory interface.

      Tests fails with:

      15:06:28,130 INFO  [stdout] (EJB default - 4) cfactory=com.ibm.mq.connector.outbound.QueueConnectionFactoryImpl@4bb55738
      15:06:28,203 ERROR [org.jboss.as.ejb3.invocation] (EJB default - 5) WFLYEJB0034: EJB Invocation failed on component CDIUseCasesCMBEAN1 for method public abstract void com.sun.ts.tests.jms.ee20.cditests.usecases.CMBean1IF.method1a(): javax.ejb.EJBException: java.lang.ClassCastException: com.ibm.mq.connector.outbound.QueueConnectionFactoryImpl cannot be cast to javax.jms.XAConnectionFactory
      	at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:187) [wildfly-ejb3-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:277) [wildfly-ejb3-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:327) [wildfly-ejb3-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239) [wildfly-ejb3-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.as.ejb3.remote.EJBRemoteTransactionPropagatingInterceptor.processInvocation(EJBRemoteTransactionPropagatingInterceptor.java:79) [wildfly-ejb3-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [wildfly-ejb3-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43) [wildfly-ejb3-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100) [wildfly-ejb3-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [wildfly-ejb3-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:66) [wildfly-ejb3-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54) [wildfly-ejb3-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
      	at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:635)
      	at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
      	at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
      	at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:195)
      	at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.invokeMethod(MethodInvocationMessageHandler.java:331) [wildfly-ejb3-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$100(MethodInvocationMessageHandler.java:69) [wildfly-ejb3-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:202) [wildfly-ejb3-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_51]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_51]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_51]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_51]
      	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_51]
      	at org.jboss.threads.JBossThread.run(JBossThread.java:320)
      Caused by: java.lang.ClassCastException: com.ibm.mq.connector.outbound.QueueConnectionFactoryImpl cannot be cast to javax.jms.XAConnectionFactory
      	at org.wildfly.extension.messaging.activemq.deployment.JMSContextProducer$JMSContextWrapper.create(JMSContextProducer.java:192) [wildfly-messaging-activemq-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.wildfly.extension.messaging.activemq.deployment.JMSContextProducer$JMSContextWrapper.getDelegate(JMSContextProducer.java:217) [wildfly-messaging-activemq-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.wildfly.extension.messaging.activemq.deployment.JMSContextProducer$JMSContextWrapper.toString(JMSContextProducer.java:477) [wildfly-messaging-activemq-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at java.lang.String.valueOf(String.java:2982) [rt.jar:1.8.0_51]
      	at java.lang.StringBuilder.append(StringBuilder.java:131) [rt.jar:1.8.0_51]
      	at com.sun.ts.tests.jms.ee20.cditests.usecases.CMBean1.method1a(CMBean1.java:105) [cditestsusecases_ejb.jar:]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_51]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_51]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_51]
      	at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_51]
      	at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
      	at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82) [wildfly-weld-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93) [wildfly-weld-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) [wildfly-ejb3-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
      	at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73) [weld-core-impl-2.3.0.Beta2.jar:2015-07-01 06:18]
      	at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83) [wildfly-weld-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) [wildfly-ee-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
      	at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [wildfly-ejb3-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      	at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275) [wildfly-ejb3-10.0.0.Alpha5-redhat-1.jar:10.0.0.Alpha5-redhat-1]
      	... 39 more
      

      Affected tests:
      [javatest.batch] FAILED........com/sun/ts/tests/jms/ee20/cditests/usecases/Client.java#beanUseCaseA
      [javatest.batch] FAILED........com/sun/ts/tests/jms/ee20/cditests/usecases/Client.java#beanUseCaseB
      [javatest.batch] FAILED........com/sun/ts/tests/jms/ee20/cditests/usecases/Client.java#beanUseCaseC
      [javatest.batch] FAILED........com/sun/ts/tests/jms/ee20/cditests/usecases/Client.java#beanUseCaseD
      [javatest.batch] FAILED........com/sun/ts/tests/jms/ee20/cditests/usecases/Client.java#beanUseCaseE
      [javatest.batch] FAILED........com/sun/ts/tests/jms/ee20/cditests/usecases/Client.java#beanUseCaseF
      [javatest.batch] FAILED........com/sun/ts/tests/jms/ee20/cditests/usecases/Client.java#beanUseCaseG
      [javatest.batch] FAILED........com/sun/ts/tests/jms/ee20/cditests/usecases/Client.java#beanUseCaseH
      [javatest.batch] FAILED........com/sun/ts/tests/jms/ee20/cditests/usecases/Client.java#beanUseCaseJ
      [javatest.batch] FAILED........com/sun/ts/tests/jms/ee20/cditests/usecases/Client.java#beanUseCaseK

      Customer impact:
      If JMSContext is injected using CDI like:

      //JMSContext CDI injection specifying ConnectionFactory 
          @Inject
          @JMSConnectionFactory("jms/ConnectionFactory")
          JMSContext context;

      then call of toString() method on this JMSContext will lead to java.lang.ClassCastException.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jmesnil Jeff Mesnil
                  Reporter:
                  mnovak Miroslav Novak
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: