4 Replies Latest reply on Sep 12, 2012 2:39 AM by Deep Shah

    Null Pointer in JSP compile

    Alexandre Nodari Newbie

      Hi,

      I have a web application deployed in JBoss 4.2.1 GA and when I try to access the JSP pages I get the following error:

      Exception

      org.apache.jasper.JasperException: Unable to compile class for JSP
      org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:574)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

      Root cause

      java.lang.NullPointerException
      java.io.Writer.write(Writer.java:126)
      java.io.PrintWriter.newLine(PrintWriter.java:408)
      java.io.PrintWriter.println(PrintWriter.java:559)
      java.io.PrintWriter.println(PrintWriter.java:670)
      org.apache.jasper.compiler.ServletWriter.printil(ServletWriter.java:130)
      org.apache.jasper.compiler.Generator.genPreamblePackage(Generator.java:454)
      org.apache.jasper.compiler.Generator.generatePreamble(Generator.java:557)
      org.apache.jasper.compiler.Generator.generate(Generator.java:3371)
      org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:210)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
      org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

      Someone can help me with this ?

      Thanks in advance,

        • 1. Re: Null Pointer in JSP compile
          Joan Horta  Tosas Novice

          We can't if you don't provide the JSP code. Remember to use to [ code] and [ /code] between your code.

          • 2. Re: Null Pointer in JSP compile
            Don Gregory Newbie

            I'm having the same issue. I migrated a web app over from apache tomcat 5.0.28 to jboss 4. I'm using Struts as the framework. My app displays the login screen fine, which is a jsp. But after logging in, the server log spews the same exception as posted in this thread. My WAR file hasn't changed in structure, and I've even tried simplying the jsp page to something as simple as pure html that has some text between tags and I still get the exception when the page is requested.

            • 3. Re: Null Pointer in JSP compile
              Deep Shah Newbie

              i m also facing the same issue. i m using tomcat 5.0. The problem is when i m requesting to one servlet page it works fine but after that when i request the jsp page at that time i m getting the following errors:

               

               

              Exception

               

              org.apache.jasper.JasperException: Unable to compile class for JSP

              org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:604)

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

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

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

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

               

              root cause

               

              java.lang.NullPointerException

              java.io.Writer.write(Writer.java:140)

              java.io.PrintWriter.newLine(PrintWriter.java:436)

              java.io.PrintWriter.println(PrintWriter.java:585)

              java.io.PrintWriter.println(PrintWriter.java:696)

              org.apache.jasper.compiler.ServletWriter.printil(ServletWriter.java:130)

              org.apache.jasper.compiler.Generator.genPreamblePackage(Generator.java:479)

              org.apache.jasper.compiler.Generator.generatePreamble(Generator.java:582)

              org.apache.jasper.compiler.Generator.generate(Generator.java:3437)

              org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:231)

              org.apache.jasper.compiler.Compiler.compile(Compiler.java:347)

              org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)

              org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)

              org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)

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

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

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

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

               

              Someone can help me with this ?

               

              Thanks in advance.

              • 4. Re: Null Pointer in JSP compile
                Deep Shah Newbie

                hi all,

                 

                i was facing the same problem but i have solved it with some updation of code. In my code there is a line for Property prop = System.getProperties(). and at the end of the code i have used prop.clear(). That's why it's cleared all property of the system that's why tomcat can't load the another jsp or servlet page. And whole server is crashed.

                 

                Thanks