2 Replies Latest reply on Jul 23, 2002 6:05 PM by Glen Cordrey

    NamingException accessing connector from servlet

    Glen Cordrey Newbie

      My servlet encounters a NamingException (trace below) when
      trying to access my connector's connection factory,
      as in
      InitialContext ctx = new InitialContext();
      javax.resource.cci.ConnectionFactory cxf =
      ( javax.resource.cci.ConnectionFactory )
      ctx.lookup( "java:comp/env/eis/myConnector" );
      I've verified that the ctx is not null, and
      eis/myConnector is registered in the JNDI tree.

      Might this be a classloading problem? Since the dereference presumably
      requires instantiation of the actual (custom) factory
      impl, where is the correct place to place that impl?
      I am deploying separate .war and .rar files (i.e., not as
      an .ear), and the .rar and .war both have a copy of
      the impl (and associated classes). I tried placing a jar
      with the impl and associated classes on JBoss's classpath
      (I modified run.bat to include it), which causes JBoss
      to tell me it can't find the javax.spi et al classes.

      javax.naming.NamingException: Could not dereference object. Root exception is
      java.lang.NullPointerException
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:519)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:558)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:429)
      at javax.naming.InitialContext.lookup(InitialContext.java:345)
      at com.convera.servlet.JCAServlet.process(Unknown Source)
      at com.convera.servlet.JCAServlet.access$200(Unknown Source)
      at com.convera.servlet.JCAServlet$Worker.run(Unknown Source)