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.
You have to set it up in the server starup script as a JVM variable:
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.
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.
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);
So it looks like I need to configure weblogic with a JNDI entry for a string named 'handlerPackage'. Where do you do this?
Thanks for the post I've now figured this out.
All that was needed was a env-entry in the web.xml