JBoss 6 EAP JaxWsProxyFactoryBean NoClassDefFoundError

早过忘川 提交于 2019-12-04 13:03:00

Finally I've solved it.

First of all, thank willome response. By the nature of the services architecture (implemented with Apache CXF) I preferred to solve using CXF.

JBoss EAP 6 embed a full version of CXF framework, with the particularity that is "divided" into modules and the key has been to identify exactly the modules included in the application.

The good thing about all this is that the war now are very light, and you can NOT include the vast majority of frameworks / libraries ... in my case I went from one war of 30MB to final 5MB.

Then finally I added the file to the application jboss-deployment-structure.xml, with the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
    <deployment>
        <dependencies>
            <module name="org.jboss.ws.cxf.jbossws-cxf-client" services="import" />
            <module name="org.apache.cxf.impl">
                <imports>
                    <include path="META-INF"/>
                    <include path="META-INF/cxf"/>
                </imports>
            </module>
            <!-- ... -->
        </dependencies>
    </deployment>
</jboss-deployment-structure>

And I kept the scope "provided" in my pom.xm for CXF framework.

Your CXF libraries scope is <cxf.scope>provided</cxf.scope>. I am not sure if JBoss EAP 6 is embedding CXF-jaxrs (the REST part of CXF - you should inspect the jboss version of CXF 2.4.x-redhat-1). I think it uses Rest Easy instead. So it will not find org/apache/cxf/jaxws/JaxWsProxyFactoryBean.

Change the scope of cxf-rt-frontend-jaxws from provided to compile.

See https://access.redhat.com/site/articles/112673 to get the list of all embedded libs inside Jboss EAP 6.x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!