-
1. AS 6 & JNDI bindings: overriding the module name
genman Apr 6, 2011 8:57 PM (in response to vincent_aumont)I think context-root refers to the directory web pages are served from.
JBoss does have a way to relocate: http://docs.jboss.org/ejb3/app-server/tutorial/jndibinding/jndi.html
Also look at: http://community.jboss.org/thread/120550
-
2. AS 6 & JNDI bindings: overriding the module name
vincent_aumont Apr 6, 2011 9:34 PM (in response to genman)Thanks Elias.
The pb with LocalBinding it's that it's not portable. We're using GF Embedded in our unit tests.
I'm not sure the org.jboss.naming.NamingAlias can alias the jndi name in the global scope.
There must be an easier way. Could ejb-jar.xml be the solution?
-
3. Re: AS 6 & JNDI bindings: overriding the module name
jaikiran Apr 7, 2011 2:12 AM (in response to vincent_aumont)When I deploy this war, AS binds the bean to java:module/MyBean and java:global/myapp-1.0.0-SNAPSHOT/MyBean.
So far so good, but I'd like to map the bean in the global scope as java:global/myapp/MyBean
That syntax is mandated by the EJB3.1 spec. The myapp-1.0.0-SNAPSHOT is the "module" name and it can be overriden from within the module deployment descriptor. In this case it is the ejb-jar.xml. So something like this in the ejb-jar.xml should do it:
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" version="3.1"> <module-name>myapp</module-name> </ejb-jar>
-
4. Re: AS 6 & JNDI bindings: overriding the module name
vincent_aumont Apr 7, 2011 2:59 PM (in response to jaikiran)I tried this solution, but then I hit this bug:
https://issues.jboss.org/browse/JBAS-8846 ("JEE 6 application gives errors when deploying having ejb-jar.xml contain module name tag")
and all my EJB's fail to deploy:
{code}
Deployment "jboss.ejb3:application=webapp-1.0-SNAPSHOT,module=webapp-1.0-SNAPSHOT,component=DummyEJB,service=EjbEncFactory" is missing the following dependencies:
Dependency "jboss.naming:application=webapp-1.0-SNAPSHOT,component=DummyEJB,module=webapp-1.0-SNAPSHOT" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss.naming:application=webapp-1.0-SNAPSHOT,component=DummyEJB,module=webapp-1.0-SNAPSHOT' **")
{code}
-
5. AS 6 & JNDI bindings: overriding the module name
genman Apr 7, 2011 7:45 PM (in response to vincent_aumont)A lot of the AS 6 issues aren't going to be fixed by Redhat. Some have been closed due to lack of interest.
You *can* create patches for things like this. Check out the source and get hacking.