apache / incubator-seata

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.
https://seata.apache.org/
Apache License 2.0
25.23k stars 8.76k forks source link

springboot1.5 集成seata报错 #1945

Closed chuck54430 closed 4 years ago

chuck54430 commented 4 years ago

springboot1.5.14 集成seata报错: 环境描述:springboot:1.5.14 springcloud:Edgware.RELEASE seata:0.9.0 错误描述:正常启动,但是调用api出错,无法提交事务。


Could not commit JDBC transaction; nested exception is java.sql.SQLException:

java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.jsontype.TypeSerializer.typeId(Ljava/lang/Object;Lcom/fasterxml/jackson/core/JsonToken;)Lcom/fasterxml/jackson/core/type/WritableTypeId;

错误信息为TypeSerializer没有typeId,断定是jackson-databind版本问题,因此升级了jackson-databind版本2.8.11.2==》2.9.8。升级完之后启动直接报错:
java.lang.NoClassDefFoundError: Could not initialize class com.fasterxml.jackson.databind.ObjectMapper
    at org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.build(Jackson2ObjectMapperBuilder.java:588) ~[spring-web-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    at org.springframework.http.converter.json.MappingJackson2HttpMessageConverter.<init>(MappingJackson2HttpMessageConverter.java:57) ~[spring-web-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    at org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter.<init>(AllEncompassingFormHttpMessageConverter.java:66) ~[spring-web-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    at org.springframework.web.client.RestTemplate.<init>(RestTemplate.java:166) ~[spring-web-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    at org.springframework.web.client.RestTemplate.<init>(RestTemplate.java:195) ~[spring-web-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getSecureRestTemplate(ConfigServicePropertySourceLocator.java:195) ~[spring-cloud-config-client-1.4.4.RELEASE.jar:1.4.4.RELEASE]
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:78) ~[spring-cloud-config-client-1.4.4.RELEASE.jar:1.4.4.RELEASE]
    at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:94) ~[spring-cloud-context-1.3.4.RELEASE.jar:1.3.4.RELEASE]
    at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:567) [spring-boot-1.5.14.RELEASE.jar:1.5.14.RELEASE]
    at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:338) [spring-boot-1.5.14.RELEASE.jar:1.5.14.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:301) [spring-boot-1.5.14.RELEASE.jar:1.5.14.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.14.RELEASE.jar:1.5.14.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.14.RELEASE.jar:1.5.14.RELEASE]
    at com.cattsoft.zhangsan.serviceD.ServicedApplication.main(ServicedApplication.java:24) [classes/:na]
但是我查看com.fasterxml.jackson.databind.ObjectMapper确实存在。
升级完之后,不确定是不是哪里版本兼容造成的,目前无法解决这个问题。
slievrly commented 4 years ago

@chuck54430 currently, the version of jackson relied on in seata is 2.9.9. Can you upgrade and try it?