Eclipse Tomcat jsp类文件偶尔找不到

发布于 2024-10-10 22:24:05 字数 1403 浏览 2 评论 0原文

我最近开始收到以下信息 严重:servlet jsp 的 Servlet.service() 抛出异常 java.lang.ClassNotFoundException: org.apache.jsp.login_jsp

它偶尔会发生。 假期前一切都很好。但现在我开始经历异常。

我认为该问题与服务器重新启动和发布参数有关。 [同步​​启动、重新启动]...等等... 根据我保存的是 jsp 还是 java 文件,Eclipse 有时会破坏此文件夹中的内容: .metadata\.plugins\org.eclipse.wst.server.core\tmp1\work\Catalina\localhost

有时,当我在浏览器上点击刷新时,我会看到特定的 _jsp.class 文件出现。但其他时候我会得到异常并注意到 jsp_class 丢失,通常是 WEB-INF/view 文件。

我不认为这与无法编译 jsp 有任何关系,因为没有错误 - 我的 jsps 不包含任何 <% %>仅 JSTL/EL

编辑: 我按照 BalusC 的建议删除项目(顺便取消选中永久删除文件的复选框)并导入。我对原始项目和“复制”项目都执行了此操作,但目前我只导入了原始项目。它似乎表现正常,但现在说还为时过早,因为这是一个间歇性错误。

在编辑和保存 .java 文件后,我确实得到了以下几次信息,但现在经过十几次尝试后无法复制它:

Jan 6, 2011 6:54:53 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading this 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)

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 this 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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

べ映画 2024-10-17 22:24:05

嗯,这是矩阵中的一个故障。 Eclipse 相当复杂。我、我的所有同事和其他人有时也会想到这一点。

您可以尝试的最佳方法是在 Eclipse 中右键单击正在运行的服务器实例,然后选择清理。如果这没有帮助,那么之后只需重新启动服务器即可。如果这仍然没有帮助,请关闭/打开项目,清理服务器并重新启动它。


根据评论更新

我已经尝试过一切,但没有从一个新的工作空间开始。它在我在项目查看器中复制粘贴一个项目后立即启动,我想将其用于新项目的启动。这样做不好吗?

包括.metadata文件夹等等?我想这确实是罪魁祸首。如果它是由不同的 Eclipse 版本/环境生成的,则可能会严重冲突。删除项目,然后选择“文件”>“导入>一般>将现有项目放入工作区,然后指向项目的根目录。

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.

心如荒岛 2024-10-17 22:24:05

以防万一有人仍然读到这篇文章,这个问题第一次袭击了我。
在 Eclipse 4.5 中,似乎对我有用的唯一方法是右键单击“服务器”选项卡中的服务器,然后“添加和删除...”,删除受影响的项目(以清理工作区中生成的 *_jsp.class 文件) )并再次添加回来。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文