Reputation: 946
Does anyone know how to modify the "module" component of the global jndi names for ejb's deployed in a war under JBoss 7.2 (EAP 6.1)?
Per spec, the module name is the same as the base war name, which in my case includes a version number.
Here is the spec from oracle:
java:global/[<application-name>]/<module-name>/<bean-name>
In my case it yeilds:
java:/global/mywar-1.0/MyService
What I would like is:
java:/global/mywar/MyService
I know I can modify the name of the war prior to deployment, but would prefer to explicitly name the module via configuration file. I have attempted to use the ejb-jar.xml module-name, but it had no effect.
Upvotes: 4
Views: 2423
Reputation: 946
Solved: I ended up having to include/update the xsd/namespace for the later 3.0 spec for web.xml. This allows for a "module-name" element to be specified in the web.xml which will be used when creating the jndi name. Tested and working on JBoss EAP 6.1.
Here's the web.xml header and module-name element:
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<module-name>mywar</module-name>
Upvotes: 9
Reputation: 3414
What you need to do is create a jboss-web.xml and put it in META-INF right next to the web.xml. Put this inside it:
<jboss-web>
<context-root>mywar</context-root>
</jboss-web>
Cheers!
If this was packaged in an EAR, you would use the application.xml to do this.
Upvotes: 0