Hi please replace the jaxrs import only with
<import resource="*classpath:META-INF/cxf/cxf-extension-jaxws.xml*" /> and have xmlns:jaxws="*http://cxf.apache.org/jaxws*" added to the beans element then add <jaxws:endpoint implementor="*#myResource*" address="*/soap*" /> It may be to do with multilpe Spring libraries interfering with each other, looks like the JAXRS NamespaceHandler implements the Spring interface loaded by CL1 and Spring which handles this config is loaded by CL2 - just a theory - adding jaxws:endpoint can confirm/deny this idea Sergey On Fri, Apr 15, 2011 at 3:41 PM, Matt Shostak <[email protected]>wrote: > I have jaxrs references in my cxf-beans.xml file, that look like this: > > > > <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"/> > > … > > > > <jaxrs:server id="myContainer" address="/"> > > <jaxrs:serviceBeans> > > <ref bean="myResource"/> > > </jaxrs:serviceBeans> > > <jaxrs:providers> > > <!-- Object Providers --> > > > > <!-- Exception Providers --> > > <ref bean="myExceptionProvider" /> > > > > <!-- JSP Forwarding Providers --> > > <ref bean="provider1" /> > > … > > <ref bean="provider4" /> > > </jaxrs:providers> > > </jaxrs:server> > > > > I’ve never had a jaxws endpoint, so I’ve never had one initialized. This > is just REST I’m dealing with. Are you saying that I should change my > cxf-beans.xml file to remove the jaxrs element and replace it with a jaxws > element? If so, what should the new jaxws element of my cxf-beans.xml look > like? > > > > Thanks, > > > > Matt > > > > > > *From:* Sergey Beryozkin [mailto:[email protected]] > *Sent:* Friday, April 15, 2011 9:32 AM > > *To:* Matt Shostak > *Cc:* [email protected] > *Subject:* Re: cxf 2.3.1 and JBoss 6 problem > > > > Hi, does the issue persists even after you remove all the references to > jaxrs: from the beans.xml, do you have jaxws endpoint initailized ? > > > > Sergey > > On Fri, Apr 15, 2011 at 3:27 PM, Matt Shostak <[email protected]> > wrote: > > Thanks Sergey. > > > > In Jboss 6 Final, there are cxf*.jar files located in common/lib and > client. There are also several jbossws-cxf*.jar files in a few deployer > directories. I had only been putting cxf-rt-frontend-jaxrs.jar in > common/lib but now I’ve placed it client as well. And the imports are back > in my cxf-beans.xml. I then tried running Jboss, but it got a failure > because it couldn’t find Spring’s ApplicationContextListener. So I added > the Spring jars that are in my .war to the common/lib area, and tried > again. This time I got this error, which is pretty much what I’ve been > seeing in my previous attempts throughout this ordeal: > > > > org.springframework.beans.factory.BeanDefinitionStoreException: > > Unexpected exception parsing XML document from ServletContext resource > [/WEB-INF/cxf-beans.xml]; > > nested exception is org.springframework.beans.FatalBeanException: > > Class [org.apache.cxf.jaxrs.spring.NamespaceHandler] for namespace [ > http://cxf.apache.org/jaxrs] > > does not implement the > [org.springframework.beans.factory.xml.NamespaceHandler] interface > > at > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412) > > > > After this failure I put the Spring jars in the same places as the cxf > jars, and got the same failure again. > > To me, it appears from this message that there’s some sort of mismatch > between the cxf version and the spring version. I have cxf 2.3.1 and > Spring 3.0.5. I haven’t found anything in the cxf documentation telling me > one way or another which version of Spring I can use. > > > > Still looking for ideas… > > > > Thanks, > > > > Matt > > > > > > > > > > > > *From:* Sergey Beryozkin [mailto:[email protected]] > *Sent:* Friday, April 15, 2011 3:41 AM > *To:* Matt Shostak > *Cc:* [email protected] > > > *Subject:* Re: cxf 2.3.1 and JBoss 6 problem > > > > Hi Matt > > Alessio provided the info but I just misled you as I got confused :). With > CXF 2.3.1 the import is needed, in 2.4.0 it is not required. Now the > question is how to have this import resolved. I referred to common/lib, but > I guess you need to put the cxf-rt-frontend-jaxrs.jar only to the folder > where other CXF libraries are located - I don't recall the locations, it is > probably where the deployers are configured, probably in /server. Hopefully > that can fix it. > RestEasy also supports Spring integration but I'm not sure how that can be > used alongside the cxf configuration. You may want to explore that path too > if adding the jaxrs frontend to other cxf libs won't help. > > Cheers, Sergey > > On Thu, Apr 14, 2011 at 9:13 PM, Matt Shostak <[email protected]> > wrote: > > > > Thanks for the info Sergey. Yes, it is indeed a jaxrs problem, not a jaxws > problem. I tried your suggestions. I removed this line > > > > <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml"/> > > > > from my cxf-beans.xml. I also made sure my .war file contains no cxf > jars. I started with a fresh Jboss 6 installation and copied > cxf-bundle-jaxrs-2.3.1.jar and cxf-rt-frontend-jaxrs-2.3.1.jar into > common/lib, and also copied my spring*.jar files into common/lib, but I > still get this error when I start Jboss: > > > > org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected > exception parsing XML document from ServletContext resource > [/WEB-INF/cxf-beans.xml]; nested exception is > org.springframework.beans.FatalBeanException: > > Class [org.apache.cxf.jaxrs.spring.NamespaceHandler] for namespace [ > http://cxf.apache.org/jaxrs] does not implement the > [org.springframework.beans.factory.xml.NamespaceHandler] interface > > at > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412) > > … > > > > > > Any ideas? > > > > Thanks, > > > > Matt > > > > > > > > *From:* Sergey Beryozkin [mailto:[email protected]] > *Sent:* Thursday, April 14, 2011 5:58 AM > *To:* [email protected] > *Cc:* Alessio Soldano; Matt Shostak > *Subject:* Re: cxf 2.3.1 and JBoss 6 problem > > > > Hi > > Haven't seen it was about the problem with CXF JAX-RS imports. > Yes, remove that import, and if you'd like to use CXF JAX-RS then you'll > probably need to copy cxf jaxrs bundle or frontend only to the common lib > area > > Cheers, Sergey > > On Thu, Apr 14, 2011 at 11:45 AM, Alessio Soldano <[email protected]> > wrote: > > 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 > > > > > -- > Sergey Beryozkin > > Application Integration Division of Talend <http://www.talend.com/> > http://sberyozkin.blogspot.com > > > > > > > > >
