问题描述:spring boot接入websocket时,启动报错:javax.websocket.server.ServerContainer not available <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId></dependency> 原因:因为sp…
springboot项目添加websocket依赖后运行测试类报如下错误: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverEndpointExporter' defined in org.lwt.WebsocketServerTestApplication: Invocation of init method failed; nested exceptio…
引起条件: WebSocket+单元测试,单元测试报错! 解决方法: SpringBootTest增加webEnvironment参数. https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-testing.html#boot-features-testing-spring-boot-applications @SpringBootTest(webEnvironment = SpringBootT…
项目整合了websocket以后,打包多次都没有成功,原来是报错了,报错内容如下: Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. org.springframework.boot.SpringApplication.reportFailure(SpringApplication.java:837) 2020-03-1…
21:09:22.221 [MessageBroker-3] INFO c.t.s.s.impl.StockNewsServiceImpl - [2017-12-16 21:09:22] execute fetch stock news, result = 0 21:09:32.158 [MessageBroker-2] INFO c.t.s.s.impl.StockNewsServiceImpl - [2017-12-16 21:09:32] execute fetch stock news,…
java.lang.IllegalStateException: Failed to load ApplicationContext    at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)    at org.springframework.test.context…
springboot中抛出异常,springboot自带的是springmvc框架,这个就不多说了. springmvc统一异常解决方法这里要说明的是.只是结合了springboot的使用而已.直接上代码,有效有用的才是ok. 1.定义异常捕获 package com.example.rest.error; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.Exce…
项目启动时抛出 Error: No PostCSS Config found in … 的错误表示某个 css 文件不能被引入 解决办法: module.exports = { plugins: { 'autoprefixer': {browsers: 'last 5 version'} } } 你在网上找的解决方案应该有提到webpack版本的问题.不要以为升级webpack版本,有些模块升级的节奏跟不上,也有可能不更新了,导致你升级了webpack,找不到postcss的配置.目前在npm上…
老魏原创,转载请留言. 原因:给Javabean中的字段注解多余或者错误导致. @NotEmpty @Past @DateTimeFormat(pattern="yyyy-MM-dd") public Date employeeBirth; 以上为错误事例.应去掉@NotEmpty注解.因为此注解的对象不包括时间类型的字段.…
说一下实用springboot搭建一个简单的websocket 的实时推送应用 websocket是什么 WebSocket是一种在单个TCP连接上进行全双工通信的协议 我们以前用的http协议只能单向的浏览器给服务器发请求,然后服务器再去相应返回数据. websocket呢就是可以服务器主动给浏览器发数据 优点 较少的控制开销 更强的实时性 保持连接状态 更好的二进制的支持 支持扩展 更换的压缩效果 pom文件 springboot项目的话只需要下面这个依赖就可以了 <dependency>…