[jboss-as7-dev] Setting up implicit dependency on JMS provider impl module
Jaikiran Pai
jpai at redhat.com
Wed Apr 20 03:38:04 EDT 2011
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?
-Jaikiran
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-as7-dev/attachments/20110420/d9fdd708/attachment.html
More information about the jboss-as7-dev
mailing list