5 Replies Latest reply on Feb 7, 2002 11:17 AM by chrigri

    JBoss2.4.3, tomcat, JSP and classpath

    klaust

      sorry, perhaps this is offtopic due to the other thread.
      i've just ported our apps from orion to jboss/tomcat and was wondering why i get an exception, when the jsp-pages try to access classes in the ejb-jar.jar
      (javax.servlet.jsp.JspException: Unable to compile class...).
      if i put the ejb-jar.jar to WEB-INF/lib it works.

      is this a bug or did i miss something from the spec?

      tia
      klaus

      ps: there's no problem accessing ejb's from servlets.

        • 1. Re: JBoss2.4.3, tomcat, JSP and classpath
          alexnet

          It looks like jsp compiler can't find remote and home interfaces in classpath. You have to put yours remote and home interfaces to WEB-INF\classes, or pack it as jar file and drop to WEB-INF\lib.

          • 2. Re: JBoss2.4.3, tomcat, JSP and classpath
            klaust

            thanks for responding.

            that's was i have already done.

            but i think it is a bug, that the servlet-engine has access to the ejbs and the jsp has not!

            thanks
            klaus

            • 3. Re: JBoss2.4.3, tomcat, JSP and classpath
              chrigri

              I agree, it must be a bug when accessing EJBs from a servlet works, but not from a JSP (jsp compile error).

              Has there been developed a fix for this yet?

              --
              Christer

              • 4. Re: JBoss2.4.3, tomcat, JSP and classpath
                maddisondavid

                The reason JSP's have compilation issues when Servlet's work, is to do with Jasper (the JSP Compiler). Basically it doesn't use any classes from it's classloader, but instead requires a classpath to be passed into it. However once the servlet, (or compiled JSP), is running, it has access to the JBoss classloaders, and hence it works.

                I've just built a fix that I'll put in today that creates a classpath of all currently loaded classes, and passes this into the Jasper compiler. The result is that JSP's compile as expected.

                Just realised however that your question was regarding 2.4.3 and my fix is for RH3.0, sorry :-)

                • 5. Re: JBoss2.4.3, tomcat, JSP and classpath
                  chrigri

                  Hi, David

                  could you please give me a link to where in the CVS this bug fix is.

                  I would like to have a look at it, but I can't find it...

                  --
                  Christer