JBoss AS 6 includes JBossWS-CXF by default, which internally used Apache CXF for jaxws functionalities.
The jax-rs libs of CXF are not pulled in because of RestEasy.
You're right in not including the cxf libs in your deployment; please take a look at the jbossws-cxf documentation regarding how to setup your endpoint using the spring configuration: http://community.jboss.org/wiki/JBossWS-StackCXFUserGuide#Server_Side_Integration_Customization . In particular, make sure Spring is installed on your JBoss AS, you should not need those imports in the beans file and check your web.xml (again see the documentation, http://community.jboss.org/docs/DOC-13972#Web_Service_Endpoints)

An alternative is to install JBossWS-Native to JBoss AS 6 and go on using your app the way it is.
Cheers
Alessio

On 04/13/2011 10:02 PM, Matt Shostak wrote:
Hi,

I'm trying to deploy my .war file on Jboss 6.  It works on Jboss 5.1.0.  I was 
building with CXF 2.2.10 and Spring 3.0.1.  Since Jboss 6 uses CXF 2.3.1, I 
changed the build to use CXF 2.3.1 and Spring 3.0.5.  I've also set it so that 
none of the CXF jars are included in my .war.  When I put my new .war file in 
server/default/deploy and start Jboss, I get this error:

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: 
Configuration problem: Failed to import bean definitions from URL location 
[classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml]
Offending resource: ServletContext resource [/WEB-INF/cxf-beans.xml]; nested 
exception is org.springframework.beans.factory.BeanDefinitionStoreException: 
IOException parsing XML document from class path resource 
[META-INF/cxf/cxf-extension-jaxrs-binding.xml]; nested exception is 
java.io.FileNotFoundException: class path resource 
[META-INF/cxf/cxf-extension-jaxrs-binding.xml] cannot be opened because it does 
not exist
                 at 
org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)


The cxf-extension-jaxrs-binding.xml used to be found in 
cxf-bundle-jaxrs-2.2.10.jar back when I was building with 2.2.10 for Jboss 
5.1.0.  Now for Jboss 6, however, that xml file does not exist among the 
cxf*.jar files in common/lib.  My cxf-beans.xml file has the following:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xmlns:jaxrs="http://cxf.apache.org/jaxrs";
        xmlns:context="http://www.springframework.org/schema/context";
        xmlns:jaxws="http://cxf.apache.org/jaxws";

        xsi:schemaLocation="
        http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd
        http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
        http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context.xsd";>

     <import resource="classpath:META-INF/cxf/cxf.xml"/>
     <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml"/>
     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
     <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>

Obviously cxf-extension-jaxrs-binding.xml is now a problem, but if I simply 
remove that line from cxf-beans.xml I get a new error:

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: 
Configuration problem: Unable to locate Spring NamespaceHandler for XML schema 
namespace [http://cxf.apache.org/jaxrs]
Offending resource: ServletContext resource [/WEB-INF/cxf-beans.xml]

So can anyone tell me how exactly am I supposed to refer to these cxf*.xml 
files in my cxf-beans.xml?  Any help would be greatly appreciated.

Thanks,

Matt




--
Alessio Soldano
Web Service Lead, JBoss

Reply via email to