1 Reply Latest reply on Jul 22, 2013 10:58 AM by Cheng Fang

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

    Nilesh Patidar Newbie



      I am working on weblogic to jboss migration,


      while accessing the jsp page on Jboss i am getting "org.apache.jasper.JasperException: Unable to compile class for JSP:" earliear the jsp is working fine on weblogic.



      The log statements are:


      2013-06-25 20:04:48,922 ERROR [com.experian.ncac.servlet.SecurityBlackListFilter] (http- SESSIONID[9BD5DDB9F97E5C6748C2766D2D2A503D] unhandled exception. The Cart object does no contain a CDI product. The caller needs to verify hasPaidCDI() before calling this method.

      2013-06-25 20:04:49,376 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/consumer].[jsp]] (http- Servlet.service() for servlet jsp threw exception

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


      An error occurred at line: 107 in the jsp file: /cac/06_YourStatementDetails.jsp

      Date cannot be resolved to a type

      104:                             1051,

      105:                             session.getId(),

      106:                                workflow.getProductCode(),

      107:                             new Date(),

      108:                             ReasonCode.NA,

      109:                             consumer.getAffiliate().getPreamble(),

      110:                             indexCode,




          at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)

          at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)

          at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)

          at org.apache.jasper.compiler.Compiler.compile(Compiler.java:335)

          at org.apache.jasper.compiler.Compiler.compile(Compiler.java:313)

          at org.apache.jasper.compiler.Compiler.compile(Compiler.java:300)

          at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)

          at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312)

          at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)

          at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)

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




      Please help me. what is going wrong.?



      NIlesh Patidar

        • 1. Re: org.apache.jasper.JasperException: Unable to compile class for JSP:
          Cheng Fang Master

          Not sure if you have resolved it, but my guess is your version of wls has some implicit import include java.util.*, which made jsp compilation possible.  More recent versions of servlet and jsp specs have clear rules of jsp implicit imports, which made your app kinda invalid in any modern Java EE application servers.  Chances are your jsp would also fail compile in later version of wls.  So you may want to fix those jsps by adding explicit imports.