views:

918

answers:

3

I've been tasked with deploying an application built by a third party on an Oracle Application Server, version 10.1.3.0. I've deployed it on Oracle Application Server version 10.1.2.0 without much difficulty. I'm getting the following error:

javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException: 
No such domain/application: "etrace"; nested exception is: 
        javax.naming.AuthenticationException: No such domain/application: "etrace" 
     [Root exception is javax.naming.AuthenticationException: No such domain/application: "etrace"]
        at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:64)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)

Before that the application code instantiates and initializes an InitialContext Object and performs the lookup method call. The value it passes is just a String with the value of the fully qualified name of the class being requested (com.ntc.tracing.app.security.EtraceAuthenticatorService). Looking at the InitialContext object, I know it has the following parameters set in the environments hashtable:

java.naming.factory.initial: com.evermind.server.rmi.RMIInitialContextFactory
java.naming.provider.url: ormi://ntcdevr310g22:12401/etrace
java.naming.factory.url.pkgs: oracle.oc4j.naming.url
java.naming.security.principal: admin
java.naming.security.credentials: admin1

The provider url, principal and credentials are set by me (via command line).

I'm confused as to what the error even means. If I give it a "bad" provider url or no principal and pass, I'll get a different error (NullPointerException). That tells me it's hitting the naming provider, but it's not saying it can't find the class.

Any suggestions would be greatly appreciated. Right now I'm stumped.

+1  A: 

Maybe try specifying the oc4j instance the app is deployed on?

See http://download.oracle.com/docs/cd/B31017_01/web.1013/b28958/rmi.htm#i1084816 for all options that an ormi URL can take. Looks like you've not specified something it's expecting.

tunaranch
+1  A: 

I've seen JDNI problems like this before, and the issue, believe it or not, was the ClassLoader seeing its desired class in more than one JAR file. It loaded the class information OK, but when it came to actually instantiating the object, the VM croaked and died with a not-very-helpful JNDI error.

Make sure you're not exporting two of the same Jars. You can probably check this in OC4J's Enterprise Manager.

Good luck!

rtperson
+1  A: 

At the risk of stating a known fact (but on the off-chance it went overlooked): the etrace ear application deployed into your OC4J instance has to explicitly grant the user name in the java.naming.security.principal key access to its JNDI tree via the <namespace-access> element in its orion-application.xml descriptor. That's the bit that took us some time to figure out when we were migrating an app from WebSphere.

Barend