org.apache.jasper.JasperException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Spring can't compile jsp with javax.servlet
    via Stack Overflow by Quillion
    ,
  • Tomcat 8 giving JSP compilation error
    via Stack Overflow by Mr37037
    ,
  • jsf error while launching JSP application
    via Stack Overflow by Ajay Kulkarni
    ,
    • org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 10 in the jsp file: /Display.jsp Session cannot be resolved to a type 7: 8: <%@ page import="java.util.*,com.model.*,org.hibernate.*,org.hibernate.cfg.*" %> 9: 10: <%! int empid;String gender; String dept;String address; String name;Long phnum; Session session1 = null; %> 11: <body> 12: <table width="220" border="1"> 13: <form action="./delEmp.jsp"> An error occurred at line: 16 in the jsp file: /Display.jsp Configuration cannot be resolved to a type 13: <form action="./delEmp.jsp"> 14: <tr><th>EMPID</th><th>NAME</th><th>GENDER</th><th>DEPT</th><th>ADDRESS</th><th>PHONENUMBER</th></tr> 15: <% 16: Configuration cf=new Configuration(); 17: cf.configure(); 18: SessionFactory sf = cf.buildSessionFactory(); 19: session1 =sf.openSession(); An error occurred at line: 16 in the jsp file: /Display.jsp Configuration cannot be resolved to a type 13: <form action="./delEmp.jsp"> 14: <tr><th>EMPID</th><th>NAME</th><th>GENDER</th><th>DEPT</th><th>ADDRESS</th><th>PHONENUMBER</th></tr> 15: <% 16: Configuration cf=new Configuration(); 17: cf.configure(); 18: SessionFactory sf = cf.buildSessionFactory(); 19: session1 =sf.openSession(); An error occurred at line: 18 in the jsp file: /Display.jsp SessionFactory cannot be resolved to a type 15: <% 16: Configuration cf=new Configuration(); 17: cf.configure(); 18: SessionFactory sf = cf.buildSessionFactory(); 19: session1 =sf.openSession(); 20: //Using from Clause 21: String SQL_QUERY ="from Employee"; An error occurred at line: 19 in the jsp file: /Display.jsp session1 cannot be resolved to a variable 16: Configuration cf=new Configuration(); 17: cf.configure(); 18: SessionFactory sf = cf.buildSessionFactory(); 19: session1 =sf.openSession(); 20: //Using from Clause 21: String SQL_QUERY ="from Employee"; 22: Query query = session1.createQuery(SQL_QUERY); An error occurred at line: 22 in the jsp file: /Display.jsp Query cannot be resolved to a type 19: session1 =sf.openSession(); 20: //Using from Clause 21: String SQL_QUERY ="from Employee"; 22: Query query = session1.createQuery(SQL_QUERY); 23: Iterator it=query.iterate(); 24: while(it.hasNext()) 25: { An error occurred at line: 22 in the jsp file: /Display.jsp session1 cannot be resolved 19: session1 =sf.openSession(); 20: //Using from Clause 21: String SQL_QUERY ="from Employee"; 22: Query query = session1.createQuery(SQL_QUERY); 23: Iterator it=query.iterate(); 24: while(it.hasNext()) 25: { An error occurred at line: 47 in the jsp file: /Display.jsp session1 cannot be resolved 44: </tr> 45: <% 46: } 47: session1.close(); 48: %> 49: <tr> 50: <th colspan="5" align="right"><input type="submit" value="delete"></th> Stacktrace: at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:199) at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:450) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:361) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340) at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    70 more bugmates