0 Replies Latest reply on Aug 16, 2002 4:33 AM by Mark Ewing

    CommunicationException

    Mark Ewing Newbie

      I have a servlet which calls an EJB deployed in JBOSS. My Tomcat server is independent of JBOSS. My servlet code is as follows:

      Properties p = new Properties();
      p.put(Context.INITIAL_CONTEXT_FACTORY,
      "org.jnp.interfaces.NamingContextFactory");
      p.put(Context.PROVIDER_URL, "127.0.0.1:1099");
      Context jndiContext = new javax.naming.InitialContext(p);
      Object obj = jndiContext.lookup("DealerServiceBean");
      DealerServiceHome home = (DealerServiceHome)
      javax.rmi.PortableRemoteObject.narrow(obj, DealerServiceHome.class);


      When I run the servlet I get the following error:

      javax.naming.CommunicationException. Root exception is java.lang.ClassNotFoundE
      xception: swds.DealerServiceHome
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
      der.java:1394)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
      der.java:1243)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:195)
      at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStrea
      m.java:183)
      at java.io.ObjectInputStream.inputProxyClassDescriptor(ObjectInputStream
      .java:982)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
      at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1186)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
      at java.rmi.MarshalledObject.get(MarshalledObject.java:138)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:353)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
      at javax.naming.InitialContext.lookup(InitialContext.java:350)
      at ProdLogServlet.doGet(ProdLogServlet.java:38)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:247)

      I can call the EJB successfully from a standalone Java client, but just can't call it in Tomcat. Any ideas why?

      Thanks..