BladeX-boot 2.4.0打包成war 启动错误

Java 未结 1 1513
413909782
413909782 2020-03-31 10:08


一、该问题的重现步骤是什么?

  1. 生成方式war

     image.png


2. 排除tomcat

 image.png

3.增加打包插件

image.png

4.排除servlet

image.png

5.修改启动类image.png

6、启动



image.png

二、你期待的结果是什么?实际看到的又是什么?


能正常启动,启动时候却提示无法加载 

三、你正在使用的是什么产品,什么版本?在什么操作系统上?


 BladeX-Boot2.4.0.RELEASE windows系统

四、请提供详细的错误堆栈信息,这很重要。



五、若有更多详细信息,请在下面提供。

三月 31, 2020 10:58:02 上午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom

警告: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [141] milliseconds.

三月 31, 2020 10:58:02 上午 org.apache.catalina.startup.HostConfig deployWAR

信息: Deploying web application archive D:\SERVER\tomcat\webapps\BladeX.war

三月 31, 2020 10:58:05 上午 org.apache.catalina.loader.WebappClassLoaderBase validateJarFile

信息: validateJarFile(D:\SERVER\tomcat\webapps\BladeX\WEB-INF\lib\javax.el-3.0.0.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/el/Expression.class

三月 31, 2020 10:58:05 上午 org.apache.catalina.loader.WebappClassLoaderBase validateJarFile

信息: validateJarFile(D:\SERVER\tomcat\webapps\BladeX\WEB-INF\lib\javax.servlet-api-4.0.1.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class

三月 31, 2020 10:58:11 上午 org.apache.catalina.startup.TldConfig execute

信息: 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.

三月 31, 2020 10:58:17 上午 org.apache.catalina.core.ContainerBase addChildInternal

严重: ContainerBase.addChild: start: 

org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/BladeX]]

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)

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(Unknown Source)

at java.util.concurrent.FutureTask.run(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.NoClassDefFoundError: javax/servlet/http/HttpSessionIdListener

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:156)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744)

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391)

at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)

at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:151)

at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:131)

at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:91)

at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5623)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

... 10 more

Caused by: java.lang.NoClassDefFoundError: javax/servlet/http/HttpSessionIdListener

at io.undertow.servlet.core.ApplicationListeners.(ApplicationListeners.java:62)

at io.undertow.servlet.spec.ServletContextImpl.ensureNotProgramaticListener(ServletContextImpl.java:965)

at io.undertow.servlet.spec.ServletContextImpl.getSessionCookieConfig(ServletContextImpl.java:676)

at io.undertow.servlet.core.DeploymentManagerImpl.handleDeploymentSessionConfig(DeploymentManagerImpl.java:642)

at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:179)

at org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory.createDeploymentManager(UndertowServletWebServerFactory.java:287)

at org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory.getWebServer(UndertowServletWebServerFactory.java:213)

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:180)

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:153)

... 21 more

Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpSessionIdListener

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)

... 30 more


三月 31, 2020 10:58:17 上午 org.apache.catalina.startup.HostConfig deployWAR

严重: Error deploying web application archive D:\SERVER\tomcat\webapps\BladeX.war

java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/BladeX]]

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:903)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)

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(Unknown Source)

at java.util.concurrent.FutureTask.run(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)


三月 31, 2020 10:58:17 上午 org.apache.catalina.startup.HostConfig deployWAR

信息: Deployment of web application archive D:\SERVER\tomcat\webapps\BladeX.war has finished in 14,840 ms

三月 31, 2020 10:58:17 上午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deploying web application directory D:\SERVER\tomcat\webapps\chars

三月 31, 2020 10:58:17 上午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deployment of web application directory D:\SERVER\tomcat\webapps\chars has finished in 31 ms

三月 31, 2020 10:58:17 上午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deploying web application directory D:\SERVER\tomcat\webapps\dist

三月 31, 2020 10:58:17 上午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deployment of web application directory D:\SERVER\tomcat\webapps\dist has finished in 29 ms

三月 31, 2020 10:58:17 上午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deploying web application directory D:\SERVER\tomcat\webapps\docs

三月 31, 2020 10:58:17 上午 org.apache.catalina.deploy.WebXml setVersion

警告: Unknown version string [3.1]. Default version will be used.

三月 31, 2020 10:58:17 上午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deployment of web application directory D:\SERVER\tomcat\webapps\docs has finished in 32 ms

三月 31, 2020 10:58:17 上午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deploying web application directory D:\SERVER\tomcat\webapps\examples

三月 31, 2020 10:58:17 上午 org.apache.catalina.deploy.WebXml setVersion

警告: Unknown version string [3.1]. Default version will be used.

三月 31, 2020 10:58:18 上午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deployment of web application directory D:\SERVER\tomcat\webapps\examples has finished in 269 ms

三月 31, 2020 10:58:18 上午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deploying web application directory D:\SERVER\tomcat\webapps\host-manager

三月 31, 2020 10:58:18 上午 org.apache.catalina.deploy.WebXml setVersion

警告: Unknown version string [3.1]. Default version will be used.

三月 31, 2020 10:58:18 上午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deployment of web application directory D:\SERVER\tomcat\webapps\host-manager has finished in 44 ms

三月 31, 2020 10:58:18 上午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deploying web application directory D:\SERVER\tomcat\webapps\upload

三月 31, 2020 10:58:18 上午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deployment of web application directory D:\SERVER\tomcat\webapps\upload has finished in 28 ms

三月 31, 2020 10:58:18 上午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deploying web application directory D:\SERVER\tomcat\webapps\webapps

三月 31, 2020 10:58:18 上午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deployment of web application directory D:\SERVER\tomcat\webapps\webapps has finished in 27 ms

三月 31, 2020 10:58:18 上午 org.apache.coyote.AbstractProtocol start

信息: Starting ProtocolHandler ["http-apr-80"]

三月 31, 2020 10:58:18 上午 org.apache.coyote.AbstractProtocol start

信息: Starting ProtocolHandler ["ajp-apr-8009"]

三月 31, 2020 10:58:18 上午 org.apache.catalina.startup.Catalina start

信息: Server startup in 15691 ms



1条回答
  •  361614772
    361614772 (楼主)
    2022-09-05 20:23

    我也是按照打war包的教程操作的,但是在外置tomcat 启动时候,还是会启动内置的tomcat,这么久怎么没人解决么?

    05-Sep-2022 20:19:47.074 警告 [main] org.apache.tomcat.util.modeler.Registry.disableRegistry 无法禁用MBean注册表,因为它已初始化

    2022-09-05 20:19:47.325  INFO 15088 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8088 (http)

    05-Sep-2022 20:19:47.326 信息 [main] org.apache.coyote.AbstractProtocol.init 初始化协议处理器 ["http-nio-8088"]

    05-Sep-2022 20:19:47.327 信息 [main] org.apache.catalina.core.StandardService.startInternal 正在启动服务[Tomcat]

    05-Sep-2022 20:19:47.327 信息 [main] org.apache.catalina.core.StandardEngine.startInternal 正在启动 Servlet 引擎:[Apache Tomcat/9.0.65]

    05-Sep-2022 20:19:47.334 警告 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent 监听器必须嵌套在Server元素内,但是它在[TomcatEmbeddedContext]

    05-Sep-2022 20:19:47.515 严重 [main] org.apache.catalina.core.ContainerBase.startInternal 子容器启动失败

            java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: 启动加载程序时出错

                    at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)

                    at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)

                    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:926)

                    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)

                    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

                    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)

                    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)

                    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

                    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)

                    at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)

                    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)

                    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:265)


    0 讨论(0)
提交回复