严重:错误 filterStart ,当尝试将 Eclipse 中的 WAR 文件部署到 Tomcat 服务器时

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13115880/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 19:17:11  来源:igfitidea点击:

SEVERE: Error filterStart , when try to deploy WAR file in Eclipse to Tomcat server

javaeclipsetomcatweb-applicationswar

提问by lakshman

I created java dynamic web application in tomcat server 7. it works fine when I run it from eclipse.

我在 tomcat 服务器 7 中创建了 java 动态 web 应用程序。当我从 eclipse 运行它时它工作正常。

I deployed it by right click on the project and export by following export dialog to the webapp directory of tomcat installation and start the tomcat server so that I can access

我通过右键单击项目并通过以下导出对话框导出到tomcat安装的webapp目录并启动tomcat服务器以便我可以访问

http://localhost:8080 

but when I try to access

但是当我尝试访问时

http://localhost:8080/projectName. 

I got below error.

我得到以下错误。

The requested resource (/projectName/) is not available.

I look into catalina.logfile. and found these lines

我查看catalina.log文件。并找到这些行

SEVERE: Error filterStart
SEVERE: Context [/projectName] startup failed due to previous errors
SEVERE: The web application [/projectName] appears to have started a thread named 
[Abandoned connection cleanup thread] but has failed to stop it. This is very
likely to create a memory leak.

further my application is used struts2. I add struts2jars to the WEB-INF/libdirectory. why I can't access my application from war file?

进一步使用我的应用程序struts2。我将struts2jars添加到WEB-INF/lib目录中。为什么我无法从 war 文件访问我的应用程序?

采纳答案by lakshman

ok I figured it out my self. I searched the google for

好的,我自己弄明白了。我在谷歌上搜索

SEVERE: Error filterStart

and found, check the localhost_yyyy_mm_dd.logfile for more information about error.

并找到,检查localhost_yyyy_mm_dd.log文件以获取有关错误的更多信息。

In that file there was an error called java.lang.UnsupportedClassVersionError. The reason for that was my jdk and jre versions are different.

在那个文件中有一个错误叫做java.lang.UnsupportedClassVersionError. 原因是我的 jdk 和 jre 版本不同。

So I changed jdk and jre versions as same level from project properties. after that I built the project and exported the project to webApp again. I restart the tomcat server again. All errors are gone.

所以我从项目属性中将 jdk 和 jre 版本更改为相同级别。之后我构建了项目并将项目再次导出到webApp。我再次重新启动tomcat服务器。所有错误都消失了。

reference : Tomcat startup logs - SEVERE: Error filterStart how to get a stack trace?

参考:Tomcat 启动日志 - 严重:错误 filterStart 如何获取堆栈跟踪?

回答by GowthamanSS

I think eclipse is not recognizing your project as a web app, To confirm this

我认为 Eclipse 没有将您的项目识别为 Web 应用程序,以确认这一点

Open to do open Java EE perspective on your Eclipse. If you open the project folder of your app, You should see (Deployment Descriptor)

打开以在您的 Eclipse 上打开 Java EE 透视图。如果您打开应用程序的项目文件夹,您应该看到 (Deployment Descriptor)

enter image description here

在此处输入图片说明

If you don't see it, your app is not web app as far as Eclipse is concerned, I have see this in case if you imported/created a maven command line project

如果您没有看到它,就 Eclipse 而言,您的应用程序不是网络应用程序,如果您导入/创建了一个 maven 命令行项目,我会看到这一点

To fix this, select Project ==> Properties ==> Project Facets ==> make sure Dynamic Web Module check box is checked

要解决此问题,请选择 Project ==> Properties ==> Project Facets ==> 确保选中 Dynamic Web Module 复选框

enter image description here

在此处输入图片说明

If you do that the local tomcat server will add your app when do add remove projects.

如果您这样做,本地 tomcat 服务器将在添加删除项目时添加您的应用程序。