Results 1 to 4 of 4
  1. #1
    satya kishore is offline Member
    Join Date
    Aug 2007
    Posts
    4
    Rep Power
    0

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

    i am getting the exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    when iam trying to use the plane jave class in the jsp class.The java class is in default folder.

    when i have placed in any package and import in the jsp class then it is excecuting properly.
    why this exception is thrown when it is in the default folder

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    8

    Default

    Each Web application server has its own rules about where the different components of the application must be located. Look at the documentation and the example applications on your server.

    I'm not aware of any "default" folder. Also, all .class files must be located in a directory structure that matches the package name, and the base directory must be listed in the classpath.

    The Web application server will set the classpath, but the .class file must be in the proper directory structure.

  3. #3
    dixit.ashish is offline Member
    Join Date
    Jan 2010
    Posts
    6
    Rep Power
    0

    Default

    hi,
    my code in jsp code not a struts
    thanks
    ashish

  4. #4
    dixit.ashish is offline Member
    Join Date
    Jan 2010
    Posts
    6
    Rep Power
    0

    Default

    hi,
    this is my jsp code got following exception,could u plg anybody help me?
    menu_desired.jsp
    ******************

    <%@page import="java.sql.*,java.util.*"%>
    <script type="text/javascript">

    <%@ include file="db_conn.jsp" %>

    <%

    try{

    String analysis_cat=request.getParameter("analysis_cat");
    String usr_name=request.getParameter("user");
    String user_report_ac1=request.getParameter("report_ac1") ;
    Statement stmt6 = conn.createStatement();
    Statement stmt8 = conn.createStatement();
    Statement stmt10 = conn.createStatement();

    ResultSet rs6=stmt6.executeQuery("select distinct analysis_category from reports_db where user_name='"+usr_name+"'");
    while(rs6.next()){
    boolean display = true;
    String Anaylsis_category=rs6.getString("analysis_category ");
    if(Anaylsis_category.compareToIgnoreCase(analysis_ cat)!=0){
    display=false;
    }

    if(display){%>

    menu_obj['<%=Anaylsis_category%>']= {};
    <%
    ResultSet rs8=stmt8.executeQuery("select distinct report_category from reports_db where user_name='"+usr_name+"' and analysis_category='"+Anaylsis_category+"';");
    while(rs8.next()){
    String Report_category=rs8.getString("report_category");
    if(user_report_ac1.compareToIgnoreCase("all")!=0){
    if(Report_category.compareToIgnoreCase(user_report _ac1)!=0){
    continue;
    }
    }
    %>
    menu_obj['<%=Anaylsis_category%>']['<%=Report_category%>'] = {};
    <%

    ResultSet rs10=stmt10.executeQuery("select filename,description from reports_db where user_name='"+usr_name+"' and analysis_category='"+Anaylsis_category+"' and report_category='"+Report_category+"' order by order_id desc;");

    while(rs10.next()) {
    String filename = rs10.getString("filename");
    String description = rs10.getString("description");
    if(usr_name.compareToIgnoreCase("public")==0){%>

    menu_obj['<%=Anaylsis_category%>']['<%=Report_category%>']['<%=filename%>@<%=description%>'] = "analysis.jsp?user=<%=usr_name%>&fileparam=<%=file name%>&report_cat=<%=Report_category%>";

    <%} else{%>
    menu_obj['<%=Anaylsis_category%>']['<%=Report_category%>']['<%=filename%>'] = "analysis.jsp?fileparam=<%=filename%>&report_cat=< %=Report_category%>
    <%}
    }%>
    <%}%>
    <%}%>

    <% } %>
    }catch(Exception e){
    out.println("The Error is: " + e);
    }
    conn.close();
    }%>

    </script>

    <div id="<%=analysis_cat%>_menu_path" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size:9pt; color:#fff">
    <a id="<%=analysis_cat%>_top" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size:9pt; color:#fff" href="javascript:;" onclick="addElement('<%=analysis_cat%>_display_men u','<%=analysis_cat%>_level','<%=analysis_cat%>_me nu_path');reset_level('<%=analysis_cat%>_level','< %=analysis_cat%>');addElementStatic('<%=analysis_c at%>_menu_path','<%=analysis_cat%>');removeElement ('<%=analysis_cat%>_top','<%=analysis_cat%>_menu_p ath');"><%=analysis_cat%></a>
    </div>
    <br>
    <input id="<%=analysis_cat%>_level" value="<%=analysis_cat%>" type="hidden">
    <div id="<%=analysis_cat%>_display_menu"></div>

    exce[ption:

    [JPivot] 13 Apr 2010 17:59:59,431 ERROR [Session ] org.apache.catalina.core.ApplicationDispatcher#inv oke: Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: Unable to compile class for JSP:



    Stacktrace:
    at org.apache.jasper.compiler.DefaultErrorHandler.jav acError(DefaultErrorHandler.java:85)
    at org.apache.jasper.compiler.ErrorDispatcher.javacEr ror(ErrorDispatcher.java:330)
    at org.apache.jasper.compiler.JDTCompiler.generateCla ss(JDTCompiler.java:435)
    at org.apache.jasper.compiler.Compiler.compile(Compil er.java:298)
    at org.apache.jasper.compiler.Compiler.compile(Compil er.java:277)
    at org.apache.jasper.compiler.Compiler.compile(Compil er.java:265)
    at org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:564)
    at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:299)
    at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:315)
    at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:265)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:691)
    at org.apache.catalina.core.ApplicationDispatcher.doI nclude(ApplicationDispatcher.java:594)
    at org.apache.catalina.core.ApplicationDispatcher.inc lude(ApplicationDispatcher.java:505)
    at org.apache.jasper.runtime.JspRuntimeLibrary.includ e(JspRuntimeLibrary.java:965)
    at org.apache.jsp.vertical_005fmenu_jsp._jspService(v ertical_005fmenu_jsp.java:131)
    at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:98)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:328)
    at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:315)
    at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:265)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:691)
    at org.apache.catalina.core.ApplicationDispatcher.doI nclude(ApplicationDispatcher.java:594)
    at org.apache.catalina.core.ApplicationDispatcher.inc lude(ApplicationDispatcher.java:505)
    at org.apache.jasper.runtime.JspRuntimeLibrary.includ e(JspRuntimeLibrary.java:965)
    at org.apache.jsp.project_005flist_jsp._jspService(pr oject_005flist_jsp.java:136)
    at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:98)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:328)
    at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:315)
    at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:265)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:210)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:174)
    at org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:525)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:151)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:870)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:665)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:685)
    at java.lang.Thread.run(Unknown Source)
    [JPivot] 13 Apr 2010 17:59:59,435 ERROR [Session ] org.apache.catalina.core.StandardWrapperValve#invo ke: Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: Unable to compile class for JSP:



    Stacktrace:
    at org.apache.jasper.compiler.DefaultErrorHandler.jav acError(DefaultErrorHandler.java:85)
    at org.apache.jasper.compiler.ErrorDispatcher.javacEr ror(ErrorDispatcher.java:330)
    at org.apache.jasper.compiler.JDTCompiler.generateCla ss(JDTCompiler.java:435)
    at org.apache.jasper.compiler.Compiler.compile(Compil er.java:298)
    at org.apache.jasper.compiler.Compiler.compile(Compil er.java:277)
    at org.apache.jasper.compiler.Compiler.compile(Compil er.java:265)
    at org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:564)
    at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:299)
    at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:315)
    at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:265)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:691)
    at org.apache.catalina.core.ApplicationDispatcher.doI nclude(ApplicationDispatcher.java:594)
    at org.apache.catalina.core.ApplicationDispatcher.inc lude(ApplicationDispatcher.java:505)
    at org.apache.jasper.runtime.JspRuntimeLibrary.includ e(JspRuntimeLibrary.java:965)
    at org.apache.jsp.vertical_005fmenu_jsp._jspService(v ertical_005fmenu_jsp.java:131)
    at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:98)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:328)
    at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:315)
    at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:265)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:691)
    at org.apache.catalina.core.ApplicationDispatcher.doI nclude(ApplicationDispatcher.java:594)
    at org.apache.catalina.core.ApplicationDispatcher.inc lude(ApplicationDispatcher.java:505)
    at org.apache.jasper.runtime.JspRuntimeLibrary.includ e(JspRuntimeLibrary.java:965)
    at org.apache.jsp.project_005flist_jsp._jspService(pr oject_005flist_jsp.java:136)
    at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:98)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:328)
    at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:315)
    at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:265)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:210)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:174)
    at org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:525)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:151)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:870)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:665)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:685)
    at java.lang.Thread.run(Unknown Source)
    thanks & regards
    ashish

Similar Threads

  1. Replies: 5
    Last Post: 11-20-2011, 10:22 PM
  2. Cannot compile or run jasper report!!!!!!!
    By neo3matrix in forum XML
    Replies: 0
    Last Post: 09-23-2008, 03:10 PM
  3. JasperException: Unable to compile
    By Aerinai in forum Java Servlet
    Replies: 0
    Last Post: 06-17-2008, 07:16 PM
  4. org.apache.jasper.JasperException: null
    By ranjan_ashish26 in forum Java Servlet
    Replies: 1
    Last Post: 03-21-2008, 06:06 AM
  5. Unable to compile
    By gapper in forum New To Java
    Replies: 2
    Last Post: 01-14-2008, 05:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •