bladex cloud子模块增加第三方jar包,打包部署时异常

Blade 未结 1 223
88052309
88052309 剑圣 2024-07-26 12:27
悬赏:5

一、该问题的重现步骤是什么?

1. bladex cloud子模块增加第三方jar包,打包部署时异常

2.

3.


二、你期待的结果是什么?实际看到的又是什么?

期待结果:能够正常运行

项目中引入第三方JAR,是否需要在POM中增加<includeSystemScope>true</includeSystemScope>,但实际无法增加该属性

三、你正在使用的是什么产品,什么版本?在什么操作系统上?

当前用的是bladex cloud商业版 ,版本4.0.1 centos linux 系统 

四、请提供详细的错误堆栈信息,这很重要。

  • org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'payController' defined in URL [jar:nested:/blade/tj-storage/app.jar/!BOOT-INF/classes/!/org/springblade/tj/storage/controller/PayController.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'lklPayServiceImpl': Lookup method resolution failed
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:795)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:237)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1355)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1192)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:962)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:334)
    at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:149)
    at org.springblade.core.launch.BladeApplication.run(BladeApplication.java:59)
    at org.springblade.tj.storage.StorageApplication.main(StorageApplication.java:18)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:91)
    at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:53)
    at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:58)
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lklPayServiceImpl': Lookup method resolution failed
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.checkLookupMethods(AutowiredAnnotationBeanPostProcessor.java:497)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:367)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1294)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1189)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1443)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:904)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:782)
    ... 26 common frames omitted
    Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.springblade.tj.storage.service.impl.LklPayServiceImpl] from ClassLoader [org.springframework.boot.loader.launch.LaunchedClassLoader@27716f4]
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:483)
    at org.springframework.util.ReflectionUtils.doWithLocalMethods(ReflectionUtils.java:320)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.checkLookupMethods(AutowiredAnnotationBeanPostProcessor.java:475)
    ... 40 common frames omitted
    Caused by: java.lang.NoClassDefFoundError: com/lkl/laop/sdk/request/LklRequest
    at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
    at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3402)
    at java.base/java.lang.Class.getDeclaredMethods(Class.java:2504)
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:465)
    ... 42 common frames omitted
    Caused by: java.lang.ClassNotFoundException: com.lkl.laop.sdk.request.LklRequest
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
    at org.springframework.boot.loader.net.protocol.jar.JarUrlClassLoader.loadClass(JarUrlClassLoader.java:104)
    at org.springframework.boot.loader.launch.LaunchedClassLoader.loadClass(LaunchedClassLoader.java:91)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
    ... 46 common frames omitted

五、若有更多详细信息,请在下面提供。

当前配置pom

<dependency>
<groupId>com.lkl.laop.sdk</groupId>
<artifactId>lkl-laop-java-sdk</artifactId>
<version>1.0.6</version>
<systemPath>${project.basedir}/src/main/resources/lib/lkl-java-sdk-1.0.6.jar</systemPath>
<scope>system</scope>
</dependency>


image.png

1条回答
  • 检查下路径是不是正确:<systemPath>${project.basedir}/src/main/resources/lib/lkl-java-sdk-1.0.6.jar</systemPath>,在pom文件点这个路径能不能正确定位到jar包的路径

    作者追问:2024-07-26 21:32

    已解决,主POM文件,如下配置

    image.png

    0 讨论(0)
提交回复