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)

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via Stack Overflow by Sathishkumar T
, 1 year ago
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
via Stack Overflow by Grace
, 2 years ago
Unable to compile class for JSP: An error occurred at line: 60 in the jsp file: /sendpw.jsp The type javax.mail.Authenticator cannot be resolved. It is indirectly referenced from required .class files the code: 57
via Stack Overflow by Ameer
, 2 years ago
Unable to compile class for JSP: An error occurred at line: 31 in the generated java file The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory AStacktrace: at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
via Stack Overflow by user1659213
, 2 years ago
Unable to compile class for JSP: An error occurred at line: 6 in the generated java file Only a type can be imported. com.sixpanview.getcoordinate resolves to a package An error occurred at line: 7 in the generated java file Only a type can be
via Stack Overflow by user3522121
, 2 years ago
Unable to compile class for JSP: An error occurred at line: 90 in the jsp file: /uploadwebcamimage.jsp FaceDetection cannot be resolved 87: fos.write(imageData); 88: String imagepath=filesstore+"\\"+imagename+".png"; 89
via Stack Overflow by Ashwini
, 2 years ago
future release</p> <p>PWC6199: Generated servlet error: To suppress warnings about obsolete options, use -Xlint:-options.</p> <p>PWC6197: An error occurred at line: 71 in the jsp file: /SubmitToSP.jsp PWC6199: Generated servlet error: reference to
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 javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
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.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 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.lang.Thread.run(Thread.java:745)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.