博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Tomcat启动报错:java.lang.NoClassDefFoundError: javax/servlet/GenericFilter
阅读量:5157 次
发布时间:2019-06-13

本文共 4336 字,大约阅读时间需要 14 分钟。

Jul 27, 2019 9:24:30 AM org.apache.catalina.startup.HostConfig deployWARINFO: Deploying web application archive /opt/tomcat_api/webapps/uniapi.warJul 27, 2019 9:24:30 AM org.apache.catalina.loader.WebappClassLoaderBase validateJarFileINFO: validateJarFile(/opt/tomcat_api/webapps/uniapi/WEB-INF/lib/tomcat-embed-core-9.0.16.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.classJul 27, 2019 9:24:30 AM org.apache.catalina.loader.WebappClassLoaderBase validateJarFileINFO: validateJarFile(/opt/tomcat_api/webapps/uniapi/WEB-INF/lib/tomcat-embed-el-9.0.16.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/el/Expression.classJul 27, 2019 9:24:30 AM org.apache.catalina.deploy.WebXml setVersionWARNING: Unknown version string [4.0]. Default version will be used.Jul 27, 2019 9:24:31 AM org.apache.catalina.startup.TldConfig executeINFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.Jul 27, 2019 9:24:31 AM org.apache.catalina.core.ContainerBase addChildInternalSEVERE: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/uniapi]]    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1015)    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:991)    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1127)    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:2020)    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)    at java.util.concurrent.FutureTask.run(FutureTask.java:266)    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)    at java.lang.Thread.run(Thread.java:748)Caused by: java.lang.NoClassDefFoundError: javax/servlet/GenericFilter    at java.lang.ClassLoader.defineClass1(Native Method)    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)    at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:3205)    at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:1373)    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1861)    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)    at org.apache.tomcat.websocket.server.WsServerContainer.
(WsServerContainer.java:109) at org.apache.tomcat.websocket.server.WsSci.init(WsSci.java:131) at org.apache.tomcat.websocket.server.WsSci.onStartup(WsSci.java:47) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5622) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) ... 10 moreCaused by: java.lang.ClassNotFoundException: javax.servlet.GenericFilter at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735) ... 22 more

在测试环境部署服务,启动Tomcat时提示以上错误。网上搜索,发现是springboot框架自带的tomcat包与实际运行的tomcat有冲突导致的。在pom文件中修改如下:

org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-tomcat
org.springframework.boot
spring-boot-starter-tomcat
provided

重新打包、部署即可。

 

转载于:https://www.cnblogs.com/GreenMountain/p/11254006.html

你可能感兴趣的文章
我对于脚本程序的理解——百度轻应用有感
查看>>
面试时被问到的问题
查看>>
注解小结
查看>>
list control控件的一些操作
查看>>
判断字符串在字符串中
查看>>
201421410014蒋佳奇
查看>>
Xcode5和ObjC新特性
查看>>
Centos 7.0 安装Mono 3.4 和 Jexus 5.6
查看>>
CSS属性值currentColor
查看>>
Real-Time Rendering 笔记
查看>>
实验四2
查看>>
多路复用
查看>>
javascript 无限分类
查看>>
spring IOC装配Bean(注解方式)
查看>>
[面试算法题]有序列表删除节点-leetcode学习之旅(4)
查看>>
kubernetes_book
查看>>
侧边栏广告和回到顶部
查看>>
https://blog.csdn.net/u012106306/article/details/80760744
查看>>
海上孤独的帆
查看>>
处理程序“PageHandlerFactory-Integrated”在其模块列表中有一个错误模块“Manag
查看>>