我试图弄清楚我必须在 pom.xml 中包含哪些工件才能让其他人的 JAX-WS 瘦客户端编译和运行其 junit 测试。按照目前的情况,它仅使用axis2-jaxws 工件编译文件:
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-jaxws</artifactId>
<version>1.6.0</version>
<scope>provided</scope>
</dependency>
但是,当我尝试运行测试时,我得到了 ClassNotFoundException:
Caused by: java.lang.ClassNotFoundException: org.apache.ws.policy.Assertion
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:72)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:134)
at org.apache.axis2.description.AxisDescription.<init>(AxisDescription.java:25)
at org.apache.axis2.engine.AxisConfiguration.<init>(AxisConfiguration.java:85)
at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:767)
at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:113)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:38)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:90)
at org.apache.axis2.jaxws.ClientConfigurationFactory.getClientConfigurationContext(ClientConfigurationFactory.java:116)
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:92)
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:79)
at org.apache.axis2.jaxws.description.DescriptionFactory.createServiceDescription(DescriptionFactory.java:78)
at org.apache.axis2.jaxws.spi.ServiceDelegate.<init>(ServiceDelegate.java:219)
at org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:83)
at org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:79)
at javax.xml.ws.Service.<init>(Service.java:57)
at javax.xml.ws.Service.create(Service.java:687)
我尝试将范围切换到“测试”甚至“编译”,但没有任何区别。显然, Assertion 类不是 jaxws 依赖树的一部分。在 jarvana.com 上进行的一些搜索将我指向ws-commons/policy artifact,但这是古老的。
我似乎找不到与最新的 jax-ws 工件配套的最新工件。我也尝试过包含壁垒项目工件,但无济于事。
谁能帮我指出正确的方向?
谢谢,
埃里克