2020-06-03 16:25:21.551 WARN 28596 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'utils': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.emis.education.service.module.UserServer': FactoryBean threw exception on object creation; nested exception is java.lang.ArrayIndexOutOfBoundsException: 1
2020-06-03 16:25:21.554 INFO 28596 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2020-06-03 16:25:21.555 WARN 28596 --- [ main] o.s.b.f.support.DisposableBeanAdapter : Invocation of destroy method 'close' failed on bean with name 'eurekaRegistration': org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
2020-06-03 16:25:21.556 INFO 28596 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2020-06-03 16:25:21.561 INFO 28596 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
2020-06-03 16:25:21.562 INFO 28596 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
查阅网上的资料无果,大部分方案是指向找不到bean,但是我的情况是已经指定了入口文件的@EnableFeignClients,只是依赖无法注入。
最后发现问题起因是在路由层的一个方法与父类冲突或循环引用??根源没有找到,但是我是这样改的,希望对类似的问题有帮助
修改前
@Api(tags = "xx")
@RestController
@RequestMapping("xx")
public class ExamPaperController extends BaseController<xxx,xxx,xxx> {
@PostMapping("xxx")
@ApiOperation("xx")
public void create(@RequestParam("file") MultipartFile file,@PathVariable Long chapter) {
@Component
public class BaseController<S extends BaseService<?>,C,U> {
@PostMapping("")
@ApiOperation("create")
public void create(@RequestBody C body) throws NotFoundException {
this.verify(Thread.currentThread() .getStackTrace()[1].getMethodName(),body);
S service = this.getService();
service.create(body);
修改后(修改方法名)
@Api(tags = "xx")
@RestController
@RequestMapping("xx")
public class ExamPaperController extends BaseController<xxx,xxx,xxx> {
@PostMapping("xxx")
@ApiOperation("xx")
public void createXXX(@RequestParam("file") MultipartFile file,@PathVariable Long chapter) {
FactoryBean threw exception on object creation,FeignClient无法注入bean,bsun.misc.Unsafe.park异常
记一个FeignClient无法注入bean的错误springcloud启动报错,错误log如下springcloud启动报错,错误log如下2020-06-03 16:25:21.551 WARN 28596 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt:
FactoryBean threw exception on object creation; nested exception is org.flowable.common.engine.api.FlowableException: Error initialising dmn data model在启动Flowable和Spring Boot继承的项目时报如下错误:
后来经过排查发现是mysql的问题解决方法:找到数据库所表名以 databasechangeloglock 为后缀的表,并改成如下图格式问
Error creating bean with name ‘processEngine‘: FactoryBean threw exception on object creation;错误解决
FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException
在@FeignClien(“XX”) 接口类中,检查每个方法的参数定义时:
是否有如下情形
@RequestMapping(value="/XXX/query", method = RequestMethod.GET)
public PageResult<XXutionResp> query(@RequestParam(required = fals...
简单记录一下因为Spring版本问题, 对
FeignClient中方法参数传值有了更为明确的定义
主要原因是Spring 4.0版本后,@RequestParam 注解对参数传值有了很好的封装特性并严格校验。参数定义是@RequestParam(value = "Id") String xxId, 该注解参数默认是必填的, 如果需指定分必填, 则 @RequestParam(value = "xxId", required = false) String Id
使用
Feign请求nacos中注册的服务
问题描述:
FactoryBean
threw
exception on
object c
reation; nested
exception is java.lang.IllegalState
Exception: RequestParam.value() was empty on parameter 0
原因分析:
解决方案:
设置@RequestParam Value值
6 Flowable-Modeler详述之常见问题Table act_ge_property doesn't exist问题描述问题定位解决方案一解决方案二(推荐)验证结果打赏版权
在配置完Springboot的开发环境以后,启动的时候遇到了这个问题,数据库版本为mysql 5.7,Flowable版本为6.4.0,详细报错如下:
org.springframework.beans.fa...
FactoryBean threw exception on object creation,FeignClient无法注入bean,bsun.misc.Unsafe.park异常