gpt4 book ai didi

linux - 在 Linux 服务器上通过 xldeploy 和 jenkins 部署 thin jar 时出错

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:37:23 24 4
gpt4 key购买 nike

我有一个 spring boot/batch 应用程序,它在使用 jenkins 和 xldeploy 部署时抛出错误。它是一个渐变应用程序。

当我将它作为一个 fat jar 直接部署在服务器上时它工作正常,但是当我通过 jenkins 和 xldeploy 部署该 jar 时它给我以下错误。

Error creating bean with name 'jobOperator' defined in class path resource [com/one/RetirementConversionImport/standalone/BatchConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.one.RetirementConversionImport.standalone.BatchConfiguration$1]: 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.reflect.InvocationTargetException-->null at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:754) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] at com.paychex.RetirementConversionImport.standalone.RetirementConversionImport.main(RetirementConversionImport.java:85) [RetirementConversionImport.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_131] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_131] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131] at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-1.4.2.RELEASE.jar:1.4.2.RELEASE] Caused by: org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.paychex.RetirementConversionImport.standalone.BatchConfiguration$1]: 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.reflect.InvocationTargetException-->null

最佳答案

根本原因是类路径中有 spring-boot-devtools。删除 devtools 解决了问题。所以在这种情况下,问题基本上出在 AOP 代理上。出于某种原因,我们必须关闭 AOP 代理,这将确保它使用 JDK 代理,这可以通过删除 spring-boot-devtools jar 来完成,删除它会启动它以使用 native JDK 代理并修复此错误。

关于linux - 在 Linux 服务器上通过 xldeploy 和 jenkins 部署 thin jar 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47288793/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com