I'm trying to get a <env-entry>
entry I defnined in the web.xml
of a war inside a .ear deployed application in Weblogic 12c :
<env-entry>
<env-entry-name>java:app/test</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>1111111</env-entry-value>
</env-entry>
and, in my code :
Object test = InitialContext.doLookup("java:app/test");
System.out.println(test);
An exception is throwned :
javax.naming.NameNotFoundException: While trying to look up /app/test in /app/webapp/xxx/yyy/1243828215.; remaining name '/app/test'
Weblogic seems to modify something in the JNDI resolution process : "xxx/yyy" is the context-root of my application in Weblogic and "1243828215" is a random number!
Any idea how I can defined the <env-entry>
entries so they can be retrieved using InitialContext.doLookup()
?