I have the following problem, I want to run an application on weblogic and on JBoss.
If I want to make a datasource-lookup in Weblogic it looks like:
this.dataSource = (DataSource) context.lookup("TestDB");
If I want to make a datasource-lookup in JBoss I have to add the prefix "java:/" and then it looks like:
this.dataSource = (DataSource) context.lookup("java:/TestDB");
Weblogic does not run with the java:/ - Prefix. Is there a possibility that JBoss binds the datasource without the prefix?
Can't you declare "TestDB" as the resource-ref (resource reference) in ejb-jar.xml and define in the jboss.xml that the resource reference resolves to a res-jndi-ref "java:/TestDB" for EJBs? You can achieve the same with WARs using jboss-web.xml.