1

我正在尝试在 JBoss EAP v6.4 上部署一个熔断器项目(JBossFuse v6.3)。战争中有一条简单的路线公开了一个肥皂 CXF 端点。我将 CXF 依赖项声明为已配置的 jboss-deployment-structure 以包含放置在 EAP 中的 CXF 模块。当 EAP 启动时,由于 JAXBDataBinding 的 ClassCastException,路由未初始化。

引起:java.lang.ClassCastException:在 org.apache.cxf.common.classloader 的 java.lang.Class.asSubclass(未知来源)[rt.jar:1.8.0_141] 的类 org.apache.cxf.jaxb.JAXBDataBinding .ClassLoaderUtils.loadClass(ClassLoaderUtils.java:269) 在 org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.getJAXBClass(ReflectionServiceFactoryBean.java:239) 在 org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.createDefaultDataBinding (ReflectionServiceFactoryBean.java:219) ... 43 更多

这是我的 pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>it.agos</groupId>
        <artifactId>agos-poc</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <relativePath>../</relativePath>
    </parent>
    <artifactId>agos-finanziamenti</artifactId>
    <packaging>war</packaging>
    <name>AGOS - Prodotti Finanziari</name>
    <description>AGOS - Prodotti Finanziari</description>

    <dependencies>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-cxf</artifactId>
            <version>2.17.0.redhat-630187</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-spring</artifactId>
            <version>2.17.0.redhat-630187</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <scope>provided</scope>
        </dependency>       
        <!-- <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>3.2.4</version>
            <scope>compile</scope>
        </dependency> -->

        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http-jetty</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-rs-security-oauth2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.servlet</groupId>
            <artifactId>jboss-servlet-api_3.0_spec</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>${project.artifactId}</finalName>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-codegen-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-sources</id>
                        <phase>generate-sources</phase>
                        <configuration>
                            <sourceRoot>${basedir}/target/generated-sources/cxf</sourceRoot>
                            <wsdlOptions>
                                <wsdlOption>
                                    <wsdl>${basedir}/src/main/resources/wsdl/NPLX0784_APIM_Service_v1.0.wsdl</wsdl>
                                    <extraargs>
                                        <extraarg>-impl</extraarg>
                                    </extraargs>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>
                        <goals>
                            <goal>wsdl2java</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>${version.maven.war.plugin}</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-maven-plugin</artifactId>
                <version>${version.wildfly.maven.plugin}</version>
                <configuration>
                    <serverConfig>${server.config}</serverConfig>
                    <port>9999</port>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-maven-plugin</artifactId>
                <version>${camel.version}</version>
                <configuration>
                    <fileApplicationContextUri>
                      src/main/webapp/META-INF/*.xml;
                    </fileApplicationContextUri>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <!-- Run with: mvn clean test -Parq-managed -->
            <id>arq-managed</id>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.as</groupId>
                    <artifactId>jboss-as-arquillian-container-managed</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <!-- Run with: mvn clean test -Parq-remote -->
            <id>arq-remote</id>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.as</groupId>
                    <artifactId>jboss-as-arquillian-container-remote</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>
4

0 回答 0