In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
What if the jar package cannot be started after the integration of Spring Boot + Zookeeper + Dubbo + Seata. In order to solve this problem, this article introduces the corresponding analysis and solutions in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
Preface
Spring Boot + Zookeeper + Dubbo + Seata integration, IDEA startup project error, can be run in tomcat.
Version:
Zookeeper 3.6.1
Dubbo 3.7
Seata 1.4
Error abnormal information
22 restartedMain 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)
22RV 36RV 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
2236RV 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 (NativeMethod)
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
Project maven dependency
Org.springframework.boot spring-boot-dependencies 2.1.1.RELEASE pom import io.seata seata-spring-boot-starter 1.4.0 Com.101tec zkclient 0.11
Try to use online solutions, excluding servlet-api, guava, tomcat dependency conflicts, and so on, are not resolved.
Solve
Finally, change the use-jdk-proxy that defaults to false in the Seata client configuration file to true, and the problem is resolved.
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. This is the answer to the question about how to start the jar package after the integration of Spring Boot + Zookeeper + Dubbo + Seata. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.