0 Replies Latest reply on Nov 12, 2012 8:04 AM by Mylos Kathos

    JMS client as a module

    Mylos Kathos Master

      Hi all !

      I would need to install a JMS utility class as a module which can be used by applications to send JMS messages.

      As first trial, I have got the helloworld-jms example from the quickstart and simply changed the main method into a generic sendMessage(String message).

      Then I have installed it as a module by adding all the dependencies I could imagine:

       

      <module xmlns="urn:jboss:module:1.0" name="com.JMSClient">

      <resources>

      <resource-root path="jmsclient.jar"/>

      </resources>

         <dependencies>

       

              <module name="javax.api"/>

              <module name="javax.transaction.api"/>

              <module name="org.hornetq"/>

              <module name="org.hornetq.ra"/>

              <module name="org.jboss.as.transactions"/>

              <module name="org.jboss.netty"/>

              <module name="org.jboss.staxmapper"/>

              <module name="org.jboss.as.controller"/>

              <module name="org.jboss.as.naming"/>

              <module name="org.jboss.as.network"/>

              <module name="org.jboss.as.server"/>

              <module name="org.jboss.msc"/>

              <module name="org.jboss.logging"/>

              <module name="org.jboss.ironjacamar.impl"/>

              <module name="org.jboss.ironjacamar.api"/>

              <module name="org.jboss.as.connector" />

              <module name="org.jboss.as.security"/>

              <module name="org.jboss.vfs"/>

              <module name="org.picketbox"/>

              <module name="org.jboss.jboss-transaction-spi"/>

              <module name="org.jboss.as.messaging"/>

              <module name="javax.jms.api" />

         </dependencies>

      </module>

       

      However when I try to use the Utility class in a web application I get the following error

       

      13:59:39,628 GRAVE [com.JMSClient] (http--127.0.0.1-8080-1) JBAS011843: Failed instantiate InitialContextFactory org.jboss.naming.remote.client.InitialContextFactory from classloader ModuleClassLoader for Module "deployment.jms.war:main" from Service Module Loader

       

      What is really odd is that the helloworld sample from the quickstart works correctly when executed from the maven command line. am I missing some dependencies in my module declaration maybe ?

      Thanks

      Mylos