apache / incubator-seata-samples

Apache Seata(incubating) Samples for Java
https://seata.apache.org/
Apache License 2.0
2.27k stars 1.91k forks source link

springcloud-eureka-seata启动报错 #168

Open jorrellz opened 5 years ago

jorrellz commented 5 years ago

2019-07-02 12:09:52.560 WARN 29440 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataSourceProxy' defined in io.seata.sample.AccountApplication: Unsatisfied dependency expressed through method 'dataSourceProxy' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in io.seata.sample.AccountApplication: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceInitializer': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'dataSourceProxy': Requested bean is currently in creation: Is there an unresolvable circular reference? 2019-07-02 12:09:52.563 INFO 29440 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2019-07-02 12:09:52.598 INFO 29440 --- [ main] utoConfigurationReportLoggingInitializer :

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled. 2019-07-02 12:09:52.605 ERROR 29440 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

The dependencies of some of the beans in the application context form a cycle:

org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration ┌─────┐ | dataSourceProxy defined in io.seata.sample.AccountApplication ↑ ↓ | dataSource defined in io.seata.sample.AccountApplication ↑ ↓ | dataSourceInitializer └─────┘

Process finished with exit code 1

slievrly commented 5 years ago

@jorrellz fixed

slievrly commented 5 years ago

remove @Primary

applefei commented 5 years ago

解决了吗 我这也产生循环引用了 怎么解决的

applefei commented 5 years ago

@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) 启动类上注解添加exclude