mr-*_*son 6 java web-services jax-ws maven wildfly
我试图将包含JAX-WS接口的项目部署到wildfly 8.2服务器。该项目是一场战争。在该项目中,我想使用拦截器。
import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
public class ReplyToHeaderInInterceptor extends AbstractSoapInterceptor { /*code*/}
Run Code Online (Sandbox Code Playgroud)
我将Maven与“ provided”标签一起使用,以免收到以下错误:
Apache CXF library (cxf-rt-bindings-soap-3.1.1.jar) detected in ws endpoint deployment; either provide a proper deployment replacing embedded libraries with container module dependencies or disable the webservices subsystem for the current deployment adding a proper jboss-deployment-structure.xml descriptor to it. The former approach is recommended, as the latter approach causes most of the webservices Java EE and any JBossWS specific functionality to be disabled.
Run Code Online (Sandbox Code Playgroud)
看起来像这样:
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.1.1</version>
<scope>provided</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)
但是,如果这样做,则无法在运行时找到该库:
Caused by: java.lang.NoClassDefFoundError: org/apache/cxf/binding/soap/interceptor/AbstractSoapInterceptor
Run Code Online (Sandbox Code Playgroud)
我已经尝试使用maven通过MANIFEST.MF文件添加依赖项:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.5</version>
<configuration>
<packagingExcludes>WEB-INF/web.xml</packagingExcludes>
<warName>backend</warName>
<archive>
<manifestEntries>
<Dependencies>org.apache.cxf</Dependencies>
</manifestEntries>
</archive>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
我不知道该怎么办,有什么建议吗?
事实证明,将一个jboss-deployment-structure.xml文件添加到WEB-INF包含以下内容的文件夹就可以了:
<?xml version="1.0"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<deployment>
<exclusions>
</exclusions>
<dependencies>
<module name="org.apache.cxf" />
<module name="org.apache.cxf.impl" />
</dependencies>
</deployment>
</jboss-deployment-structure>
Run Code Online (Sandbox Code Playgroud)
尽管我之前org.apache.cxf只尝试过,但我不得不添加org.apache.cxf.impl
| 归档时间: |
|
| 查看次数: |
9965 次 |
| 最近记录: |