Apache tomcat installation causes error - java

I installed jdk1.8 and now trying to install apache tomcat. When I run
C:\Program Files\apache\apache-tomcat-8.0.30\bin>startup
it start running like
C:\Program Files\apache\apache-tomcat-8.0.30\bin>startup
Using CATALINA_BASE: "C:\Program Files\apache\apache-tomcat-8.0.30"
Using CATALINA_HOME: "C:\Program Files\apache\apache-tomcat-8.0.30"
Using CATALINA_TMPDIR: "C:\Program Files\apache\apache-tomcat-8.0.30\temp"
Using JRE_HOME: "C:\Program Files\Java\jre1.8.0_73"
Using CLASSPATH: "C:\Program Files\apache\apache-tomcat-8.0.30\bin\bootstrap.jar;C:\Program Files\apache\apache-tomcat-8.0.30\bin\tomcat-juli.jar"
after that I tried to check apache tomcat in browser like localhost:8080
and showing following error
HTTP Status 500 - java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
type Exception report
message java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:176)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
java.net.URLClassLoader.findClass(Unknown Source)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:131)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:62)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:171)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note The full stack trace of the root cause is available in the Apache Tomcat/8.0.30 logs.
Apache Tomcat/8.0.30
Please tell me how resolve this issue.

Verify that your JAVA_HOME is pointing to the correct JDK.

Related

IntelliJ Web Module Dependencies on other Module

I created a new web module in IntelliJ. The java classes in my src folder make calls to classes in another module, which is causing some java.lang.NoClassDefFoundError errors at runtime (everything is compiling correctly though). Is there a way to add a dependency such that the jsp files in my web app are properly able to access these java classes in this separate module?
Here's the error:
Type Exception Report
Message java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
"Exception
org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:176)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:380)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause
java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
java.net.URLClassLoader.findClass(URLClassLoader.java:381)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:129)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:60)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:171)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:380)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Note The full stack trace of the root cause is available in the server logs."

java.lang.NoSuchMethodError: javax.el.ExpressionFactory.getStreamELResolver()Ljavax/el/ELResolver;

I get the error java.lang.NoSuchMethodError: javax.el.ExpressionFactory.getStreamELResolver()Ljavax/el/ELResolver; while using jstl in tomcat 8.0.33. I've checked the WEB-INF/lib of my application and it doesn't contain anything that is conflicting.
Also I checked the source code of javax.el.ExpressionFactory class from el-api.jar file present in tomcat 8's lib folder. The method signature is public ELResolver getStreamELResolver().
This issue occurred after I migrated an application from tomcat 6.0.35 to tomcat 8.0.33. The application was written using jstl-1.2
The complete stacktrace is
16-May-2016 19:14:54.119 SEVERE [ajp-nio-11009-exec-4] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [spring] in context with path [/app] threw exception [Request processing failed; nested exception is org.apache.tiles.impl.CannotRenderException: org.apache.tiles.util.TilesIOException: JSPException including path '/WEB-INF/JSP/APP/display.jsp'.] with root cause
java.lang.NoSuchMethodError: javax.el.ExpressionFactory.getStreamELResolver()Ljavax/el/ELResolver;
at org.apache.jasper.el.ELContextImpl.<clinit>(ELContextImpl.java:87)
at org.apache.jasper.compiler.Validator$ValidateVisitor.prepareExpression(Validator.java:1617)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:750)
at org.apache.jasper.compiler.Node$ELExpression.accept(Node.java:950)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:464)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1853)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:217)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
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:585)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:363)
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:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:720)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:584)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:523)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:935)
at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:679)
at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:673)
at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:103)
at org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:96)
at org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
at org.apache.tiles.renderer.impl.ChainedDelegateAttributeRenderer.write(ChainedDelegateAttributeRenderer.java:76)
at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:336)
at org.apache.tiles.template.InsertAttributeModel.renderAttribute(InsertAttributeModel.java:210)
at org.apache.tiles.template.InsertAttributeModel.end(InsertAttributeModel.java:126)
at org.apache.tiles.jsp.taglib.InsertAttributeTag.doTag(InsertAttributeTag.java:311)
... (truncated)
How to resolve this issue?
To tackle such problems of different versions of same class present on the classpath - the best way is to enable verbose class loading and see whether the class is actually being loaded from the intended jar file.
From command line we can run java -verbose:class MyClassWithMain. This will output all the classes loaded in the JVM and the name of the jar or any class on the classpath from which it was loaded. Once you find the source of the problem, you can remove it.
To enable verbose:class in tomcat, see this answer.

Crash In User Login Flow

I booted up the wso2 server and attempted to login with a new user, and I'm getting this crash:
[2015-07-24 14:33:50,128] ERROR {org.apache.tiles.jsp.context.JspTilesRequestContext} - JSPException while including path '/user-registration/add_user.jsp'.
javax.servlet.jsp.JspException: ServletException while including page.
at org.apache.tiles.jsp.context.JspUtil.doInclude(JspUtil.java:102)
at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:88)
at org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:82)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:465)
at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:140)
at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:117)
at org.apache.tiles.jsp.taglib.RenderTagSupport.execute(RenderTagSupport.java:171)
at org.apache.tiles.jsp.taglib.RoleSecurityTagSupport.doEndTag(RoleSecurityTagSupport.java:75)
at org.apache.tiles.jsp.taglib.ContainerTagSupport.doEndTag(ContainerTagSupport.java:80)
at org.apache.jsp.admin.layout.template_jsp._jspx_meth_tiles_insertAttribute_7(org.apache.jsp.admin.layout.template_jsp:603)
at org.apache.jsp.admin.layout.template_jsp._jspService(org.apache.jsp.admin.layout.template_jsp:335)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:403)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.wso2.carbon.ui.JspServlet.service(JspServlet.java:155)
at org.wso2.carbon.ui.TilesJspServlet.service(TilesJspServlet.java:80)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.equinox.http.helper.ContextPathServletAdaptor.service(ContextPathServletAdaptor.java:37)
at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68)
at ...
It seemed like there's a similar error in the jira pipeline:
https://www.wso2.org/jira/browse/CARBON-4616
EDIT:
I'm running WSO2 1.1.0 from the download link here:
(https://docs.wso2.com/display/EMM110/Downloading+the+Product)
I'm running it on Yosemite (10.10.3)
My JDK version is 1.8.0_45-b14
This issue usually occurs if the following parameter is missing in [$HOME]/bin/wso2server.sh file.
Add this value at where the other -D parameters are defined in wso2server.sh file.
-D org.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false \

Tomcat 8 using JDK 1.8, app deploy causes NPE

When I deploy my application in Tomcat 8 with JDK 1.8, I get this NPE. The same application works fine in Tomcat 7 with JDK 1.8. We are not shipping any el-api jar with our application. Have anyone else run into this issue?
java.lang.NullPointerException
javax.el.CompositeELResolver.add(CompositeELResolver.java:49)
org.apache.jasper.el.ELContextImpl.<clinit>(ELContextImpl.java:87)
org.apache.jasper.compiler.Validator$ValidateVisitor.getJspAttribute(Validator.java:1414)
org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1231)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:879)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1536)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434)
org.apache.jasper.compiler.Node$Root.accept(Node.java:464)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1846)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:217)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
com.actuate.iv.presentation.aggregation.IVBaseFragment.service(IVBaseFragment.java:261)
com.actuate.iv.servlet.IVHttpDispatcher.handleRequest(IVHttpDispatcher.java:144)
com.actuate.iv.servlet.IVServlet.doGet(IVServlet.java:261)
javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
We had this issue with these configurations:
Using CATALINA_BASE: /opt/tomcat
Using CATALINA_HOME: /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME: /usr/java/jdk1.8.0_45
Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
Server version: Apache Tomcat
Server built: May 19 2015 14:58:38 UTC
Server number: 8.0.23.0
OS Name: Linux
OS Version: 2.6.32-431.11.2.el6.x86_64
Architecture: amd64
JVM Version: 1.8.0_45-b14
JVM Vendor: Oracle Corporation
We solved it by upgrading tomcat from 8.0.23.0 to 8.0.26.0 version.

struts application not working in linux tomcat server

I have a simple struts program working perfectly in windows environment with tomcat 7 as server. But I deployed the application in linux environment with tomcat 7 as server, the application is not running. It shows 404 error. Please help me to resolve the problem.
I am getting error as like this:
type Exception report
Message:
javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot
find ActionMappings or ActionFormBeans collection
Description:
The server encountered an internal error that prevented it from
fulfilling this request.
Exception:
org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
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.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:912)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:841)
org.apache.jsp.login_jsp._jspService(login_jsp.java:112)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
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.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:747)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:443)
org.apache.jsp.login_jsp._jspx_meth_html_005fform_005f0(login_jsp.java:147)
org.apache.jsp.login_jsp._jspService(login_jsp.java:102)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
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.32 logs.
Did your included the jar correctly while creating the war file. Please check following jar are available in the WEB-INF/Lib folder of your project
antlr-2.7.6.jar
commons-beanutils-1.7.0.jar
commons-chain-1.2.jar
commons-collections-3.1.jar
commons-digester-2.0.jar
commons-fileupload-1.2.2.jar
commons-io-2.0.1.jar
commons-lang-2.5.jar
commons-logging-1.1.1.jar
commons-logging-api-1.1.jar
commons-validator-1.3.1.jar
dom4j-1.6.1.jar
hibernate-jpa-2.0-api-1.0.1.Final.jar
hibernate3.jar
javassist-3.12.0.GA.jar
jstl-api-1.2.jar
jstl-impl-1.2.jar
jta-1.1.jar
mysql-connector-java-5.1.17-bin.jar
ognl-3.0.1.jar
slf4j-api-1.6.1.jar
slf4j-log4j12-1.6.2.jar
spring-beans-2.5.6.jar
spring-context-2.5.6.jar
spring-core-2.5.6.jar
spring-test-2.5.6.jar
spring-web-2.5.6.jar
struts2-core-2.2.3.1.jar
xwork-core-2.2.3.1.jar

Categories