I recently started getting the following SEVERE: Servlet.service() for servlet jsp threw exception java.lang.ClassNotFoundException: org.apache.jsp.login_jsp
It happens sporatically. All was good prior to the holidays. But now I have started experiencing the exception.
The issue I believe pertains to server restarting and publishing paramters. [Start, Restart Synchonized] ... etc...
Based on whether I save a jsp or a java file Eclipse sometimes blows things away in this folder: .metadata\.plugins\org.eclipse.wst.server.core\tmp1\work\Catalina\localhost
Sometime when I hit refresh on the browser, I'll see that particular _jsp.class file appear. But other times I'll get the exception and notice a jsp_class missing, usually the WEB-INF/view files.
I don't think it has anything to do with not being able to comile the jsp, because there are no errors - my jsps do not contain any <% %> only JSTL/EL
EDIT: I followed BalusC's suggestion of deleting project (uncheck the check box on permantly deleting files btw) and importing. I did this for both the original and "copied" project but I only imported the original project for now. It seems be behaving, but it is too early to say since it was an intermitent error.
I did get the follwoing a couple of times after editing and saving a .java file, but can't duplicate it after a dozen tries now:
Jan 6, 2011 6:54:53 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading th开发者_开发百科is Context has started
Jan 6, 2011 6:54:53 PM org.apache.catalina.session.StandardManager doUnload
SEVERE: IOException while saving persisted sessions: java.io.FileNotFoundException:
C:\jrozycki\MyDocuments\Development\Eclipse\STK\.metadata\.plugins\org.eclipse.wst.server.core\tmp1
\work\Catalina\localhost\_\SESSIONS.ser (The system cannot find the path specified)
java.io.FileNotFoundException:
C:\jrozycki\MyDocuments\Development\Eclipse\STK\.metadata\.plugins\org.eclipse.wst.server.core\tmp1
\work\Catalina\localhost\_\SESSIONS.ser (The system cannot find the path specified)
Well, that's a glitch in the matrix. Eclipse is pretty complicated. It also occurs to me and all of my colleagues and anyone else sometimes.
Best what you can try is to rightclick the running server instance in Eclipse and choose Clean. If that doesn't help, then just restart the server thereafter. If that even doesn't help, then close/open the project, clean the server and restart it.
Update as per the comment:
I've tried it all short of starting with a fresh workspce. It started right after I copied pasted a project within the project viewer which I wanted to use a the start for a new project. Is that bad to do?
Including the .metadata
folder and so on? I think this is indeed the culprit. It could heavily conflict if it's generated by a different Eclipse version/environment. Delete the project and then choose File > Import > General > Existing Projects into Workspace and then point to project's root.
Just in case anyone still reads this, the problem just hit me for the first time. The only thing that seems to work for me in Eclipse 4.5 is to right-click on the server in the Servers tab, then "Add and Remove...", remove the affected project (to clean generated *_jsp.class files in workspace) and add it back again.
精彩评论