Dar*_*hta 7 spring axis maven spring-boot
我正在尝试运行一个具有axis2依赖关系的spring boot jar.我使用spring boot maven插件来构建jar(带有依赖项).当我尝试运行我的jar时,我在控制台中遇到以下异常:
org.apache.axis2.AxisFault: The G:application\myapp\target\myapp.jar!\lib\axis2-1.6.1.jar file cannot be found.
at org.apache.axis2.deployment.repository.util.DeploymentFileData.setClassLoader(DeploymentFileData.java:111)
at org.apache.axis2.deployment.ModuleDeployer.deploy(ModuleDeployer.java:70)
at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:813)
at org.apache.axis2.deployment.RepositoryListener.loadClassPathModules(RepositoryListener.java:222)
at org.apache.axis2.deployment.RepositoryListener.init2(RepositoryListener.java:71)
at org.apache.axis2.deployment.RepositoryListener.<init>(RepositoryListener.java:64)
at org.apache.axis2.deployment.DeploymentEngine.loadFromClassPath(DeploymentEngine.java:175)
at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:135)
at ...
Run Code Online (Sandbox Code Playgroud)
然后我检查了我的罐子的结构.它里面有lib文件夹,里面包含所有的jar(包括上面提到的jar jar).附件是lib文件夹的屏幕截图.以下是我尝试的解决方案:
这些解决方案都没有奏效.但是,当我在eclipse中运行应用程序类时,应用程序启动并完美运行.但是,一旦我创建了jar,似乎没有任何东西可以运行.
有人可以帮忙吗?提前致谢.
And*_*son 14
看起来Axis无法应对从嵌套在另一个jar中的jar运行.它在Eclipse中运行良好,因为Axis jar可直接在文件系统上使用,而不是嵌套在Spring Boot应用程序的jar文件中.
您可以配置应用程序的胖jar文件,以便Spring Boot知道在运行时将Axis jar解压缩到临时位置.如果您正在使用Maven:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<requiresUnpack>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2</artifactId>
</dependency>
</requiresUnpack>
</configuration>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)
如果你正在使用Gradle:
springBoot {
requiresUnpack = ['org.apache.axis2:axis2']
}
Run Code Online (Sandbox Code Playgroud)
有关更多详细信息,请参阅Spring Boot文档.
归档时间: |
|
查看次数: |
6701 次 |
最近记录: |