1
votes

Well I have a rather strange problem with my eclipse, maven, tomcat configuration. Somehow randomly I get ClassNotFoundException for the main jsp (the jsp that is always called and contain the body for every page) of my project. The application runs normally on a test server and live server without ever experiencing this problem. On my development system after proceeding Clean Project, Clean on Tomcat and Clean Tomcat Working Directory it sometimes works again. But most of the time I have to do this procedure several time (10 to 20) till it starts working again. Than after some small changes it stops working again and I have to Clean and Clean again for 10 to 20 times until it starts working again. That's really annoying and I have really now idea how to solve this.

Exception:

    org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.frame_jsp
    at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:177)
    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:727)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at com.framepool.web.filters.RequestFilter.doFilter(RequestFilter.java:177)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at com.framepool.web.filters.RequestAttributesFilter.doFilter(RequestAttributesFilter.java:146)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
    at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1054)
    at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:384)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
    at com.framepool.web.VideoRequestProcessor.process(VideoRequestProcessor.java:64)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
    at com.framepool.web.ValidableActionServlet.doGet(ValidableActionServlet.java:59)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at com.framepool.web.filters.RequestFilter.doFilter(RequestFilter.java:177)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at com.framepool.web.filters.RequestAttributesFilter.doFilter(RequestAttributesFilter.java:146)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
    at com.framepool.web.filters.rest.LanguageFilter.doFilter(LanguageFilter.java:79)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at com.framepool.web.filters.DomainRedirectFilter.doFilter(DomainRedirectFilter.java:86)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at com.framepool.web.filters.XSSFilter.doFilter(XSSFilter.java:39)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

    Caused by: java.lang.ClassNotFoundException: org.apache.jsp.frame_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:145)
    at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:172)
    ... 66 more
2
what is the full exception?AdrianS
added it to the descriptionDaSch
This is a eclipse problem if the class is present and you can see it in front you. I had it many times, normally I would clean the project, or just delete the .eclipse folder(In linux), check Project settings to ensure classpaths are proper.We are Borg

2 Answers

2
votes

The solution is to remove the eclipse/tomcat scratch dir completely. Searching for .class files takes very long and doesn't give any result. The scratch dir can be found in /.metadata/.plugins/org.eclipse.wst.server.core there you can find a folder called tmp0. Removing this folder resolved my problem.

1
votes

Start back at the basics. The only two reasons for ClassNotFoundException are that the class does not exist, or the configuration of the runtime does not include the correct pointer to where the class exists.

Figure out where your development system expects class files to be for your project. Someone well-versed in eclipse could tell you exactly where this is configured, or the various places where it can be configured, I can't off the top of my head. Depending on how you're running Tomcat, it might not be an eclipse thing; running Tomcat as a separate program would decouple it from eclipse config, for instance.

Another possible way to do this is, when it is working, search the entire disk for the .class file for the class that shows up missing (or one of them, you aren't clear about whether it is always the same file). There may be multiple copies of it, note them all. The next time it isn't working, do the same search.

I am assuming you do not package the class files into jars in the development environment. If that's so, then the two searches should tell you where the class file is supposed to be but is not. Perhaps you can work backwards from there to figure out why it seems random, which process is supposed to put it there but does not.

I don't think it is actually random, and I don't think it's eclipse. I think out of the 10-20 times you clean and restart something different is going on. I hope you have verified, too, that you are not running out of disk space or ignoring logs that would indicate compilation problems.