springBlade2.6.0跟着手册做的blade-demo列子启动不起来。

Blade 未结 4 3225
wang
wang 2020-01-07 11:11
悬赏:10

一、该问题的重现步骤是什么?

1. 自己跟着手册做的blade-demo列子启动不起来。

2. 在其他服务已启动成功的情况下。

3.


二、你期待的结果是什么?实际看到的又是什么?

期待的结果在blade-demo在nacos中成功注册

实际看到是blade-demo启动报错


三、你正在使用的是什么产品,什么版本?在什么操作系统上?

产品 springBlade 版本2.6.0。 在windows上


四、请提供详细的错误堆栈信息,这很重要。

报错信息如下:


org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bladeFeignTargeter' defined in class path resource [org/springblade/core/cloud/feign/BladeFeignAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.openfeign.Targeter]: Factory method 'bladeFeignTargeter' threw exception; nested exception is java.lang.IllegalAccessError: tried to access class org.springframework.cloud.openfeign.Targeter from class org.springblade.core.cloud.feign.BladeFeignAutoConfiguration$$EnhancerBySpringCGLIB$$96bb46ee

at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:656)

at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:484)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879)

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)

at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)

at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140)

at org.springblade.core.launch.BladeApplication.run(BladeApplication.java:49)

at org.springblade.demo1.Demo1Application.main(Demo1Application.java:20)

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.openfeign.Targeter]: Factory method 'bladeFeignTargeter' threw exception; nested exception is java.lang.IllegalAccessError: tried to access class org.springframework.cloud.openfeign.Targeter from class org.springblade.core.cloud.feign.BladeFeignAutoConfiguration$$EnhancerBySpringCGLIB$$96bb46ee

at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)

at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:651)

... 19 common frames omitted

Caused by: java.lang.IllegalAccessError: tried to access class org.springframework.cloud.openfeign.Targeter from class org.springblade.core.cloud.feign.BladeFeignAutoConfiguration$$EnhancerBySpringCGLIB$$96bb46ee

at org.springblade.core.cloud.feign.BladeFeignAutoConfiguration$$EnhancerBySpringCGLIB$$96bb46ee.bladeFeignTargeter()

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)

... 20 common frames omitted


Disconnected from the target VM, address: '127.0.0.1:62182', transport: 'socket'


Process finished with exit code 1


五、若有更多详细信息,请在下面提供。

已启动的服务如下:

4491b60ff2e9a6bc52e704df2ae7527.png




4条回答
  •  goldwins
    goldwins (楼主)
    2020-12-02 11:42

    把依赖顺序调一下,blade-core-boot 放到 xx-api的前面就可以了

提交回复