Spring Boot启动的报错 Stopping service [Tomcat]

网友投稿 308 2022-11-27

Spring Boot启动的报错 Stopping service [Tomcat]

我遇到的问题是项目中使用java_websocket的WebSocketClient,由于性能要求,需要再Controller直接继承WebSocketClient,

在项目启动过程中调试进入springboot框架,大概意思说onClose被识别为内部方法,造循环依赖等问题,具体没去深究,相关错误关键字如下

Eagerly caching bean to allow for resolving potential circular references

Invalid destruction signature

@Controller@Slf4jpublic class ASR2Controller extends WebSocketClient { static String asrUrl = "ws://xxx.yyy.zzz.111:8888/client/ws/speech?content-type=content-type=audio/x-raw,+layout=(string)interleaved,+rate(int)8000,+format=(string)S16LE,+channels=(int)1"; public ConcurrentLinkedQueue recognized = new ConcurrentLinkedQueue(); public ConcurrentLinkedQueue cached = new ConcurrentLinkedQueue(); public ASR2Controller() throws URISyntaxException { this(new URI(asrUrl)); } public ASR2Controller(URI serverUri) { super(serverUri,new Draft_6455()); }

故障排除思路:

降低日志调试级别到info,甚至是debug,trace让其输出更多的日志,如果有能力,追踪框架或者tomcat容器最好不过。

本文最终解决办法:

编译成jar文件运行,然后控制台就出现错误日志了。

mvn package -Dmaven.test.skip=true

java -jar web-01.jarError starting ApplicationContext. To display the conditions report re-run yourapplication with 'debug' enabled.2019-08-24 08:11:14.037 ERROR 5424 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :***************************APPLICATION FAILED TO START***************************Description:Field executor in com.xxx.open.service.impl.TTSConverter required a bean of type 'java.util.concurrent.ExecutorService' that could not be found.Action:Consider defining a bean of type

===============================后续解决方法=======================================

后来和同事交流他推荐我使用logback,logback这个框架比较优秀,很早之前用过,大家可以自行搜索一下。

对于日志配置好奇的看官可以打开这个类看看

org.springframework.boot.context.logging.LoggingApplicationListener

修改yaml(application.yml)中的日志级别增加配置文件解决问题。

application.yml

logging: level: root: debug path: C:\\logs

logback-spring.xml

default ${logLevel} %d{yyyy-MM-dd HH:mm:ss.SSS} %contextName [%thread] %-5level %logger{36} - %msg%n ${logging.path}/${applicationName}.log ${logPath}/${applicationName}/${applicationName}.%d{yyyy-MM-dd}.%i.log 30 100MB 30GB %d{yyyy-MM-dd HH:mm:ss.SSS} %contextName [%thread] %-5level %logger{36} - %msg%n

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:springmvc如何使用map接收参数
下一篇:基于以太网的DSP远程加载技术研究
相关文章

 发表评论

暂时没有评论,来抢沙发吧~