T
Tim Slattery
We run our JEE web apps in BEA (now Oracle) Weblogic. We've from time
to time explored alternatives. Generally moving a WAR to another
platform works fine, with one exception....
We have a JNDI data source defined in the container, say "myData". To
use it, we make a call like:
InitialContext ic = new InitialContext();
DataSource datasource = (DataSource) ic.lookup("myData");
In Weblogic this works just fine, and I can use the datasource to
access the DB. But when we tried JBoss, I had to search for
"java:/myData". And when I run the app in Tomcat, I have to use
"java:/comp/env/jdbc/myData".
So to move my app to another container, I have to recompile and
remake the WAR.
This seems completely nuts to me. Am I missing a way around this, or
am I doomed to recompile and/or add searches on more and more variants
of the JNDI name?
to time explored alternatives. Generally moving a WAR to another
platform works fine, with one exception....
We have a JNDI data source defined in the container, say "myData". To
use it, we make a call like:
InitialContext ic = new InitialContext();
DataSource datasource = (DataSource) ic.lookup("myData");
In Weblogic this works just fine, and I can use the datasource to
access the DB. But when we tried JBoss, I had to search for
"java:/myData". And when I run the app in Tomcat, I have to use
"java:/comp/env/jdbc/myData".
So to move my app to another container, I have to recompile and
remake the WAR.
This seems completely nuts to me. Am I missing a way around this, or
am I doomed to recompile and/or add searches on more and more variants
of the JNDI name?