Hello,
I am trying to use the new CXF connector (currently housed under MuleForge), and specifically trying to utilize the WS-Addressing features of CXF in order to do asynchronous web service calls (into mule-managed components). The problem I'm having is that Mule/Spring dies when trying to load the CXF configuration file that enables ws-addressing. As per the cookbook example (http://mule.mulesource.org/display/CXF/WS-Addressing), I'm able to point the cxf connector to use my config file below:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:c="http://cxf.apache.org/core"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsa="http://cxf.apache.org/ws/addressing"
xmlns:http="http://cxf.apache.org/transports/http/configuration"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/ws/addressing http://cxf.apache.org/schemas/ws/addressing.xsd
http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd">
<jaxws:server name="{http://my.example.org/}MyExamplePort" createdFromAPI="true">
<jaxws:features>
<wsa:addressing usingAddressingAdvisory="true"/>
</jaxws:features>
</jaxws:server>
<jaxws:client name="{http://my.example.org/}MyExamplePort" createdFromAPI="true">
<jaxws:features>
<wsa:addressing usingAddressingAdvisory="true"/>
</jaxws:features>
</jaxws:client>
</beans>
HOWEVER, this is where everything dies. I get an exception stating that the NamespaceHandler cannot be found for the ws-addressing namespace.
2008-02-11 19:54:54,043 INFO [MuleManager] Creating new MuleManager instance
2008-02-11 19:54:54,395 INFO [CxfConnector] Initialising: CxfConnector{this=5ee6a6, started=false, initialised=false, name='cxf', disposed=false, numberOfConcurrentTransactedReceivers=4, createMultipleTransactedReceivers=true, connected=false, supportedProtocols=[cxf, cxf:http, cxf:https, cxf:jms, cxf:vm, cxf:servlet], serviceOverrides=null}
2008-02-11 19:54:54,527 INFO [BusApplicationContext] Refreshing org.apache.cxf.bus.spring.BusApplicationContext@e4d37f: display name [org.apache.cxf.bus.spring.BusApplicationContext@e4d37f]; startup date [Mon Feb 11 19:54:54 PST 2008]; root of context hierarchy
2008-02-11 19:54:54,736 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml]
2008-02-11 19:54:54,893 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-soap.xml]
2008-02-11 19:54:54,936 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-xml.xml]
2008-02-11 19:54:54,967 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-local.xml]
2008-02-11 19:54:54,998 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-http.xml]
2008-02-11 19:54:55,032 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [cxf/mif-cxf-config.xml]
Feb 11, 2008 7:54:55 PM org.apache.cxf.bus.spring.SpringBusFactory createBus
WARNING: Failed to create application context.
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate NamespaceHandler for namespace [http://cxf.apache.org/ws/addressing]
Offending resource: class path resource [cxf/mif-cxf-config.xml]
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:261)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1111)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseNestedCustomElement(BeanDefinitionParserDelegate.java:1152)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parsePropertySubElement(BeanDefinitionParserDelegate.java:781)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseListElement(BeanDefinitionParserDelegate.java:903)
at org.apache.cxf.frontend.spring.ServerFactoryBeanDefinitionParser.mapElement(ServerFactoryBeanDefinitionParser.java:70)
at org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser.parseChildElements(AbstractBeanDefinitionParser.java:106)
at org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser.doParse(AbstractBeanDefinitionParser.java:56)
After many hours of searching the forums this seems to be due to the fact that there is no http://cxf.apache.org/ws/addressing/addressing.xsd file accessible via the internet. I've seen some references to Spring.schemas and have tried putting such a file on my classpath, but I get the same exceptions. I've also tried moving the .xsd files on my classpath, but again no luck. Admittedly, I'm a newbie with CXF and Spring so I fear I'm missing something fairly obvious.
Basic environment is:
- Mule 1.4.4 (snapshot)
- Java 5
- Trying to run this inside Eclipse 3.3
- Using Maven 2.0.8 to manage builds/dependencies
Any help would be greatly appreciated.
Thanks in advance,
Justin Almquist
Pacific Northwest National Laboratory
Research Scientist
Data-Centric Information Management
(509) 372-4525
justin....@pnl.gov
-- Dan Diephouse MuleSource http://mulesource.com | http://netzooid.com/blog
Hi Justin,
Any chance you could try this with the 1.0-M3-SNAPSHOT I posted recently for the mule cxf transport? It uses the latest version of CXF 2.0.4 and I'm thinking that may fix your problem.
Maven snapshot repository information should be here: http://www.mulesource.org/display/CXF/Setting+up+your+build+and+classpath
Please let us know if that helps!
- Dan
Almquist, Justin P wrote:
CXF WS-Addressing Schema Problems
Hello,
I am trying to use the new CXF connector (currently housed under MuleForge), and specifically trying to utilize the WS-Addressing features of CXF in order to do asynchronous web service calls (into mule-managed components). The problem I'm having is that Mule/Spring dies when trying to load the CXF configuration file that enables ws-addressing. As per the cookbook example (http://mule.mulesource.org/display/CXF/WS-Addressing <http://mule.mulesource.org/display/CXF/WS-Addressing> ), I'm able to point the cxf connector to use my config file below:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:c="http://cxf.apache.org/core"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsa="http://cxf.apache.org/ws/addressing"
xmlns:http="http://cxf.apache.org/transports/http/configuration"
xsi:schemaLocation="
http://www.springframework.org/schema/beans <http://www.springframework.org/schema/beans> http://www.springframework.org/schema/beans/spring-beans.xsd <http://www.springframework.org/schema/beans/spring-beans.xsd>
http://cxf.apache.org/core <http://cxf.apache.org/core> http://cxf.apache.org/schemas/core.xsd <http://cxf.apache.org/schemas/core.xsd>
http://cxf.apache.org/jaxws <http://cxf.apache.org/jaxws> http://cxf.apache.org/schemas/jaxws.xsd <http://cxf.apache.org/schemas/jaxws.xsd>
http://cxf.apache.org/ws/addressing <http://cxf.apache.org/ws/addressing> http://cxf.apache.org/schemas/ws/addressing.xsd <http://cxf.apache.org/schemas/ws/addressing.xsd>
http://cxf.apache.org/transports/http/configuration <http://cxf.apache.org/transports/http/configuration> http://cxf.apache.org/schemas/configuration/http-conf.xsd <http://cxf.apache.org/schemas/configuration/http-conf.xsd> ">
<jaxws:server name="{http://my.example.org/}MyExamplePort" createdFromAPI="true">
<jaxws:features>
<wsa:addressing usingAddressingAdvisory="true"/>
</jaxws:features>
</jaxws:server>
<jaxws:client name="{http://my.example.org/}MyExamplePort" createdFromAPI="true">
<jaxws:features>
<wsa:addressing usingAddressingAdvisory="true"/>
</jaxws:features>
</jaxws:client>
</beans>
HOWEVER, this is where everything dies. I get an exception stating that the NamespaceHandler cannot be found for the ws-addressing namespace.
2008-02-11 19:54:54,043 INFO [MuleManager] Creating new MuleManager instance
2008-02-11 19:54:54,395 INFO [CxfConnector] Initialising: CxfConnector{this=5ee6a6, started=false, initialised=false, name='cxf', disposed=false, numberOfConcurrentTransactedReceivers=4, createMultipleTransactedReceivers=true, connected=false, supportedProtocols=[cxf, cxf:http, cxf:https, cxf:jms, cxf:vm, cxf:servlet], serviceOverrides=null}
2008-02-11 19:54:54,527 INFO [BusApplicationContext] Refreshing org.apache.cxf.bus.spring.BusApplicationContext@e4d37f: display name [org.apache.cxf.bus.spring.BusApplicationContext@e4d37f]; startup date [Mon Feb 11 19:54:54 PST 2008]; root of context hierarchy
2008-02-11 19:54:54,736 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml]
2008-02-11 19:54:54,893 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-soap.xml]
2008-02-11 19:54:54,936 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-xml.xml]
2008-02-11 19:54:54,967 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-local.xml]
2008-02-11 19:54:54,998 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-http.xml]
2008-02-11 19:54:55,032 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [cxf/mif-cxf-config.xml]
Feb 11, 2008 7:54:55 PM org.apache.cxf.bus.spring.SpringBusFactory createBus
WARNING: Failed to create application context.
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate NamespaceHandler for namespace [http://cxf.apache.org/ws/addressing <http://cxf.apache.org/ws/addressing> ]
Offending resource: class path resource [cxf/mif-cxf-config.xml]
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:261)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1111)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseNestedCustomElement(BeanDefinitionParserDelegate.java:1152)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parsePropertySubElement(BeanDefinitionParserDelegate.java:781)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseListElement(BeanDefinitionParserDelegate.java:903)
at org.apache.cxf.frontend.spring.ServerFactoryBeanDefinitionParser.mapElement(ServerFactoryBeanDefinitionParser.java:70)
at org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser.parseChildElements(AbstractBeanDefinitionParser.java:106)
at org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser.doParse(AbstractBeanDefinitionParser.java:56)
After many hours of searching the forums this seems to be due to the fact that there is no http://cxf.apache.org/ws/addressing/addressing.xsd <http://cxf.apache.org/ws/addressing/addressing.xsd> file accessible via the internet. I've seen some references to Spring.schemas and have tried putting such a file on my classpath, but I get the same exceptions. I've also tried moving the .xsd files on my classpath, but again no luck. Admittedly, I'm a newbie with CXF and Spring so I fear I'm missing something fairly obvious.
-- Dan Diephouse MuleSource http://mulesource.com | http://netzooid.com/blog