-
1. Re: JNDI look up binding
bcantrick May 18, 2012 6:50 PM (in response to camiloahm)One thing that catches my eye is: <datasource jta="false" <-- Maybe that needs to be jta="true" ?
Another thing you can try, I don't know if this will work or not...
Make a WEB-INF/jboss-web.xml file in your .WAR file. Inside it put:
<jboss-web>
<resource-ref>
<res-ref-name>prueba2-copia-por-jta</res-ref-name> <!-- Fake name. -->
<jndi-name>java:/prueba2<jndi-name> <!-- Real JNDI name. -->
<res-type>javax.sql.DataSource</res-type>
</resource-ref>
</jboss-web>
And then in persistence.xml:
<jta-data-source>prueba2-copia-por-jta</jta-data-source>
I dunno if any of that will help or not. But you can try it.
-
2. Re: JNDI look up binding
camiloahm May 22, 2012 3:07 PM (in response to bcantrick)Hi Ben
Thanks for the answer
It works with jboss-ejb3.xml and with jboss-web.xml but that's what I want to avoid because I have many resources in my projects.
-
3. Re: JNDI look up binding
bcantrick May 22, 2012 5:17 PM (in response to camiloahm)Whoops, sorry! I should have read your original post more carefully.
-
4. Re: JNDI look up binding
jaikiran May 23, 2012 1:51 AM (in response to camiloahm)Camilo Andrés Hernández wrote:
And I got an exception during service startup DuplicateServiceException,
Please post the entire exception stacktrace. What version of JBoss AS7 is this?
-
5. Re: JNDI look up binding
piwaf Feb 22, 2013 12:41 PM (in response to camiloahm)Did you ever get this to work? I am trying to do the same, a global alias defined in the profile rather then in the individual deployments.
-
6. Re: JNDI look up binding
piwaf Feb 22, 2013 12:54 PM (in response to camiloahm)A little more research and I answered my own question, yes it's possible and here's how. It's basically what you tried but I believe your lack of "java:" is what messed you up in the name element of the lookup.
<subsystem xmlns="urn:jboss:domain:naming:1.1" >
<bindings>
<lookup name="java:global/c" lookup="java:global/b" />
</bindings>
</subsystem>
From https://docs.jboss.org/author/display/AS71/JNDI+Reference