8 Replies Latest reply on Mar 3, 2011 6:39 AM by ilde

    AS6 org.apache.catalina.jsp_classpath is null

    ilde

      Hello,

       

      I am having one issue. I have the following simple jsp (inside the ROOT.war:

       

      <html>

      <body>

      <%

      out.print("Hello World!");

      %>

      <%=application.getAttribute("org.apache.catalina.jsp_classpath").toString()%>

       

      </body>

      </html>

       

      and I get the following error:

       

       

      org.apache.jasper.JasperException: Ha sucedido una excepción al procesar la página JSP /ilde.jsp en línea 6

       

      3: <%

      4:  out.print("Hello World!");

      5: %>

      6: <%=application.getAttribute("org.apache.catalina.jsp_classpath").toString()%>

      7:

      8: </body>

      9: </html>

       

       

      Stacktrace:

          org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:498)

          org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)

          org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326)

          org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)

          javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

       

      causa raíz

       

      java.lang.NullPointerException

          org.apache.jsp.ilde_jsp._jspService(ilde_jsp.java:60)

          org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

          javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

          org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)

          org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326)

          org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)

          javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

       

       

      Please, help. Ilde.

        • 1. AS6 org.apache.catalina.jsp_classpath is null
          alesj
          <%=application.getAttribute("org.apache.catalina.jsp_classpath").toString()%>

          Looks like there is no such attribute set, hence ::toString() fails with NPE.

          Who should set this?

          • 2. AS6 org.apache.catalina.jsp_classpath is null
            ilde

            TomCat, I think.

             

            It worked on 4.2.2.GA  I am trying to migrate my app from 4.2.2. to 6 Final ....

             

            Thanks

            • 3. AS6 org.apache.catalina.jsp_classpath is null
              alesj
              It worked on 4.2.2.GA  I am trying to migrate my app from 4.2.2. to 6 Final ....

              I think this is just too much implementation detail to count on that, for this attribute to be set.

              Perhaps check how it's done now, but I suggest some better mechanism.

              • 4. AS6 org.apache.catalina.jsp_classpath is null
                ilde

                This is the way to get the context classpath in a jsp page. All app server has its own attribute, and as jboss use tomcat ...

                 

                Do you know a better way to get the application context classpath in a jsp page?

                • 5. AS6 org.apache.catalina.jsp_classpath is null
                  alesj
                  All app server has its own attribute, and as jboss use tomcat ...

                  It's not really direct Tomcat, but a fork - JBossWeb, with quite a few changes.

                  Like I said, I wouldn't count on that impl detail.

                   

                  Do you know a better way to get the application context classpath in a jsp page?

                  Not really, but that doesn't mean it doesn't exist. :-)

                  • 6. AS6 org.apache.catalina.jsp_classpath is null
                    ilde

                    Thank you for your feedback, but this app has been working and growing for many years and different app-servers in our company and its really hard to change its design now....

                     

                    So you think jbossweb is not provinding that information, Is there a place where study the attributes provided by jbossweb?  Do you know if I could replace jbossweb with a standar tomcat?

                     

                     

                    Does anybody have this same problem???

                     

                    THANK YOU!!!!!

                    • 7. AS6 org.apache.catalina.jsp_classpath is null
                      alesj
                      So you think jbossweb is not provinding that information, Is there a place where study the attributes provided by jbossweb?

                      The code? ;-)

                       

                      Do you know if I could replace jbossweb with a standar tomcat?

                      I doubt it.

                      (not criticising your "replace" knowledge, but the actual bits replacement :-))

                      • 8. AS6 org.apache.catalina.jsp_classpath is null
                        ilde

                         

                         

                        I will take a look to the code then...