1
votes

My application requires a JNDI property, which basically is a simple java.lang.String. In tomcat this is easy to define the context.xml, while it's also easy in the glassfish admin console.

However, I cannot find how to do this in Weblogic 10.0. My property should be in java:comp/env

EDIT

I have found another question, where answers show this isn't really possible out of the box in WLS 10.0 Adding custom object to JNDI on Weblogic 10

However, there is a plugin which would do the trick: http://code.google.com/p/weblogic-jndi-startup/

I changed my code to fall back on an environment veriable if this fails. Not too nice, but fixed for me.

2

2 Answers

0
votes

Check this: http://download.oracle.com/docs/cd/E15051_01/wls/docs103/webapp/configureresources.html#wp159026

I think it might at least give you a direction. Setting a value to the property seems to be more difficult.

0
votes

try the weblogic-jndi-startup

Unlike JBoss and Glassfish there is no way to define a custom JNDI object (eg a URL) in the WebLogic console. This provides a very simple way to do that.

in your case, you can use the String object instead of the URL one

Context context = new InitialContext();
String url = String.valueOf(context.lookup("configURL"));