I can't open my tomcat server home page it is showing the following error:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 1 in the generated java file
The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:331)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:457)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.23 logs.
Apache Tomcat/7.0.23
This is caused by a compatibility problem because you are using different Java versions. Likely you are using Java8 only as:
JRE for your Tomcat OR
compiling your code
Make a decision on which Java version would you like to use and ensure that your environment is consistently uses that specific version.
Related
I have installed Apache Tomcat/6.0.18 on my centos 6.3. While opening centos server from remote machine I get following error.
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 1 in the generated java file
The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:317)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.
My CATALINA_HOME and other variables are set properly.
This question already has answers here:
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
(4 answers)
Closed 8 years ago.
I'm getting the following error while I try to run my project in Netbeans. I have used JSP, Struts and JS in my project. So plz help me out.
Error Log:
type Exception report
message Unable to compile class for JSP:
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: [33] in the generated java file: [C:\Users\mahesh\AppData\Roaming\NetBeans\7.4\apache-tomcat-7.0.41.0_base\work\Catalina\localhost\mypro\org\apache\jsp\index_jsp.java]
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:468)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
Remove the servletcontainer-specific libraries such as jsp-api.jar in your /WEB-INF/lib folder. These libraries supports older versions and the method was introduced in newer version(Servlet 2.5). Those libraries don't belong in the webapp's classpath.
This question already has answers here:
Unable to compile class for JSP: The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
(11 answers)
Closed 6 years ago.
Installed tomcat, while starting the server I am getting this error:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 1 in the generated java file
The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:331)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:469)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.27 logs.
This is an issue with dependencies. Please check you have the correct java version please not Tomcat 7.027 doesn't play well with java 8. Also in your dependencies ensure you have the correct version.
I have installed java 8 and removed previously installed java 7 and its folders, and also re-installed Apache Tomcat 7 with security options, I did all the environment variables settings and my tomcat 7 started with no problem, but when I tried to open the localhost http://localhost:8080 then i am getting the following error.
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 1 in the generated java file
The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:331)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:469)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
The error have a some description: The server encountered an internal error that prevented it from fulfilling this request.
It seems i did nothing wrong, but are there an issues with Java 8 and Apache Tomcat 7.
I restarted the httpd and tomcat service today, and after doing so. I was greeted with the following message.
I saw this thread http://www.coderanch.com/t/592922/Tomcat/enable-el-api-jar-ver
And did as they told. I checked, and the el-api.jar is there. I checked another server, and tomcat is running great with it as well.
The server is a Centos 6.4 (final) and Tomcat 7.0.23.
I tried everything, even replacing the jar files, but nothing seems to work.
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: javax.el.ELException: Provider com.sun.el.ExpressionFactoryImpl not found
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:585)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:396)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause
javax.el.ELException: Provider com.sun.el.ExpressionFactoryImpl not found
javax.el.FactoryFinder.newInstance(FactoryFinder.java:101)
javax.el.FactoryFinder.find(FactoryFinder.java:197)
javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:189)
javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:160)
org.apache.jasper.runtime.JspApplicationContextImpl.getExpressionFactory(JspApplicationContextImpl.java:108)
org.apache.jsp.index_jsp._jspInit(index_jsp.java:31)
org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:49)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:180)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause
java.lang.ClassNotFoundException: com.sun.el.ExpressionFactoryImpl
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
javax.el.FactoryFinder.newInstance(FactoryFinder.java:87)
javax.el.FactoryFinder.find(FactoryFinder.java:197)
javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:189)
javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:160)
org.apache.jasper.runtime.JspApplicationContextImpl.getExpressionFactory(JspApplicationContextImpl.java:108)
org.apache.jsp.index_jsp._jspInit(index_jsp.java:31)
org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:49)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:180)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.23 logs.
Please, make sure you have both these jars at ${TOMCAT_HOME}/lib
el-api-2.2.jar // jar version could differ
el-impl-2.2.jar
I got the same error today on Tomcat 9.0.21
and as per this bug - https://bz.apache.org/bugzilla/show_bug.cgi?id=64097
It is a known bug with "el-api.jar" and has been fixed in following versions
Fixed in:
master for 10.0.0.0-M1 onwards
9.0.x for 9.0.31 onwards
8.5.x for 8.5.51 onwards
7.0.x for 7.0.100 onwards
Solution :- You can upgrade tomcat to these versions or just bring over the "el-api.jar" from the lib folder of a newer tomcat (which has the fix), place it in your lib folder and restart tomcat.
It would work.