1 Reply Latest reply on Mar 5, 2002 5:26 PM by Todd Marshall

    Problem making client access deployed EJB (newbie alert)

    Duarte Loreto Newbie

      Hello!

      I've coded and deployed a bean with simple DB access through the JBoss pool. I also have a war that contains my test JSP page. I'm using JBoss-2.4.4_Tomcat-3.2.3, JDK 1.3.1, Win2K. Deployment done through LogicFlow Forte plugin for JBoss.

      My problem is this... I deploy in jboss/deploy and when I access my JSP page I get compilation (jspc) errors as I do:
      custHome = (CustInfoRetrieverHome) portableRemoteObject.narrow(ref, CustInfoRetrieverHome.class);

      CustInfoRetriever bean = custHome.create();

      because I have no CustInfRetriever(Home) on my imports.

      But if I copy the ejb10xx.jar file from the jboss/deploy dir to the jboss/lib/ext dir and restart the server, the JSP page works like a charm!

      If then I remove the jar from jbos/lib/ext and restart JBoss, as long as I don't delete the tomcat/work dir, the page always works. This confirms the compilation problem stated above.

      Now, my question...

      How do I deploy a .ear containing the jar and war and make the JSP page on the war access the EJBs on the ear? Better... How do I make it compile without errors?

      As it seems, I will also have this problem when using simple Java clients to access my EJB... How will I be able to compile them without having my EJBs classes on the compilation classpath?

      I'm feeling a bit lost here. Help will be greatly appreciated.

      Have fun!

      dnloreto

        • 1. Re: Problem making client access deployed EJB (newbie alert)
          Todd Marshall Newbie

          In addition to deploying my ejb.jar files, I also put them under the WEB-INF/lib directory of my .war . I then import them in my JSPs.

          That way they are in the classpath for your war, and accessable to my JSPs.


          when you put your ejb files under the jboss/lib/ext directory, you were adding them to the general classpath (I believe). This is why things started working. While this may work, it may not be the best idea... It's a much better idea to just make sure your ejb classes are in your war.

          -Todd