I'm unable to find a solution to this in the Orion docs, or at dejanews, but
maybe I'm looking in the wrong place.

I'm trying to use jndi from within a servlet.  I can bind something and then
immediately retrieve it, but when I bind the item once, remove that line
from the code, and run the servlet again trying to retrieve the item, I get
the following error:
Naming exception in service
javax.naming.NamingException: META-INF/application-client.xml resource not
found        at java.lang.Throwable.<init>(Throwable.java:96)
at java.lang.Exception.<init>(Exception.java:44)
at javax.naming.NamingException.<init>(NamingException.java:103)
at
com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext
(JAX)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:669)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:199)
at JNDIMovieList.service(JNDIMovieList.java:55)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:329)
at com.evermind.server.http.d3.sw(JAX)
at com.evermind.server.http.d3.su(JAX)
at com.evermind.server.http.ef.s1(JAX)
at com.evermind.server.http.ef.do(JAX)
at com.evermind.util.f.run(JAX)
META-INF/application-client.xml resource not found    


I do not know what is supposed to be in application-client.xml, what format
it is supposed to take, and where it is supposed to be relative to the
servlet directory.  


The relevant code:

    try
      {
        Hashtable env = new Hashtable();

        env.put("java.naming.factory.initial",
           "com.evermind.server.ApplicationClientInitialContextFactory");
        env.put(Context.PROVIDER_URL,
"ormi://localhost/servlet/JNDIMovieList");
        
        ctx = new InitialContext(env);

        //ctx.rebind("MovieXML", "foofoofoofoofoofoo");
        
        Object object = ctx.lookup("MovieXML");
        
      }

      catch (NamingException e)
      {
        System.out.println("Naming exception in service");
        e.printStackTrace();
        System.out.println(e.getMessage());
      }


It looks like there is supposed to be a jndi.properties file in the
classpath, so I tried putting that there - although I'm not sure if this
means the properties file itself should be in the classpath, or the
directory the file is in should be in the classpath.

I'm not sure the java.naming.factory.initial or the provider_url are correct
either, or what is required besides the java.naming.factory.initial.  Can
someone point me in the right direction here?

--Christy 

 

Reply via email to