10 Replies Latest reply: Jul 28, 2011 10:46 AM by jaikiran pai RSS

MDB support in AS7

Prasad Deshpande Expert

Hi,

 

Does anyone know when MDB's will be available (planned) in AS7 (or any descendent (even nightly builds))? And what is the Ref no in JIRA for the same so that I can track the progress?

 

Thanks,

Prasad

  • 1. Re: MDB support in AS7
    jaikiran pai Master

    You're right on time! We just added MDB support to AS7 upstream yesterday. You should be able to start using/testing it with our latest nightly builds. Please report here in forums any issues that you run into.

     

    The JIRA by the way is https://jira.jboss.org/browse/AS7-579

  • 2. Re: MDB support in AS7
    Prasad Deshpande Expert

    Thanks Jaikiran,

     

    I indeed downloaded nightly build & tested MDB's against it. I found following issue with it:

     

     

    I get exception saying

     

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684)) javax.jms.JMSException: com.banctec.caseware.resources.Resource from [Module "org.hornetq:main" from local module loader @e49dcd (roots: D:\jboss-as-7.1.0.SNAPSHOT\modules)]

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at java.lang.Class.forName0(Native Method)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at java.lang.Class.forName(Class.java:247)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:603)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.hornetq.utils.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:69)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1574)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1623)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1322)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.hornetq.jms.client.HornetQObjectMessage.getObject(HornetQObjectMessage.java:158)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at com.banctec.caseware.server.logger.HistAuditLoggerBean.onMessage(HistAuditLoggerBean.java:70)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at java.lang.reflect.Method.invoke(Method.java:597)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:51)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:44)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.as.ee.component.ViewDescription$ComponentDispatcherInterceptor.processInvocation(ViewDescription.java:202)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.as.ejb3.component.messagedriven.MessageDrivenInvocationContextInterceptor.processInvocation(MessageDrivenInvocationContextInterceptor.java:60)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:146)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:76)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at javax.jms.MessageListener$$$view82.onMessage(Unknown Source)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at java.lang.reflect.Method.invoke(Method.java:597)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.as.ejb3.inflow.MessageEndpointInvocationHandler.doInvoke(MessageEndpointInvocationHandler.java:140)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.jboss.as.ejb3.inflow.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:73)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at $Proxy79.onMessage(Unknown Source)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.hornetq.ra.inflow.HornetQMessageHandler.onMessage(HornetQMessageHandler.java:278)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:866)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.hornetq.core.client.impl.ClientConsumerImpl.access$100(ClientConsumerImpl.java:44)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:983)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

    12:50:39,031 ERROR [stderr] (Thread-21 (group:HornetQ-client-global-threads-14296684))     at java.lang.Thread.run(Thread.java:662)

     

     

    This typically seems to me classloading issue. Class "com.banctec.caseware.resources.Resource" resides in my application whereas I guess hornetq is only trying to look into modules directory (perhaps same classloaders are different?).

     

    Here is relevant piece of my code:

     

    public void onMessage(Message msg) {

         if (msg instanceof ObjectMessage) {

              ObjectMessage objMsg = (ObjectMessage) msg;

              Resource[] res = (Resource[]) objMsg.getObject();

     

     

     

    Let me know if you need anything more

  • 4. Re: MDB support in AS7
    jaikiran pai Master

    By the way, can you attach the app or tell us how the application is packaged? Where is the MDB and where is the object class located within the application? I'll try and see if I can narrow it down.

  • 5. Re: MDB support in AS7
    Prasad Deshpande Expert

    Sorry Jaikiran, can't attach actual application, but surely can tell packaging, It's a typical EE5 appliaction packaging with MDB's are packaged in EJB-jar & object class is packaged in library jar & put in lib directory of ear. Here is how packaging is:

     

    EAR

    |

    +------- META-INF

    |              |

    |              +-- application.xml

    |

    +----- EJB.jar (MDB's are here with other session beans)

    |

    +----- <WAR files>

    |

    +----- lib

             |

            + helper jar's  (Object class goes here in one of the jar)

  • 6. Re: MDB support in AS7
    jaikiran pai Master

    I just added a testcase depicting this usecase (with the same packaging structure) https://github.com/jaikiran/jboss-as/commit/73e74f7309aabb28b6819d1ff391e7f7b8c042d4 and that is passing.

     

    Can you tell us a bit more about your deployment? Do you see this when the server is booting?

  • 7. Re: MDB support in AS7
    jaikiran pai Master

    Never mind, the code that you posted earlier helped. I was able to reproduce this in the testcase after modifying it to pass a object array as a ObjectMessage https://github.com/jaikiran/jboss-as/commit/ea7e04611134768ba6761ac627a0285e881887d7.

     

    It's a bug in HornetQ which use ClassLoader.loadClass instead of Class.forName(name, classloader).

  • 8. Re: MDB support in AS7
    Prasad Deshpande Expert

    No, when server is booting, everything seems to be fine.. it's just when application sends message & onMessage get's triggered, that time getObject() in above code throws this exception.

     

    I can share whatever information you want, let me know your questions. Also were you able to reproduce this?

  • 9. Re: MDB support in AS7
    Prasad Deshpande Expert

    Ok, thanks Jaikiran, do you reckon, it might get fixed anytime sooner in Hornetq & them gets integrated with AS7 descendents?

  • 10. Re: MDB support in AS7
    jaikiran pai Master

    Prasad Deshpande wrote:

     

    Ok, thanks Jaikiran, do you reckon, it might get fixed anytime sooner in Hornetq & them gets integrated with AS7 descendents?

    I'll check with Jason.