1、问题概述?
使用Maven进行项目打包的是时候出现如下提示:
There are test failures.
Please refer to E:\projectworkspacetotal\websocketdemo\websocketdemo\target\surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
2、解决办法
首先要明白的是,上面的问题不是主要所在,需要看路径提示
Please refer to E:\projectworkspacetotal\websocketdemo\websocketdemo\target\surefire-reports for the individual test results.
打开文件后的内容:里面是我测试的报错内容,每个人的可能都不同。
针对具体的报错信息,再去排错。
-------------------------------------------------------------------------------
Test set: com.txc.websocketdemo.WebsocketdemoApplicationTests
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.146 s <<< FAILURE! - in com.txc.websocketdemo.WebsocketdemoApplicationTests
contextLoads Time elapsed: 0.011 s <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverEndpointExporter' defined in class path resource [com/txc/websocketdemo/config/WebSocketConfig.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: javax.websocket.server.ServerContainer not available
Caused by: java.lang.IllegalStateException: javax.websocket.server.ServerContainer not available