Hi there,
I create an enterprise application with two ejb, a war and a library. The application have some web services and sometimes I need to identify module that call a library, so, in the library I used this statement:
Context context = new InitialContext();
return context.lookup("java:module/ModuleName").toString();
I have a strange behavior during deploy phase. I get several errors like this:
Info: 2017-09-27 22:35:07,659 FATAL RedevoLog SerialContext.java 494 javax.naming.NamingException: Lookup failed for 'java:module/ModuleName' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, org.osjava.jndi.root=classpath://config, org.osjava.jndi.delimiter=/, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NamingException: Could not resolve java:module/ModuleName]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:494) Somethings wrong in retrieving Java Modue Name: null
What is the reason that produce this kind of error during deploy phase? Why do lookup fail?
Please help me.
Thanks in advance.
Gazzille