Jboss EAP 6.4不排除模块

时间:2016-12-21 10:36:17

标签: web-services classloader jbossfuse jboss-eap-6

我有一个war文件,我想在Jboss EAP 6.4上部署它。在这场战争中,我想使用我正确的Apache CXF jar(3.1.9)。为此,我排除了Jboss的apache cxf EAP 6.4但这是徒劳的,因为我还有问题。

首先,这是我的项目结构。

MyProject.war
   +WEB-INF
      +jboss-deployment-structure.xml
      +web.xml

jboss-deployment-structure.xml内容:

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<deployment>
    <dependencies>

        <!-- <module name="org.apache.cxf" slot="3.1" /> -->
        <!-- <module name="org.springframework.spring" /> -->
    </dependencies>
    <exclude-subsystems>
        <subsystem name="Webservices" />
        <subsystem name="webservices" />
    </exclude-subsystems>
    <exclusions>
        <module name="org.jboss.ws.api" />

        <module name="org.apache.cxf.impl" />
        <module name="org.apache.cxf" slot="3.1" />


    </exclusions>
</deployment>
 </jboss-deployment-structure> 

我的web.xml内容:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee    http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    version="3.0">
    <display-name>My Project</display-name>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:META-INF/spring/*.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <servlet>
        <servlet-name>CXFServlet</servlet-name>
        <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>CXFServlet</servlet-name>
        <url-pattern>/soap/*</url-pattern>
    </servlet-mapping>
</web-app>

我的Pom.xml父内容:

<?xml version="1.0" encoding="UTF-8"?>
<project
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.par.pro</groupId>
    <artifactId>MyParentProjectArtifact</artifactId>
    <version>0.0.1</version>
    <packaging>pom</packaging>
    <name>MyParentProject</name>
    <description>desc</description>
    <properties>
        <maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
        <version.jboss.spec.javax.servlet>1.0.0.Final</version.jboss.spec.javax.servlet>
        <version.jboss.jaxrs-api.spec>1.0.1.Final</version.jboss.jaxrs-api.spec>
        <version.maven.compiler.plugin>3.2</version.maven.compiler.plugin>
        <jboss.home>${env.JBOSS_HOME}</jboss.home>
        <version.activemq>5.11.0.redhat-621084</version.activemq>
        <version.slf4j>1.7.22</version.slf4j>
        <jboss.as.plugin.version>7.6.Final</jboss.as.plugin.version>
        <camel.version>2.18.1</camel.version>
        <cxf.version>2.7.18</cxf.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.war.plugin.version>2.5</maven.war.plugin.version>
        <version.spring>4.3.0.RELEASE</version.spring>
        <version.jboss.spec.javax.ejb>1.0.0.Final</version.jboss.spec.javax.ejb>
        <cxf.commonsSchema.version>2.3.11</cxf.commonsSchema.version>
        <version.javax.enterprise>1.2</version.javax.enterprise>
        <version.cxf.core>3.1.9</version.cxf.core>
        <version.cxf-rt-bindings-soap>3.1.9</version.cxf-rt-bindings-soap>
    </properties>
    <dependencyManagement>

        <dependencies>
<!--            <dependency> -->
<!--                <groupId>org.apache.ws.security</groupId> -->
<!--                <artifactId>wss4j</artifactId> -->
<!--                <version>1.6.19</version> -->
<!--            </dependency> -->

            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-ws-security</artifactId>
                <version>${version.cxf.core}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-core</artifactId>
                <version>${version.cxf.core}</version>
                <!-- <scope>provided</scope> -->
            </dependency>
            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-transports-http-jetty</artifactId>
                <version>${version.cxf.core}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-frontend-jaxrs</artifactId>
                <version>${version.cxf.core}</version>
            </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-frontend-jaxws</artifactId>
        <version>${version.cxf.core}</version>
    </dependency>

            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-cxf-transport</artifactId>
                <version>${camel.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-jetty9</artifactId>
                <version>${camel.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-bindings-soap</artifactId>
                <version>${version.cxf-rt-bindings-soap}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-transports-jms</artifactId>
                <version>${cxf-version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-test-spring</artifactId>
                <version>2.17.3</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-cxf</artifactId>
                <version>2.17.3</version>
            </dependency>
            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-common-schemas</artifactId>
                <version>${cxf.commonsSchema.version}</version>
            </dependency>

<!--            <dependency> -->
<!--                <groupId>org.apache.cxf</groupId> -->
<!--                <artifactId>cxf-api</artifactId> -->
<!--                <version>${cxf.version}</version> -->
<!--            </dependency> -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context-support</artifactId>
                <version>${version.spring}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${version.spring}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j-impl</artifactId>
                <version>2.1</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>2.7</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
                <version>${version.spring}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
                <version>${version.spring}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${version.spring}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.ejb3</groupId>
                <artifactId>jboss-ejb3-ext-api</artifactId>
                <version>2.1.0</version>
            </dependency>
            <dependency>
                <groupId>javax.annotation</groupId>
                <artifactId>javax.annotation-api</artifactId>
                <version>${version.javax.enterprise}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-core</artifactId>
                <version>${camel.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-jms</artifactId>
                <version>${camel.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.spec</groupId>
                <artifactId>jboss-javaee-web-6.0</artifactId>
                <version>2.0.0.Final</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-test</artifactId>
                <version>${camel.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-cdi</artifactId>
                <version>${camel.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>javax.enterprise</groupId>
                <artifactId>cdi-api</artifactId>
                <version>${version.javax.enterprise}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-servlet</artifactId>
                <version>${camel.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-jpa</artifactId>
                <version>${camel.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-spring</artifactId>
                <version>${camel.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.spec.javax.ejb</groupId>
                <artifactId>jboss-ejb-api_3.2_spec</artifactId>
                <version>${version.jboss.spec.javax.ejb}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.spec.javax.servlet</groupId>
                <artifactId>jboss-servlet-api_3.1_spec</artifactId>
                <version>${version.jboss.spec.javax.servlet}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.spec.javax.ws.rs</groupId>
                <artifactId>jboss-jaxrs-api_1.1_spec</artifactId>
                <version>${version.jboss.jaxrs-api.spec}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>${version.slf4j}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${version.slf4j}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>activemq-camel</artifactId>
                <version>5.11.0</version>
            </dependency>
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>activemq-all</artifactId>
                <version>${version.activemq}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <repositories>
        <repository>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <id>redhat-techpreview-all-repository</id>
            <name>Red Hat Tech Preview repository (all)</name>
            <url>http://maven.repository.redhat.com/techpreview/all/</url>
        </repository>
        <repository>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <id>redhat-ea-repository</id>
            <name>Red Hat Early Access repository (all)</name>
            <url>https://maven.repository.redhat.com/earlyaccess/all/</url>
        </repository>
        <repository>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>fusesource.releases</id>
            <name>FuseSource Release Repository</name>
            <url>http://repo.fusesource.com/nexus/content/repositories/releases</url>
        </repository>
        <repository>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>fusesource.public</id>
            <name>FuseSource Release Repository</name>
            <url>http://repo.fusesource.com/nexus/content/groups/public/</url>
        </repository>
        <repository>
            <id>redhat-ga-repository</id>
            <url>https://maven.repository.redhat.com/ga</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>redhat-techpreview-all-repository</id>
            <name>Red Hat Tech Preview repository (all)</name>
            <url>http://maven.repository.redhat.com/techpreview/all/</url>
        </pluginRepository>
        <pluginRepository>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>redhat-ea-repository</id>
            <name>Red Hat Early Access repository (all)</name>
            <url>https://maven.repository.redhat.com/earlyaccess/all/</url>
        </pluginRepository>
        <pluginRepository>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>fusesource.releases</id>
            <name>FuseSource Release Repository</name>
            <url>http://repo.fusesource.com/nexus/content/repositories/releases</url>
        </pluginRepository>
        <pluginRepository>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>fusesource.public</id>
            <name>FuseSource Release Repository</name>
            <url>http://repo.fusesource.com/nexus/content/groups/public/</url>
        </pluginRepository>
        <pluginRepository>
            <id>eviwarePluginRepository</id>
            <url>http://www.soapui.org/repository/maven2/</url>
        </pluginRepository>
        <pluginRepository>
            <id>redhat-ga-repository</id>
            <url>https://maven.repository.redhat.com/ga</url>
        </pluginRepository>
    </pluginRepositories>
    <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-maven-plugin</artifactId>
                <version>2.15.1</version>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version>
                <configuration>
                    <failOnMissingWebXml>true</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jboss.as.plugins</groupId>
                <artifactId>jboss-as-maven-plugin</artifactId>
                <version>7.0.2.Final</version>
            </plugin>
        </plugins>
    </build>
</project>

我的项目pom.xml内容:

<?xml version="1.0" encoding="UTF-8"?>
<project
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.par.pro</groupId>
        <artifactId>MyParentProjectArtifact</artifactId>
        <version>0.0.1</version>
        <relativePath>../parent/pom.xml</relativePath>
    </parent>
    <groupId>com.proj</groupId>
    <artifactId>projartifact</artifactId>

    <packaging>war</packaging>
    <name>my project</name>
    <description>my project desc</description>
    <properties>
        <maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
        <version.jboss.spec.javax.servlet>1.0.0.Final</version.jboss.spec.javax.servlet>
        <version.jboss.jaxrs-api.spec>1.0.1.Final</version.jboss.jaxrs-api.spec>
        <version.maven.compiler.plugin>3.2</version.maven.compiler.plugin>
        <jboss.home>${env.JBOSS_HOME}</jboss.home>
        <version.activemq>5.11.0.redhat-621084</version.activemq>
        <version.slf4j>1.7.22</version.slf4j>
        <jboss.as.plugin.version>7.6.Final</jboss.as.plugin.version>
        <camel.version>2.18.1</camel.version>
        <cxf.version>2.7.18</cxf.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.war.plugin.version>2.5</maven.war.plugin.version>
        <version.spring>4.3.0.RELEASE</version.spring>
        <version.jboss.spec.javax.ejb>1.0.0.Final</version.jboss.spec.javax.ejb>
        <cxf.commonsSchema.version>2.3.11</cxf.commonsSchema.version>
        <version.javax.enterprise>1.2</version.javax.enterprise>
        <version.cxf.core>3.1.9</version.cxf.core>
        <version.cxf-rt-bindings-soap>3.1.9</version.cxf-rt-bindings-soap>
    </properties>

    <dependencies>
        <!-- <dependency> -->
        <!-- <groupId>org.apache.ws.security</groupId> -->
        <!-- <artifactId>wss4j</artifactId> -->

        <!-- </dependency> -->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-ws-security</artifactId>

        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-core</artifactId>
<!--            <scope>provided</scope> -->
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-cxf-transport</artifactId>

        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-jetty9</artifactId>

        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-cxf</artifactId>

        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http-jetty</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-common-schemas</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
        </dependency>
        <!-- <dependency> -->
        <!-- <groupId>org.apache.cxf</groupId> -->
        <!-- <artifactId>cxf-api</artifactId> -->
        <!-- </dependency> -->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>

        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http-jetty</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.ejb3</groupId>
            <artifactId>jboss-ejb3-ext-api</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-core</artifactId>

            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-jms</artifactId>

            <scope>provided</scope>
        </dependency>
        <!-- <dependency> -->
        <!-- <groupId>org.jboss.spec</groupId> -->
        <!-- <artifactId>jboss-javaee-web-6.0</artifactId> -->

        <!-- <type>pom</type> -->
        <!-- <scope>import</scope> -->
        <!-- </dependency> -->
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-test</artifactId>

            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-cdi</artifactId>

            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-servlet</artifactId>

            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-jpa</artifactId>

            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-spring</artifactId>

        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.ejb</groupId>
            <artifactId>jboss-ejb-api_3.2_spec</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.servlet</groupId>
            <artifactId>jboss-servlet-api_3.1_spec</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.ws.rs</groupId>
            <artifactId>jboss-jaxrs-api_1.1_spec</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-camel</artifactId>

        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-all</artifactId>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <id>redhat-techpreview-all-repository</id>
            <name>Red Hat Tech Preview repository (all)</name>
            <url>http://maven.repository.redhat.com/techpreview/all/</url>
        </repository>
        <repository>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <id>redhat-ea-repository</id>
            <name>Red Hat Early Access repository (all)</name>
            <url>https://maven.repository.redhat.com/earlyaccess/all/</url>
        </repository>
        <repository>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>fusesource.releases</id>
            <name>FuseSource Release Repository</name>
            <url>http://repo.fusesource.com/nexus/content/repositories/releases</url>
        </repository>
        <repository>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>fusesource.public</id>
            <name>FuseSource Release Repository</name>
            <url>http://repo.fusesource.com/nexus/content/groups/public/</url>
        </repository>
        <repository>
            <id>redhat-ga-repository</id>
            <url>https://maven.repository.redhat.com/ga</url>
        </repository>
    </repositories>
    <pluginRepositories>

    </pluginRepositories>
    <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-maven-plugin</artifactId>
                <version>2.15.1</version>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version>
                <configuration>
                    <failOnMissingWebXml>true</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jboss.as.plugins</groupId>
                <artifactId>jboss-as-maven-plugin</artifactId>
                <version>7.0.2.Final</version>
            </plugin>
        </plugins>
    </build>
</project>

这是我尝试在Jboss EAP 6.4上部署时遇到的错误

org/jboss/modules/ModuleClassLoader) previously initiated loading for a different type with name "org/apache/cxf/service/model/EndpointInfo"
    at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.8.0_111]
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763) [rt.jar:1.8.0_111]
    at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:361) [jboss-modules.jar:1.3.6.Final-redhat-1]
    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:482) [jboss-modules.jar:1.3.6.Final-redhat-1]
    at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:277) [jboss-modules.jar:1.3.6.Final-redhat-1]
    at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:92) [jboss-modules.jar:1.3.6.Final-redhat-1]
    at org.jboss.modules.Module.loadModuleClass(Module.java:568) [jboss-modules.jar:1.3.6.Final-redhat-1]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205) [jboss-modules.jar:1.3.6.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.6.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.6.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.6.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.6.Final-redhat-1]
    at java.lang.Class.getDeclaredMethods0(Native Method) [rt.jar:1.8.0_111]
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) [rt.jar:1.8.0_111]
    at java.lang.Class.getDeclaredMethod(Class.java:2128) [rt.jar:1.8.0_111]
    at org.apache.cxf.configuration.spring.ConfigurerImpl.getBeanName(ConfigurerImpl.java:225) [cxf-core-3.1.9.jar:3.1.9]
    at org.apache.cxf.configuration.spring.ConfigurerImpl.configureBean(ConfigurerImpl.java:144) [cxf-core-3.1.9.jar:3.1.9]
    at org.apache.cxf.configuration.spring.ConfigurerImpl.configureBean(ConfigurerImpl.java:131) [cxf-core-3.1.9.jar:3.1.9]
    at org.apache.cxf.bus.extension.ExtensionManagerImpl.loadAndRegister(ExtensionManagerImpl.java:221) [cxf-core-3.1.5.redhat-630187.jar:3.1.5.redhat-630187]

1 个答案:

答案 0 :(得分:0)

发现问题 原因是我有CDI驼峰上下文,这也会导致Jboss的类加载器加载它的cfx-core。

&#13;
&#13;
//@ApplicationScoped
//@ContextName("cdi-context")
public class MyStartup   
&#13;
&#13;
&#13;

刚删除,evreything很好:)