I'm trying to migrate a web application from Tomcat to Weblogic.
Tomcats server.xml lets you configure system environmental variables with <Environment name="XXX" type= ...>
What is the equivalent in Weblogic. I've tried searching dev2dev and the rest of the web but have hit a blank.
Thanks
-
Weblogic and Tomcat (4 messages)
- Posted by: Gary Bennett
- Posted on: August 26 2004 09:37 EDT
Threaded Messages (4)
- Weblogic and Tomcat by Sohail Sikora on August 26 2004 10:34 EDT
- Weblogic and Tomcat by Gary Bennett on August 27 2004 03:38 EDT
-
Weblogic and Tomcat by Gary Bennett on August 27 2004 03:57 EDT
- Weblogic and Tomcat by Gary Bennett on August 27 2004 04:18 EDT
-
Weblogic and Tomcat by Gary Bennett on August 27 2004 03:57 EDT
- Weblogic and Tomcat by Gary Bennett on August 27 2004 03:38 EDT
-
Weblogic and Tomcat[ Go to top ]
- Posted by: Sohail Sikora
- Posted on: August 26 2004 10:34 EDT
- in response to Gary Bennett
You have to set it up in the server starup script as a JVM variable:
-Dmyvariablename=myvariablevalue
This is in the JAVA_OPTIONS variable and you will find it in the startManagedWeblogic script.
If you want application level variables for the webapp, then you probably know that you have to use <context-param> in the web.xml
Do let us know if this addresses your question. -
Weblogic and Tomcat[ Go to top ]
- Posted by: Gary Bennett
- Posted on: August 27 2004 03:38 EDT
- in response to Sohail Sikora
Hi
Thought this was going to work, should have thought of it myself. Unfortunately I still get the same error:
javax.naming.NameNotFoundException: While trying to look up handlerPackage in java:comp/env.; remaining name 'handlerPackage'
Which tends to imply a JNDI issue. Until the developer gets in I can't tell you how he is trying to access 'handlerPackage' I'd assumed he was using
System.getProperty which I guess would work with your suggestion.
Just have to wait until I see the code.
Thanks -
Weblogic and Tomcat[ Go to top ]
- Posted by: Gary Bennett
- Posted on: August 27 2004 03:57 EDT
- in response to Gary Bennett
Hello
This does look like a JNDI issue, the code is
protected static final String LOOKUP = "java:comp/env";
protected static final String HANDLER_PACKAGE = "handlerPackage";
protected Context initCtx;
protected Context envCtx;
initCtx = new InitialContext();
envCtx = (Context) initCtx.lookup(LOOKUP);
setHandlerPackage((String) envCtx.lookup(HANDLER_PACKAGE));
So it looks like I need to configure weblogic with a JNDI entry for a string named 'handlerPackage'. Where do you do this? -
Weblogic and Tomcat[ Go to top ]
- Posted by: Gary Bennett
- Posted on: August 27 2004 04:18 EDT
- in response to Gary Bennett
Thanks for the post I've now figured this out.
All that was needed was a env-entry in the web.xml
Cheers