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)

  1. 0

    hibernate error log in tomcat 8 org.apache.jasper.JasperException: Unable to compile class for JSP

    Stack Overflow | 4 months ago | Sathishkumar T
    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)
  2. 0

    Spring can't compile jsp with javax.servlet

    Stack Overflow | 2 years ago | Quillion
    org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: [42] in the generated java file: [system\tomcat\Tomcat_(1)_web\work\Catalina\localhost\ROOT\org\apache\jsp\WEB_002dINF\view\default_jsp.java] The method getDispatcherType() is undefined for the type HttpServletRequest Stacktrace:
  3. 0

    Tomcat 8 giving JSP compilation error

    Stack Overflow | 2 years ago | Mr37037
    org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: [42] in the generated java file: [/home/jamil/LunaWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/Catalina/localhost/svc/org/apache/jsp/index_jsp.java] The method getDispatcherType() is undefined for the type HttpServletRequest Stacktrace:
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    java.lang.ClassNotFoundException after changed envinroment

    Stack Overflow | 7 months ago | Giuseppe Canto
    org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
  6. 0

    jsf error while launching JSP application

    Stack Overflow | 2 weeks ago | Ajay Kulkarni
    org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsf/html cannot be resolved in either web.xml or the jar files deployed with this application

  1. abrazeneb 4 times, last 5 months ago
  2. treefolk 1 times, last 1 week ago
  3. Andreas Häber 1 times, last 1 month ago
  4. Justin 2 times, last 4 months ago
  5. andyglick 12 times, last 3 months ago
1 more registered users
71 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. 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()
  2. GWT dev
    JspServlet.service
    1. org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:199)
    2. org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:450)
    3. org.apache.jasper.compiler.Compiler.compile(Compiler.java:361)
    4. org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
    5. org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
    6. org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
    7. org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
    8. org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
    9. org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
    9 frames
  3. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    1 frame
  4. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    2 frames
  5. Tomcat WS
    WsFilter.doFilter
    1. org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    1 frame
  6. Glassfish Core
    CoyoteAdapter.service
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
    4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
    5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
    6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
    7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    8. org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
    9. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    10. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)
    10 frames
  7. Grizzly HTTP
    NioEndpoint$SocketProcessor.run
    1. org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085)
    2. org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)
    3. org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
    4. org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556)
    5. org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513)
    5 frames
  8. Java RT
    ThreadPoolExecutor$Worker.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    2 frames
  9. Tomcat Util
    TaskThread$WrappingRunnable.run
    1. org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    1 frame
  10. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:745)
    1 frame