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

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

Eagerly caching bean to allow for resolving potential circular references

Invalid destruction signature

@Controller
@Slf4j
public 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<ASRRecognizedResponse> recognized = new ConcurrentLinkedQueue<ASRRecognizedResponse>();
public ConcurrentLinkedQueue<ASRRecognizedResponse> cached = new ConcurrentLinkedQueue<ASRRecognizedResponse>(); 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.jar

Error 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 'java.util.concurrent.ExecutorService' in yourconfiguration.

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

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

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

org.springframework.boot.context.logging.LoggingApplicationListener

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

application.yml

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

logback-spring.xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<contextName>default</contextName>
 <springProperty scope="context" name="logLevel" source="log.level"/>
    <springProperty scope="context" name="logPath" source="log.path"/>
    <springProperty scope="context" name="applicationName" source="spring.application.name"/>
<!--输出到控制台-->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>${logLevel}</level>
</filter>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %contextName [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<!--输出到文件-->
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${logging.path}/${applicationName}.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>${logPath}/${applicationName}/${applicationName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<!-- keep 30 days' worth of history capped at 3GB total size -->
<maxHistory>30</maxHistory>
<maxFileSize>100MB</maxFileSize>
<totalSizeCap>30GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %contextName [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender> <root level="${logLevel}">
<appender-ref ref="console" />
<appender-ref ref="file" />
</root>
</configuration>

最新文章

  1. &lt;&lt;&lt; web里面Servlet高级应用的基础介绍
  2. C#学习感悟
  3. 惩罚因子(penalty term)与损失函数(loss function)
  4. Django 源码小剖: URL 调度器(URL dispatcher)
  5. Nand Flash与Nor Flash的区别
  6. LF will be replaced by CRLF in git add
  7. 借助LVS+Keepalived实现负载均衡(转)
  8. chrome extensions
  9. oracle ebs 12.20 安装成功其过程失败日记及总结(1)
  10. HDU 1698 Just a Hook (段树更新间隔)
  11. HTML5 新点总结-持续
  12. Codeforces 666E Forensic Examination
  13. Spring中@Autowired与@Resource的区别
  14. RSA算法加解密
  15. Vue-Router路由 Vue-CLI脚手架和模块化开发 之 使用路由对象获取参数
  16. Windows10 家庭版 关闭Windows defender
  17. OOP 面向对象的理解
  18. mongo学习使用记录1
  19. Vue.js 相关知识(动画)
  20. DocumentManager在标签位置显示气泡框 z

热门文章

  1. PAT Basic 1059 C语言竞赛 (20 分)
  2. Python3学习笔记36-PEP8代码规范
  3. Python 基础知识 (1) 持续更新
  4. flutter 项目中打印原生安卓的log信息
  5. excel操作之poi-ooxml
  6. vscode调整字体大小
  7. hdu 6074 Phone Call
  8. andSelf() V1.2 加入先前所选的加入当前元素中
  9. 51 Nod 1509 加长棒(巧妙的隔板法计数)
  10. 「BZOJ 2653」middle「主席树」「二分」