首页 > 解决方案 > Spring boot 2.2.6 application with apache axis Issue

问题描述

My question is similar to this one (Spring boot application with apache axis) but I am running Spring Boot v2.2.6. When I execute the command

java -jar -Dspring.profiles.active=local myjar-0.0.1-SNAPSHOT.jar

I get the error

2021-06-01 00:41:53,152 myjar [http-nio-9090-exec-1] ERROR 
org.apache.axis2.deployment.ModuleDeployer - deploy:94 - The addressing-1.6.3-classpath- 
module.jar module, which is not valid, caused The /Users/xxxx/workspace/myjar/build/libs/myjar-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/addressing-1.6.3-classpath- 
module.jar file cannot be found.
org.apache.axis2.AxisFault: The /Users/xxxx/workspace/.../build/libs/myjar-0.0.1- 
SNAPSHOT.jar!/BOOT-INF/lib/addressing-1.6.3-classpath-module.jar file cannot be found.
    

I also have the relevant build.gradle snippet

api "org.apache.axis2:addressing:1.6.3:classpath-module"
api "org.apache.axis2:axis2:1.6.3"
api "org.apache.axis2:axis2-adb:1.6.3"
api "org.apache.axis2:axis2-transport-local:1.6.3"
api "org.apache.axis2:axis2-transport-http:1.6.3"

I confirmed that the file /Users/xxxx/workspace/myjar/build/libs/myjar-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/addressing-1.6.3-classpath-module.jar does exist. Can anyone help fix this issue?

标签: javaspringspring-bootaxis2

解决方案


It looks like Axis cannot cope with one jar file being nested inside another. For situations like this, you can configure Spring Boot to automatically unpack the nested jar when you start your application:

bootJar {
    requiresUnpack '**/addressing-*-classpath-module.jar'
}

推荐阅读