3 Replies Latest reply on Aug 13, 2002 11:54 AM by ashahata

    accessing a deployed ejb

    ashahata

      Hi all, I'm trying to access my deployed ejb on jboss from tomcat 4.. I'm running a jsp client to link to my ejb, and every time I call the jsp client, I get a server error:
      javax.servlet.ServletException: javax/net/SocketFactory

      I know that the jndi.jar should be kept at the WEB-INF\lib dir, however I couldn't find it under jboss\client! Is this normal? This is my first time to use jboss, am I missing something? I ran http://localhost:8082 and I can see my ejb deployed fine!
      Is there anything extra that I need to do for linking tomcat with jboss.. I downloaded the integrated version which have tomcat included.. the only thing I did was to change the tomcat port to 8020 because everytime I wanted to start tomcat after jboss it came with a used socket error! Is there a different way for linking jboss and tomcat!?

      Thanks

        • 1. Re: accessing a deployed ejb
          kail

          did you specyfied data in jndi.properties?
          is this a tomcat provided with jboss?

          • 2. Re: accessing a deployed ejb
            ashahata

            no I did not specify any jndi.properties, where would I do this from?
            Yes, this is a Tomcat install that was integrated with Jboss.

            Any idea where things r going wrong! Here's the code that I've used for the client:
            <%@ page import="javax.naming.InitialContext,
            javax.naming.Context,
            java.util.Properties,
            com.stardeveloper.ejb.session.First,
            com.stardeveloper.ejb.session.FirstHome"%>
            <%
            long t1 = System.currentTimeMillis();
            Properties props = new Properties();
            props.put(Context.INITIAL_CONTEXT_FACTORY,
            "org.jnp.interfaces.NamingContextFactory");
            props.put(Context.PROVIDER_URL, "localhost:1099");

            Context ctx = new InitialContext(props);
            FirstHome home = (FirstHome)ctx.lookup("ejb/First");
            First bean = home.create();
            String time = bean.getTime();
            bean.remove();
            ctx.close();
            long t2 = System.currentTimeMillis();
            %>

            • 3. Re: accessing a deployed ejb
              ashahata

              I found the solution... jnet.jar was not available in the classpath! I added it to catalina\lib of tomcat and all worked fine!

              Thanks