Hi,
I got a problem when I freshly start tomcat with my web application then
the access to 1st jsp in that application fails with following exception
in the log file
SEVERE: Servlet.service() for servlet [jsp] in context with path
[/iq-util] threw exception [java.lang.ClassNotFoundException:
org.apache.jsp.index_jsp] with root cause
java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
at
org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:143)
at
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:172)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter.doFilter(StrutsExecuteFilter.java:85)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
at
com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.doFilter(StrutsPrepareFilter.java:82)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Let's say I have 3 jsp pages (A.jsp, B.jsp and C.jsp).
When (after tomcat starts) I try to access A.jsp the exception occurs,
but I can successfully access B.jsp and C.jsp without any problem after
that. When trying to access A.jsp again, it is not accessible and always
resulting in a new entry in the log file with the same exception
mentioned above.
But when I restart tomcat and for the 1st time I try to access B.jsp,
then it results in the same exception and the B.jsp is not accessible
anymore, while A.jsp and C.jsp are accessible without any problem.
I did some investigation and came to this:
When I start tomcat (before I access any of those jsp pages) I can see
following entry in the log file "SEVERE: The scratchDir you specified:
X:\workspace_jboss\iq-util\target\tomcat\work\Tomcat\localhost\iq-util
is unusable."
I think here is the problem, because when i go to
X:\workspace_jboss\iq-util\target\tomcat\work\Tomcat\localhost the
directory is empty (missing the iq-util direcrory).
When at this moment I try to access lets say index.jsp in the web app
root following directories are
created X:\workspace_jboss\iq-util\target\tomcat\work\Tomcat\localhost\iq-util\org\apache\jsp
and inside there are files index_jsp.class and index_jsp.java, but the
page is not being shown because the exception had been thrown.
Funny thing is, that when I start the tomcat and go to this directory
X:\workspace_jboss\iq-util\target\tomcat\work\Tomcat\localhost and
manually create subdirecory 'iq-util" then everything works fine and I
can access all my jsp pages without any problem.
Any idea why the directory is not being created after tomcat starts?
OS: Win 7 (happening on Ubuntu 12.04 as well)
Tomcat: 7.0.42
Thanks
Martin