带有Apache轴的Spring Boot应用程序 [英] Spring boot application with apache axis

查看:98
本文介绍了带有Apache轴的Spring Boot应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行一个带有axis2依赖项的spring boot jar.我正在使用spring boot maven插件来构建jar(带有依赖项).当我尝试运行jar时,在控制台中出现以下异常:

I am trying to run a spring boot jar which has axis2 dependencies in it. I am using spring boot maven plugin to build the jar (with dependencies). When I try to run my jar, I get the following exception in my console:

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 ...

然后我检查了罐子的结构.它内部有lib文件夹,其中包含所有jar(包括上述轴jar).随附的是lib文件夹的屏幕截图. 以下是我尝试过的解决方案:

I then checked the structure of my jar. It has lib folder inside it, which contained all the jars (including the above mentioned axis jar). Attached is the screen shot of lib folder. Following are the solutions which I have tried:

  1. 将轴jar放置在与应用程序jar相同的目录中.
  2. 在与应用程序jar相同的目录中创建了lib文件夹,并将轴jar放置在其中.
  3. 修改后的清单文件以包含Class-Path:/lib/

所有解决方案均无效.但是,当我在eclipse中运行应用程序类时,该应用程序将启动并完美运行.但是,一旦我创建了jar,似乎什么也没运行.

None of the solutions has worked. However, when I run the application class in eclipse, the app starts and runs perfectly. But, once I create the jar, nothing seems to run.

任何人都可以帮忙吗?预先感谢.

Can anyone please help? Thanks in advance.

推荐答案

看起来Axis无法应付从嵌套在另一个jar中的jar中运行.由于Axis jar可以直接在文件系统上使用,而不是嵌套在Spring Boot应用程序的jar文件中,因此它在Eclipse中可以正常工作.

It looks like Axis can't cope with being run from a jar that's nested within another jar. It works fine in Eclipse as the Axis jar is available directly on the filesystem rather than being nested inside your Spring Boot application's jar file.

您可以配置应用程序的胖jar文件,以便Spring Boot知道在运行时将Axis jar解压缩到一个临时位置.如果您使用的是Maven:

You can configure your application's fat jar file so that Spring Boot knows to unpack the Axis jar into a temporary location when it's run. If you're using 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>

如果您使用的是Gradle:

And if you're using Gradle:

springBoot  {
    requiresUnpack = ['org.apache.axis2:axis2']
}

请参阅

See the Spring Boot documentation for some further details.

这篇关于带有Apache轴的Spring Boot应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆