久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

Spring Boot + Zookeeper + Dubbo + Seata 整合后無法啟動jar包怎么辦

150次閱讀
沒有評論

共計 5546 個字符,預(yù)計需要花費(fèi) 14 分鐘才能閱讀完成。

Spring Boot + Zookeeper + Dubbo + Seata 整合后無法啟動 jar 包怎么辦,針對這個問題,這篇文章詳細(xì)介紹了相對應(yīng)的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。

前言

Spring Boot + Zookeeper + Dubbo + Seata 整合,IDEA 啟動項目報錯,在 tomcat 中則可以運(yùn)行。

版本:

Zookeeper 3.6.1

Dubbo 3.7

Seata 1.4 

報錯異常信息

22:36:01.157 [restartedMain] WARN  o.a.c.l.WebappClassLoaderBase – [log,173] – The web application [ROOT] appears to have started a thread named [Druid-ConnectionPool-Destroy-92732034] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Thread.sleep(Native Method)
 com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2641)
22:36:01.159 [restartedMain] WARN  o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext – [refresh,554] – Exception encountered during context initialization – cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
22:36:01.182 [restartedMain] ERROR o.s.b.SpringApplication – [reportFailure,858] – Application run failed
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
   at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:157)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:540)
   at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
   at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
   at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
   at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
   at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
   at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
   at com.xuanzhen.CouponApplication.main(CouponApplication.java:27)
   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.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)

Caused by: org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceWrapper: Common causes of this problem include using a final class or a non-visible class; nested exception is org.springframework.cglib.core.CodeGenerationException: java.lang.IllegalAccessError– class com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceWrapper$$EnhancerBySpringCGLIB$$3ec0b0c8 cannot access its superclass com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceWrapper
   at org.springframework.aop.framework.CglibAopProxy.getProxy(CglibAopProxy.java:208)
   at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110)
   at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.createProxy(AbstractAutoProxyCreator.java:473)
   at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:352)
   at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:301)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:434)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1749)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576)
   … 152 common frames omitted
   
Caused by: java.lang.IllegalAccessError: class com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceWrapper$$EnhancerBySpringCGLIB$$3ec0b0c8 cannot access its superclass com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceWrapper
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
   at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:498)
   at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:523)
   … 173 common frames omitted

Process finished with exit code 0
 

項目 maven 依賴

  dependencies 
  dependency 
  groupId org.springframework.boot /groupId 
  artifactId spring-boot-dependencies /artifactId 
  version 2.1.1.RELEASE /version 
  type pom /type 
  scope import /scope 
  /dependency 
  /dependencies 
 dependency 
 groupId io.seata /groupId 
 artifactId seata-spring-boot-starter /artifactId 
 version 1.4.0 /version 
 dependency 
 groupId com.101tec /groupId 
 artifactId zkclient /artifactId 
 version 0.11 /version 
 /dependency

嘗試使用網(wǎng)上的方式解決,排除 servlet-api、guava、tomcat 依賴沖突等等,均沒有解決。

解決

最后,將 Seata 客戶端配置文件中默認(rèn)為 false 的 use-jdk-proxy 改為 true,問題解決。

seata:
 enabled: true
 application-id: coupon
 tx-service-group: my_test_tx_group
 enable-auto-data-source-proxy: true
 data-source-proxy-mode: AT
 use-jdk-proxy: true
 excludes-for-auto-proxying: firstClassNameForExclude,secondClassNameForExclude
......

關(guān)于 Spring Boot + Zookeeper + Dubbo + Seata 整合后無法啟動 jar 包怎么辦問題的解答就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關(guān)注丸趣 TV 行業(yè)資訊頻道了解更多相關(guān)知識。

正文完
 
丸趣
版權(quán)聲明:本站原創(chuàng)文章,由 丸趣 2023-08-16發(fā)表,共計5546字。
轉(zhuǎn)載說明:除特殊說明外本站除技術(shù)相關(guān)以外文章皆由網(wǎng)絡(luò)搜集發(fā)布,轉(zhuǎn)載請注明出處。
評論(沒有評論)
主站蜘蛛池模板: 会同县| 乌兰察布市| 乐安县| 屏东市| 乐平市| 华池县| 房产| 琼中| 浦江县| 苏尼特右旗| 紫阳县| 栖霞市| 乌审旗| 甘谷县| 湖口县| 博客| 长沙县| 平定县| 鹿邑县| 中卫市| 临海市| 防城港市| 宣化县| 临安市| 云浮市| 黄平县| 额敏县| 深水埗区| 西盟| 土默特左旗| 瑞昌市| 灵寿县| 西宁市| 宜宾市| 阿图什市| 黄骅市| 潼南县| 蒙城县| 牙克石市| 吐鲁番市| 南陵县|