You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Matt Shostak <ms...@potomacfusion.com> on 2011/04/13 22:02:34 UTC
cxf 2.3.1 and JBoss 6 problem
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
RE: cxf 2.3.1 and JBoss 6 problem
Posted by Matt Shostak <ms...@potomacfusion.com>.
Yes. The phrase "jaxrs" does not appear anywhere in my cxf-beans.xml file any more, and this is the result, which looks like the same error to me:
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.jaxws.spring.NamespaceHandler]
for namespace [http://cxf.apache.org/jaxws] does not implement the [org.springframework.beans.factory.xml.NamespaceHandler] interface
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
Matt
From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
Sent: Friday, April 15, 2011 10:15 AM
To: Matt Shostak
Cc: users@cxf.apache.org
Subject: Re: cxf 2.3.1 and JBoss 6 problem
What about JAXWS ? Have you removed all the references to jaxrs namespace from the beans.xml ?
Sergey
On Fri, Apr 15, 2011 at 4:13 PM, Matt Shostak <ms...@potomacfusion.com>> wrote:
Same error after making the recommended changes:
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)
Matt
From: Sergey Beryozkin [mailto:sberyozkin@gmail.com<ma...@gmail.com>]
Sent: Friday, April 15, 2011 9:52 AM
To: Matt Shostak
Cc: users@cxf.apache.org<ma...@cxf.apache.org>
Subject: Re: cxf 2.3.1 and JBoss 6 problem
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 <ms...@potomacfusion.com>> 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:sberyozkin@gmail.com<ma...@gmail.com>]
Sent: Friday, April 15, 2011 9:32 AM
To: Matt Shostak
Cc: users@cxf.apache.org<ma...@cxf.apache.org>
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 <ms...@potomacfusion.com>> 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:sberyozkin@gmail.com<ma...@gmail.com>]
Sent: Friday, April 15, 2011 3:41 AM
To: Matt Shostak
Cc: users@cxf.apache.org<ma...@cxf.apache.org>
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 <ms...@potomacfusion.com>> 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:sberyozkin@gmail.com<ma...@gmail.com>]
Sent: Thursday, April 14, 2011 5:58 AM
To: users@cxf.apache.org<ma...@cxf.apache.org>
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 <as...@redhat.com>> 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<http://sberyozkin.blogspot.com/>
--
Sergey Beryozkin
Application Integration Division of Talend<http://www.talend.com/>
http://sberyozkin.blogspot.com<http://sberyozkin.blogspot.com/>
Re: cxf 2.3.1 and JBoss 6 problem
Posted by Sergey Beryozkin <sb...@gmail.com>.
What about JAXWS ? Have you removed all the references to jaxrs namespace
from the beans.xml ?
Sergey
On Fri, Apr 15, 2011 at 4:13 PM, Matt Shostak <ms...@potomacfusion.com>wrote:
> Same error after making the recommended changes:
>
>
>
> 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)
>
>
>
> Matt
>
>
>
>
>
> *From:* Sergey Beryozkin [mailto:sberyozkin@gmail.com]
> *Sent:* Friday, April 15, 2011 9:52 AM
>
> *To:* Matt Shostak
> *Cc:* users@cxf.apache.org
> *Subject:* Re: cxf 2.3.1 and JBoss 6 problem
>
>
>
> 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 <ms...@potomacfusion.com>
> 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:sberyozkin@gmail.com]
> *Sent:* Friday, April 15, 2011 9:32 AM
>
>
> *To:* Matt Shostak
> *Cc:* users@cxf.apache.org
> *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 <ms...@potomacfusion.com>
> 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:sberyozkin@gmail.com]
> *Sent:* Friday, April 15, 2011 3:41 AM
> *To:* Matt Shostak
> *Cc:* users@cxf.apache.org
>
>
> *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 <ms...@potomacfusion.com>
> 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:sberyozkin@gmail.com]
> *Sent:* Thursday, April 14, 2011 5:58 AM
> *To:* users@cxf.apache.org
> *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 <as...@redhat.com>
> 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
>
>
>
>
>
>
>
>
>
--
Sergey Beryozkin
Application Integration Division of Talend <http://www.talend.com/>
http://sberyozkin.blogspot.com
RE: cxf 2.3.1 and JBoss 6 problem
Posted by Matt Shostak <ms...@potomacfusion.com>.
Same error after making the recommended changes:
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)
Matt
From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
Sent: Friday, April 15, 2011 9:52 AM
To: Matt Shostak
Cc: users@cxf.apache.org
Subject: Re: cxf 2.3.1 and JBoss 6 problem
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 <ms...@potomacfusion.com>> 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:sberyozkin@gmail.com<ma...@gmail.com>]
Sent: Friday, April 15, 2011 9:32 AM
To: Matt Shostak
Cc: users@cxf.apache.org<ma...@cxf.apache.org>
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 <ms...@potomacfusion.com>> 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:sberyozkin@gmail.com<ma...@gmail.com>]
Sent: Friday, April 15, 2011 3:41 AM
To: Matt Shostak
Cc: users@cxf.apache.org<ma...@cxf.apache.org>
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 <ms...@potomacfusion.com>> 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:sberyozkin@gmail.com<ma...@gmail.com>]
Sent: Thursday, April 14, 2011 5:58 AM
To: users@cxf.apache.org<ma...@cxf.apache.org>
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 <as...@redhat.com>> 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<http://sberyozkin.blogspot.com/>
Re: cxf 2.3.1 and JBoss 6 problem
Posted by Sergey Beryozkin <sb...@gmail.com>.
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 <ms...@potomacfusion.com>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:sberyozkin@gmail.com]
> *Sent:* Friday, April 15, 2011 9:32 AM
>
> *To:* Matt Shostak
> *Cc:* users@cxf.apache.org
> *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 <ms...@potomacfusion.com>
> 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:sberyozkin@gmail.com]
> *Sent:* Friday, April 15, 2011 3:41 AM
> *To:* Matt Shostak
> *Cc:* users@cxf.apache.org
>
>
> *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 <ms...@potomacfusion.com>
> 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:sberyozkin@gmail.com]
> *Sent:* Thursday, April 14, 2011 5:58 AM
> *To:* users@cxf.apache.org
> *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 <as...@redhat.com>
> 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
>
>
>
>
>
>
>
>
>
Re: cxf 2.3.1 and JBoss 6 problem
Posted by commissarmatt <ms...@gmail.com>.
Thanks Sergey, I'll try that with the Spring jars.
--
View this message in context: http://cxf.547215.n5.nabble.com/cxf-2-3-1-and-JBoss-6-problem-tp4301547p4328572.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: cxf 2.3.1 and JBoss 6 problem
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On Mon, Apr 18, 2011 at 2:44 PM, commissarmatt <ms...@gmail.com> wrote:
> I copy them manually. As far as I can tell, the only Spring jars under my
> JBoss installation are the ones I put there myself. There are several CXF
> jars that come with the JBoss installation, though.
>
I'm not sure how can I help, there's obviously some class loading
issue that you are seeing, given that both JAX-WS and JAX-RS endpoints
can not be started.
I'd go and try experimenting with copying Spring libs to different
locations and see what helps. So at the moment you copy them to
common/lib, may be you can try copying them to the client folder, or
to WEB-INF/lib.
Let us know please if you can get past this issue
Cheers, Sergey
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/cxf-2-3-1-and-JBoss-6-problem-tp4301547p4310775.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
--
Sergey Beryozkin
Application Integration Division of Talend
http://sberyozkin.blogspot.com
Re: cxf 2.3.1 and JBoss 6 problem
Posted by commissarmatt <ms...@gmail.com>.
I copy them manually. As far as I can tell, the only Spring jars under my
JBoss installation are the ones I put there myself. There are several CXF
jars that come with the JBoss installation, though.
--
View this message in context: http://cxf.547215.n5.nabble.com/cxf-2-3-1-and-JBoss-6-problem-tp4301547p4310775.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: cxf 2.3.1 and JBoss 6 problem
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Matt
Have you downloaded JBoss with CXF already setup as the default stack ? It
is strange that this Spring issue is happening when JAX-WS endpoints get
deployed. Do you copy Spring libs manually or are they contained in latest
JBoss 6 distributions ?
Cheers, Sergey
On Fri, Apr 15, 2011 at 6:53 PM, commissarmatt <ms...@gmail.com>wrote:
> That's what I thought, Alessio. But it appears to me that the only Spring
> jars on the JBoss server are the ones I put there to test this out.
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/cxf-2-3-1-and-JBoss-6-problem-tp4301547p4306171.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
Re: cxf 2.3.1 and JBoss 6 problem
Posted by commissarmatt <ms...@gmail.com>.
That's what I thought, Alessio. But it appears to me that the only Spring
jars on the JBoss server are the ones I put there to test this out.
--
View this message in context: http://cxf.547215.n5.nabble.com/cxf-2-3-1-and-JBoss-6-problem-tp4301547p4306171.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: cxf 2.3.1 and JBoss 6 problem
Posted by Alessio Soldano <as...@redhat.com>.
On 04/15/2011 04:41 PM, Matt Shostak wrote:
> 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.
OK, what you've done here would have been my suggestion, ie. given
you're willing to use jaxrs only, you deploy a war whose web.xml
references the jaxrs cxf servlet. Given jboss 6 does not come with the
cxf-jaxrs libs, you add them, as well as the spring ones.
> 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.
As Sergey suggested, this seems like a classloader mismatch, given
org.apache.cxf.jaxrs.spring.NamespaceHandler extends
NamespaceHandlerSupport which implements that interface; perhaps you
have other Spring libraries on the server?
Alessio
--
Alessio Soldano
Web Service Lead, JBoss
RE: cxf 2.3.1 and JBoss 6 problem
Posted by Matt Shostak <ms...@potomacfusion.com>.
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:sberyozkin@gmail.com]
Sent: Friday, April 15, 2011 9:32 AM
To: Matt Shostak
Cc: users@cxf.apache.org
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 <ms...@potomacfusion.com>> 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:sberyozkin@gmail.com<ma...@gmail.com>]
Sent: Friday, April 15, 2011 3:41 AM
To: Matt Shostak
Cc: users@cxf.apache.org<ma...@cxf.apache.org>
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 <ms...@potomacfusion.com>> 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:sberyozkin@gmail.com<ma...@gmail.com>]
Sent: Thursday, April 14, 2011 5:58 AM
To: users@cxf.apache.org<ma...@cxf.apache.org>
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 <as...@redhat.com>> 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<http://sberyozkin.blogspot.com/>
--
Sergey Beryozkin
Application Integration Division of Talend<http://www.talend.com/>
http://sberyozkin.blogspot.com<http://sberyozkin.blogspot.com/>
Re: cxf 2.3.1 and JBoss 6 problem
Posted by Sergey Beryozkin <sb...@gmail.com>.
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 <ms...@potomacfusion.com>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:sberyozkin@gmail.com]
> *Sent:* Friday, April 15, 2011 3:41 AM
> *To:* Matt Shostak
> *Cc:* users@cxf.apache.org
>
> *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 <ms...@potomacfusion.com>
> 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:sberyozkin@gmail.com]
> *Sent:* Thursday, April 14, 2011 5:58 AM
> *To:* users@cxf.apache.org
> *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 <as...@redhat.com>
> 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
>
>
>
--
Sergey Beryozkin
Application Integration Division of Talend <http://www.talend.com/>
http://sberyozkin.blogspot.com
RE: cxf 2.3.1 and JBoss 6 problem
Posted by Matt Shostak <ms...@potomacfusion.com>.
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:sberyozkin@gmail.com]
Sent: Friday, April 15, 2011 3:41 AM
To: Matt Shostak
Cc: users@cxf.apache.org
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 <ms...@potomacfusion.com>> 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:sberyozkin@gmail.com<ma...@gmail.com>]
Sent: Thursday, April 14, 2011 5:58 AM
To: users@cxf.apache.org<ma...@cxf.apache.org>
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 <as...@redhat.com>> 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
Re: cxf 2.3.1 and JBoss 6 problem
Posted by Sergey Beryozkin <sb...@gmail.com>.
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 <ms...@potomacfusion.com>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:sberyozkin@gmail.com]
> *Sent:* Thursday, April 14, 2011 5:58 AM
> *To:* users@cxf.apache.org
> *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 <as...@redhat.com>
> 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
>
RE: cxf 2.3.1 and JBoss 6 problem
Posted by Matt Shostak <ms...@potomacfusion.com>.
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:sberyozkin@gmail.com]
Sent: Thursday, April 14, 2011 5:58 AM
To: users@cxf.apache.org
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 <as...@redhat.com>> 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
Re: cxf 2.3.1 and JBoss 6 problem
Posted by Sergey Beryozkin <sb...@gmail.com>.
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 <as...@redhat.com>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
Re: cxf 2.3.1 and JBoss 6 problem
Posted by Alessio Soldano <as...@redhat.com>.
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