2 Replies Latest reply on Jan 12, 2012 9:41 AM by Jeremy Whiting

    IllegalArgumentException causing rollback on MDB invocation.

    Jeremy Whiting Expert

      Hi,

      I am seeing an exception when invoking an MDB. Some background first and then the exception stack trace follows.

       

      The MDB is coded to JEE5 specification that has a field of type javax.ejb.MessageDrivenContext. It is a JMS Queue managed object that is injected into the MDB. The functionality of the MDB is to put messages onto a queue depending on some logic.

       

      The MDB looks like this

       

      ...

      public class DecisionMDB implements MessageListener {

         

          @Resource (mappedName="java:jboss/jms/WorkerQueue")

          private MessageDrivenContext messageDrivenContext;

         

          @Resource(mappedName="java:/JmsXA")

          protected QueueConnectionFactory queueConnFactory;

      ...

       

      When the MDB onMessage method is invoked this stack trace is logged.

       

      11:07:23,652 ERROR [org.hornetq.ra.inflow.HornetQMessageHandler] (Thread-6 (group:HornetQ-client-global-threads-455036670)) Failed to deliver message: javax.ejb.EJBTransactionRolledbackException: JBAS011048: Failed to construct component instance

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:139)

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:204)

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:306)

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

          at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

          at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponentDescription$4$1.processInvocation(MessageDrivenComponentDescription.java:176)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

          at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

          at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:57)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

          at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165)

          at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:173)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

          at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72)

          at javax.jms.MessageListener$$$view20.onMessage(Unknown Source)

          at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source) [:1.6.0_22]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.6.0_22]

          at java.lang.reflect.Method.invoke(Method.java:616) [:1.6.0_22]

          at org.jboss.as.ejb3.inflow.MessageEndpointInvocationHandler.doInvoke(MessageEndpointInvocationHandler.java:140)

          at org.jboss.as.ejb3.inflow.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:73)

          at $Proxy89.onMessage(Unknown Source)    at org.hornetq.ra.inflow.HornetQMessageHandler.onMessage(HornetQMessageHandler.java:278)

          at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:866)

          at org.hornetq.core.client.impl.ClientConsumerImpl.access$100(ClientConsumerImpl.java:44)

          at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:983)

          at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.6.0_22]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.6.0_22]

          at java.lang.Thread.run(Thread.java:679) [:1.6.0_22]

      Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance

          at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163)

          at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:85)

          at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent$1.create(MessageDrivenComponent.java:77)

          at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent$1.create(MessageDrivenComponent.java:74)

          at org.jboss.as.ejb3.pool.AbstractPool.create(AbstractPool.java:60)

          at org.jboss.as.ejb3.pool.strictmax.StrictMaxPool.get(StrictMaxPool.java:128)

          at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:47)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:202)

          ... 34 more

      Caused by: java.lang.IllegalArgumentException: Can not set javax.ejb.MessageDrivenContext field org.xxx.mdb.WorkerMDB.messageDrivenContext to org.hornetq.jms.client.HornetQQueue

          at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:164) [:1.6.0_22]

          at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:168) [:1.6.0_22]

          at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81) [:1.6.0_22]

          at java.lang.reflect.Field.set(Field.java:675) [:1.6.0_22]

          at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:111)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

          at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:112)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

          at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:112)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

          at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

          at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

          at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

          at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

          at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

          at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161)

          ... 42 more

       

       

      Should a JIRA be raised for this ?

       

      Regards,

      Jeremy