[jboss-as7-dev] Setting up implicit dependency on JMS provider impl module

David M. Lloyd david.lloyd at redhat.com
Wed Apr 20 09:09:45 EDT 2011


On 04/20/2011 02:38 AM, Jaikiran Pai wrote:
> Testing out AS 7.0.0.Beta3 with a sample JMS client web application
> showed up a CNFE for hornetq classes. The client web application is just
> a .war file with only one jsp (just for testing) which just uses the JMS
> API to send out a message to a queue:
>
>
> Context context = new InitialContext();
> Queue queue = (Queue) context.lookup("queue/test");
> ...
> QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory)
> context.lookup("java:/ConnectionFactory");
> QueueConnection queueConnection =
> queueConnectionFactory.createQueueConnection();
> QueueSession queueSession =
> queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
> QueueSender queueSender = queueSession.createSender(queue);
> //create a TextMessage
> TextMessage textMessage = queueSession.createTextMessage("Hello JBoss AS7");
> queueSender.send(textMessage);
> ...
>
>
> When testing this, it runs into this exception:
>
> 12:51:38,061 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) Caused by:
> java.lang.ClassNotFoundException:
> org.hornetq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy
> from [Module "deployment.test.war:main" from Service Module Loader]
> 12:51:38,061 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at
> org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:184)
> 12:51:38,062 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at
> org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:357)
> 12:51:38,062 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at
> org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:306)
> 12:51:38,063 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at
> org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:100)
> 12:51:38,068 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at
> org.hornetq.core.client.impl.ClientSessionFactoryImpl$1.run(ClientSessionFactoryImpl.java:1162)
> 12:51:38,069 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) ... 28 more
>
>
> Adding a Dependencies: org.hornetq to the .war/META-INF/MANIFEST.MF of
> the war and redeploying the war gets me past this issue. But shouldn't
> this dependency on our internal JMS provider impl module be setup
> automatically by one of our deployment unit processors, instead of the
> user having to do it?

No we should not need the dependency at all.  I think the problem here 
is HornetQ using the TCCL (from 
org.hornetq.core.client.impl.ClientSessionFactoryImpl$1.run) to load one 
of its own classes 
(org.hornetq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy). 
  It probably should be using its own class loader for this purpose, IMO.

-- 
- DML



More information about the jboss-as7-dev mailing list