关注JEECG发展历程 关注最新动态和版本, 记录JEECG成长点滴 更新日志 - 技术支持 - 招聘英才

JEECG最新版本下载 JEECG智能开发平台 - 显著提高开发效率 常见问题 - 入门视频 - 参与开源团队

商务QQ: 69893005、418799587 商务热线(5*8小时): 010-64808099 官方邮箱: jeecgos@163.com

查看: 6092|回复: 3

生成的war包不能在tomcat运行,报错如下,高手帮忙

[复制链接]
发表于 2019-12-26 11:16:40 | 显示全部楼层 |阅读模式
Error starting ApplicationContext. To display the conditions report re-run your
application with 'debug' enabled.
2019-12-26 11:01:44.813 [localhost-startStop-1] ERROR org.springframework.boot.S
pringApplication:858 - Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'serverEndpointExporter' defined in class path resource [org/jeecg/config
/WebSocketConfig.class]: Invocation of init method failed; nested exception is j
ava.lang.IllegalStateException: javax.websocket.server.ServerContainer not avail
able
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1762)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:515)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$
doGetBean$0(AbstractBeanFactory.java:320)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:318)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:199)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.
preInstantiateSingletons(DefaultListableBeanFactory.java:849)
        at org.springframework.context.support.AbstractApplicationContext.finish
BeanFactoryInitialization(AbstractApplicationContext.java:877)
        at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:549)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicat
ionContext.refresh(ServletWebServerApplicationContext.java:142)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.
java:775)
        at org.springframework.boot.SpringApplication.refreshContext(SpringAppli
cation.java:397)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java
:316)
        at org.springframework.boot.web.servlet.support.SpringBootServletInitial
izer.run(SpringBootServletInitializer.java:157)
        at org.springframework.boot.web.servlet.support.SpringBootServletInitial
izer.createRootApplicationContext(SpringBootServletInitializer.java:137)
        at org.springframework.boot.web.servlet.support.SpringBootServletInitial
izer.onStartup(SpringBootServletInitializer.java:91)
        at org.springframework.web.SpringServletContainerInitializer.onStartup(S
pringServletContainerInitializer.java:171)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContex
t.java:5154)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:743)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:71
9)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)

        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:970)

        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:
1841)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51
1)
        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.IllegalStateException: javax.websocket.server.ServerContain
er not available
        at org.springframework.util.Assert.state(Assert.java:73)
        at org.springframework.web.socket.server.standard.ServerEndpointExporter
.afterPropertiesSet(ServerEndpointExporter.java:106)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1821)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1758)
        ... 29 common frames omitted
26-Dec-2019 11:01:44.821 严重 [localhost-startStop-1] org.apache.catalina.core.C
ontainerBase.addChildInternal ContainerBase.addChild: start:
        org.apache.catalina.LifecycleException: Failed to start component [Stand
ardEngine[Catalina].StandardHost[localhost].StandardContext[/jeecg-boot]]
                at org.apache.catalina.util.LifecycleBase.handleSubClassExceptio
n(LifecycleBase.java:440)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.ja
va:198)
                at org.apache.catalina.core.ContainerBase.addChildInternal(Conta
inerBase.java:743)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase
.java:719)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.j
ava:705)
                at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.j
ava:970)
                at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConf
ig.java:1841)
                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(ThreadPoolE
xecutor.java:1149)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPool
Executor.java:624)
                at java.lang.Thread.run(Thread.java:748)
        Caused by: org.springframework.beans.factory.BeanCreationException: Erro
r creating bean with name 'serverEndpointExporter' defined in class path resourc
e [org/jeecg/config/WebSocketConfig.class]: Invocation of init method failed; ne
sted exception is java.lang.IllegalStateException: javax.websocket.server.Server
Container not available
                at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1762)
                at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
                at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
                at org.springframework.beans.factory.support.AbstractBeanFactory
.lambda$doGetBean$0(AbstractBeanFactory.java:320)
                at org.springframework.beans.factory.support.DefaultSingletonBea
nRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
                at org.springframework.beans.factory.support.AbstractBeanFactory
.doGetBean(AbstractBeanFactory.java:318)
                at org.springframework.beans.factory.support.AbstractBeanFactory
.getBean(AbstractBeanFactory.java:199)
                at org.springframework.beans.factory.support.DefaultListableBean
Factory.preInstantiateSingletons(DefaultListableBeanFactory.java:849)
                at org.springframework.context.support.AbstractApplicationContex
t.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
                at org.springframework.context.support.AbstractApplicationContex
t.refresh(AbstractApplicationContext.java:549)
                at org.springframework.boot.web.servlet.context.ServletWebServer
ApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
                at org.springframework.boot.SpringApplication.refresh(SpringAppl
ication.java:775)
                at org.springframework.boot.SpringApplication.refreshContext(Spr
ingApplication.java:397)
                at org.springframework.boot.SpringApplication.run(SpringApplicat
ion.java:316)
                at org.springframework.boot.web.servlet.support.SpringBootServle
tInitializer.run(SpringBootServletInitializer.java:157)
                at org.springframework.boot.web.servlet.support.SpringBootServle
tInitializer.createRootApplicationContext(SpringBootServletInitializer.java:137)

                at org.springframework.boot.web.servlet.support.SpringBootServle
tInitializer.onStartup(SpringBootServletInitializer.java:91)
                at org.springframework.web.SpringServletContainerInitializer.onS
tartup(SpringServletContainerInitializer.java:171)
                at org.apache.catalina.core.StandardContext.startInternal(Standa
rdContext.java:5154)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.ja
va:183)
                ... 10 more
        Caused by: java.lang.IllegalStateException: javax.websocket.server.Serve
rContainer not available
                at org.springframework.util.Assert.state(Assert.java:73)
                at org.springframework.web.socket.server.standard.ServerEndpoint
Exporter.afterPropertiesSet(ServerEndpointExporter.java:106)
                at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1821)
                at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1758)
                ... 29 more
26-Dec-2019 11:01:44.842 严重 [localhost-startStop-1] org.apache.catalina.startu
p.HostConfig.deployWAR 部署 Web 应用程序 archive [D:\apache-tomcat-8.5.50-window
s-x64\apache-tomcat-8.5.50\webapps\jeecg-boot.war] 时出错
        java.lang.IllegalStateException: ContainerBase.addChild: start: org.apac
he.catalina.LifecycleException: Failed to start component [StandardEngine[Catali
na].StandardHost[localhost].StandardContext[/jeecg-boot]]
                at org.apache.catalina.core.ContainerBase.addChildInternal(Conta
inerBase.java:747)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase
.java:719)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.j
ava:705)
                at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.j
ava:970)
                at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConf
ig.java:1841)
                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(ThreadPoolE
xecutor.java:1149)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPool
Executor.java:624)
                at java.lang.Thread.run(Thread.java:748)

 楼主| 发表于 2019-12-26 11:17:50 | 显示全部楼层
eclipse正常,jar正常
发表于 2019-12-26 14:07:54 | 显示全部楼层
发表于 2020-1-7 10:29:28 | 显示全部楼层
@Configuration
public class WebSocketConfig {
    /**
     *         注入ServerEndpointExporter,
     *         这个bean会自动注册使用了@ServerEndpoint注解声明的Websocket endpoint
     */
    @Bean
    @Profile({"dev", "test"})
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }
   
}
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表