03 2022 档案
SpringBoot使用JSR356 Websocket使用configurator = SpringConfigurator.class自动注入Spring IOC的bean报错: Failed to find the root WebApplicationContext. Was ContextLoaderListener not used?
摘要:背景 笔者在springboot中使用JSR356的Websocket注解,然后各种方式尝试注入Bean,大多失效。 Spring MVC 4.x时代,推荐代码如下 @ServerEndpoint(value = "/WSAPI/Equipment/JobCounterReport/{dispatc
阅读全文
并发Map类删除数据的问题java.lang.UnsupportedOperationException: null
摘要:背景 笔者最近在开发Websocket相关的消息推送服务,使用了JSR356规范,由于需要维持会话。于是分别使用了以下类 //客户端缓存<dispatchNo,ebSocketServer> private static final ConcurrentHashMap<String, Set<Web
阅读全文
Excel导出工具Apache poi在docker环境中报错/usr/local/jdk1.8.0_202/jre/lib/amd64/libawt_xawt.so: libXext.so.6: cannot open shared object file: No such file or directory
摘要:背景 java现代化编程中,通常会使用CI/CD技术进行项目部署,笔者最近的项目就使用了Jekins部署项目到docker环境中。 由于docker image中的jdk版本比较低,计划升级jdk的版本,以规避JDK 1.8.u1xx系列的bug。 举例来说,笔者将docker文件中的版本升级到1.
阅读全文