Shared Services

Latest response

I have a need to create a shared audit service that will be available to all applications running on the server. It seems the correct way to do this would be to create a statemless session bean, install it as a module, and make it global in the config file.

The creation of the stateless EJB works great. When I deploy it through the deployment directory (by dropping the .jar file there), it registers fine and works great.

When I then configure it to be a module in the static modules directory structure, it fails to load the bean.

What I did was create a module.xml file, point it at the jar, set up the dependencies, and set a global module in urn:jboss:domain:ee:1.1.

The jar IS available globally, as I can reference the classes in the jar from other applications deployed in the deployment directory. It just won't load the stateless bean. This is the same jar that works fine from the deployment directory.

I have searched for any documentation on how to make this work and cannot find any. Does anyone have a clue how to get this to load? Am I missing some kind of module initialization method or something? There is no error generated. The log looks fine. But the bean is never loaded to JNDI and does not become available for injection into other applications. I can make it work fine by using the JBoss-Structure xml and referencing a dynamic module.


<module xmlns="urn:jboss:module:1.1" name="com.wellsfargo.wbr.investments.auditservice"> <resources> <resource-root path="AuditService-0.0.1.jar"/> </resources> <dependencies> <!-- These come from org.jboss.as.messaging.--> <module name="javax.api"/> <module name="javax.jms.api"/> <module name="javax.transaction.api"/> <module name="org.hornetq"/> <module name="org.hornetq.ra"/> <module name="org.jboss.common-beans"/> <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.ee"/> <module name="org.jboss.as.naming"/> <module name="org.jboss.as.network"/> <module name="org.jboss.as.server"/> <module name="org.jboss.modules"/> <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.jboss.metadata"/> <module name="org.picketbox"/> <module name="org.jboss.jboss-transaction-spi"/> <module name="org.jboss.remote-naming"/> <module name="org.jboss.threads"/> <!-- JGroups is required only as an option to cluster HornetQ nodes --> <module name="org.jboss.as.clustering.jgroups" optional="true"/> <module name="org.jgroups" optional="true"/> <!-- For EJB integration --> <module name="org.jboss.as.ejb3" optional="true"/> <module name="javax.ejb.api"/> <module name="javax.persistence.api"/> <module name="javax.interceptor.api"/> <!-- org.jboss.util.deadlock.ApplicationDeadlockException --> <module name="org.jboss.common-core"/> <module name="org.jboss.marshalling"/> <module name="org.jboss.marshalling.river"/> </dependencies> </module> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ <subsystem xmlns="urn:jboss:domain:ee:1.1"> <global-modules> <module name="sun.jdk" slot="main"/> <module name="com.wellsfargo.wbr.investments.auditservice" slot="main"/> </global-modules> <spec-descriptor-property-replacement>false</spec-descriptor-property-replacement> <jboss-descriptor-property-replacement>true</jboss-descriptor-property-replacement> </subsystem>

Responses