Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

引用最新0.5.11版本后启动总是提示需要CuratorFramework #142

Open
DarkRayZhang opened this issue Sep 12, 2021 · 6 comments
Open

Comments

@DarkRayZhang
Copy link

Description:

Field beanFactory in org.bytesoft.bytetcc.TransactionManagerImpl required a bean of type 'org.apache.curator.framework.CuratorFramework' that could not be found.

The injection point has the following annotations:
- @javax.inject.Inject()

Action:

Consider defining a bean of type 'org.apache.curator.framework.CuratorFramework' in your configuration.

这个是报错信息,而我当前项目中并没有使用ZK,如果我想到使用一个自定义的类去继承的CuratorFrameworkImpl又报错循环引用。后续用空实现CuratorFramework的类去注册bean解决,项目使用的mysql,但是又报错
Correct the classpath of your application so that it contains a single, compatible version of com.mongodb.MongoClientSettings$Builder
请问下这个有没有比较好的解决方案,网上未找到合适的案例,谢谢

@liuyangming
Copy link
Owner

byteTCC提供两种事务日志存储方式: 1) 本地文件存储; 2) MongoDB存储。如果使用MongoDB存储事务日志,就需要用到zk。

如果确定使用MongoDB,需要注意一下客户端的版本。

@DarkRayZhang
Copy link
Author

按照你提供的思路我修改了导入的class为SpringCloudSecondaryConfiguration。但是又报了另外一个问题:每次尝试去创建feignpostProcessor的时候总是报错:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration': Injection of autowired dependencies failed; nested exception is java.lang.AbstractMethodError: Method org/bytesoft/bytetcc/supports/springcloud/config/SpringCloudSecondaryConfiguration.annotationDrivenTransactionManager()Lorg/springframework/transaction/TransactionManager; is abstract
我追了下代码,invoke的时候无法进入annotationDrivenTransactionManager这个方法,SpringCloudSecondaryConfiguration的beanFactory为null?请问下这个注入的时机是什么时候

@liuyangming
Copy link
Owner

beanFactory是由CompensableBeanFactoryAutoInjector来负责注入的,该类实现了SmartInitializingSingleton接口,由spring调用其afterSingletonsInstantiated时完成beanFactory的注入操作。

@DarkRayZhang
Copy link
Author

我在debug以后发现所有的afterSingletonsInstantiated这个方法根本就没有执行,请问下2.3.9版本的springBoot支持的tcc版本是什么是否因为版本不兼容导致。
trationDelegate$BeanPostProcessorChecker : Bean 'transactionManager' of type [org.bytesoft.bytetcc.TransactionManagerImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

@liuyangming
Copy link
Owner

你这个问题应该和版本不兼容无关,可能与你的配置有关。我建议,你可以考虑在byteTCC-sample的基础上调整配置,看能否重现你遇到的问题。不然你提供的这点信息,我也很难帮你定位什么问题。

@chenmrU
Copy link

chenmrU commented Sep 28, 2021

遇到同样的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants