Java 严重:配置 org.apache.catalina.deploy.ApplicationListener 类的应用程序侦听器时出错
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18720224/
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
SEVERE: Error configuring application listener of class org.apache.catalina.deploy.ApplicationListener
提问by Hemanth Kumar
Here this is my error when I am trying to run the web.xml
of my project in Eclipse.
这是我尝试web.xml
在 Eclipse 中运行我的项目时的错误。
This is the main error that I am facing when I am trying to run the web page of my project
这是我在尝试运行项目的网页时面临的主要错误
***SEVERE: Error configuring application listener of `class` org.apache.catalina.deploy.ApplicationListener@1864160e
java.lang.NoClassDefFoundError: javax/servlet/ServletRequestListener****
at java.lang.ClassLoader.findBootstrapClass(Native Method)
at java.lang.ClassLoader.findBootstrapClassOrNull(`ClassLoader`.java:927)
at java.lang.ClassLoader.loadClass(ClassLoader.java:298)
at java.lang.ClassLoader.loadClass(ClassLoader.java:296)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1629)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:527)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:509)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4854)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Sep 10, 2013 6:37:24 PM org.apache.catalina.core.StandardContext listenerStart
采纳答案by Prasanna
You have missed some jars like struts-spring plugin
你错过了一些罐子,比如 struts-spring plugin
Use similar versions to get clear output
使用类似的版本获得清晰的输出
回答by Sotirios Delimanolis
The servlet-api.jar
is not on your classpath. Check in your servlet container's lib
folder. If you are using Tomcat, that'll typically be in C:/apache-tomcat-7.XX/lib
. If it isn't there, download it and add it.
该servlet-api.jar
不是在你的类路径中。检查您的 servlet 容器的lib
文件夹。如果您使用的是 Tomcat,那通常会在C:/apache-tomcat-7.XX/lib
. 如果它不存在,请下载并添加它。
The Tomcat Servlet API jar is available here.
Tomcat Servlet API jar 可在此处获得。
回答by Roman C
If you have deployed libraries for the javax.servlet
which is part of the JavaEE package then you have made a mistake, the web server already contains those libraries and loads corresponding to your servlet specification API.
如果您已经为javax.servlet
JavaEE 包的一部分部署了库,那么您就犯了一个错误,Web 服务器已经包含与您的 servlet 规范 API 相对应的那些库和负载。
回答by Rishi Gautam
1) Right-click on the project's then select "Properties".
1) 右键单击项目,然后选择“属性”。
2) select "Deployment Assembly"
2)选择“部署程序集”
3) Click the "Add button" on the right side.
3) 点击右侧的“添加按钮”。
4) Select "Java Build Path Entries" from the menu of Directive Type and then click on "Next" button.
4)从 Directive Type 菜单中选择“ Java Build Path Entries”,然后点击“Next”按钮。
5) And Select the "Maven Dependencies" from the Java Build Path Entries menu and click "Finish".
5) 然后从 Java Build Path Entries 菜单中选择“ Maven Dependencies”并单击“Finish”。
6) Delete the old server instance and create the new one then run the project on the server ...
6)删除旧的服务器实例并创建新的服务器实例,然后在服务器上运行该项目...
回答by D8Sasi
Check all the Jars are properly Configured or not. Clean the Eclipse server. Clean Tomcat Working Directory. Go to Menu Project -> Clean. Restart the server and Application.
检查所有的罐子是否正确配置。清理 Eclipse 服务器。清理 Tomcat 工作目录。转到菜单项目 -> 清洁。重新启动服务器和应用程序。
回答by Satish Gadhave
If you have imported someone else's project in Eclipse then remove and add servlet-api.jar
in classpath as the path of servlet-api.jar could be different on your system.
After that clean the project and run again.
如果您在 Eclipse 中导入了其他人的项目,则删除并添加servlet-api.jar
类路径,因为 servlet-api.jar 的路径在您的系统上可能不同。之后清理项目并再次运行。
回答by Ezd
Remove your application from the server and re deploy your application again.
从服务器中删除您的应用程序并重新部署您的应用程序。
回答by Scott Izu
This would periodically happen with me. Even though the dependency was correct and even though I had previously started the server in Eclipse with no problems. However, if I would change code while the server was running, sometimes I would get this problem.
这会定期发生在我身上。即使依赖是正确的,即使我之前在 Eclipse 中启动了服务器也没有问题。但是,如果我在服务器运行时更改代码,有时我会遇到这个问题。
I would remove the application from the server. Start the server. Stop the server. Then, re-run 'mvn eclipse:eclipse -Dwtpversion=2.0" (probably similar to Project->Clean).
我会从服务器中删除该应用程序。启动服务器。停止服务器。然后,重新运行“mvn eclipse:eclipse -Dwtpversion=2.0”(可能类似于 Project->Clean)。
Then, hit F5 to Refresh the project. Add the application to the server. Start the server.
然后,按 F5 刷新项目。将应用程序添加到服务器。启动服务器。
Sometimes changing code while the server is running or if it is stopped incorrectly, this also blocks the port (sometimes shutting down eclipse or restarting my computer is required).
有时在服务器运行时更改代码或者如果它被错误停止,这也会阻塞端口(有时需要关闭 eclipse 或重新启动我的计算机)。
回答by Ashvin Panicker
I experienced a similar issue whenever I checked out my project fresh from the SVN repository and this worked for me:-
每当我从 SVN 存储库中检出我的项目时,我都会遇到类似的问题,这对我有用:-
1) Clean the Server. TopBarMenu>Project>Clean
1) 清洁服务器。TopBarMenu>Project>Clean
2) Disable Automatic Building. TopBarMenu>Project>Uncheck Build Automatically
2)禁用自动构建。TopBarMenu>Project>Uncheck Build Automatically
3) Manually Build the Project. TopBarMenu>Project>Build
3) 手动构建项目。TopBarMenu>Project>Build
Alternatively, RightClick the Projectyou want to Build and click Build Project (above refresh). (Note: This option is hidden if projects are set to build automatically)
或者, 右击该项目要建立和点击生成项目(以上刷新)。(注意:如果项目设置为自动构建,则此选项将隐藏)
4) Run the project.
4) 运行项目。
回答by Dila Gurung
(It worked in my case) This is also one of the case where it works, Go to Windows->ShowView->Servers. Expand Tomcat(for an e.g)-> delete the concerned jar Rebuild the project.
(它在我的情况下有效)这也是它有效的情况之一,转到 Windows->ShowView->Servers。展开Tomcat(例如)-> 删除相关jar 重建项目。
To this condition to work solution given by @Rishi Gautam should be true.
对于这种情况,@Rishi Gautam 给出的工作解决方案应该是正确的。