[ 
https://issues.apache.org/jira/browse/CXF-2749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852406#action_12852406
 ] 

Daniel Kulp commented on CXF-2749:
----------------------------------


The better workaround would be just use woodstox.   Woodstox is MUCH faster 
than Sun's implementation and thus, having woodstox available would help the 
performance of all the XML processing that CXF does (which is a lot).   See:

http://fusesource.com/issues/browse/SF-243

for some benchmarks I did.

That said, this is a bug that needs fixing.

> org.apache.cxf.configuration.spring.JAXBBeanFactory cannot handle elements 
> with namespace prefixes
> --------------------------------------------------------------------------------------------------
>
>                 Key: CXF-2749
>                 URL: https://issues.apache.org/jira/browse/CXF-2749
>             Project: CXF
>          Issue Type: Bug
>          Components: Configuration, Transports
>    Affects Versions: 2.2.6
>         Environment: Only when used with Sun StAX implementation 1.4.2; does 
> not seem to happen with Woodstox
>            Reporter: Jonathan Whitall
>            Priority: Minor
>
> I first noticed this when attempting to define the http:conduit element in a 
> Spring config file:
> <beans:beans xmlns:http="http://cxf.apache.org/transports/http/configuration";
>       xmlns:beans="http://www.springframework.org/schema/beans"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>       xsi:schemaLocation=" 
>           http://www.springframework.org/schema/beans           
> http://www.springframework.org/schema/beans/spring-beans.xsd
>           http://cxf.apache.org/transports/http/configuration   
> http://cxf.apache.org/schemas/configuration/http-conf.xsd
>           ">
>       <http:conduit name="*.http-conduit">
>               <http:client ConnectionTimeout="30000" ReceiveTimeout="120000" 
> />
>       </http:conduit>
> </beans:beans>
> It always fails with the following exception:
> Caused by: javax.xml.bind.UnmarshalException
>  - with linked exception:
> [javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,198]
> Message: 
> http://www.w3.org/TR/1999/REC-xml-names-19990114#ElementPrefixUnbound?http&http:client]
>       at 
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:426)
>       at 
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:362)
>       at 
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:339)
>       at 
> org.apache.cxf.configuration.spring.JAXBBeanFactory.createJAXBBean(JAXBBeanFactory.java:51)
>       ... 124 more
> Caused by: javax.xml.stream.XMLStreamException: ParseError at 
> [row,col]:[1,198]
> Message: 
> http://www.w3.org/TR/1999/REC-xml-names-19990114#ElementPrefixUnbound?http&http:client
>       at 
> com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:593)
>       at 
> com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:160)
>       at 
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:360)
>       ... 126 more
> Looking at the source code, it appears that CXF is sending the body contents 
> of http:conduit verbatim to JAXBBeanFactory for parsing into a JAXB object. 
> Apparently, Woodstox doesn't care if there is an unregistered namespace 
> prefix, but the Sun StAX implementation does and throws the exception.
> My current workaround is to define the http:conduit element in a separate XML 
> file and use it as the default namespace like this:
> <beans:beans xmlns="http://cxf.apache.org/transports/http/configuration";
>       xmlns:beans="http://www.springframework.org/schema/beans"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>       xsi:schemaLocation=" 
>           http://www.springframework.org/schema/beans           
> http://www.springframework.org/schema/beans/spring-beans.xsd
>           http://cxf.apache.org/transports/http/configuration   
> http://cxf.apache.org/schemas/configuration/http-conf.xsd
>           ">
>       <conduit name="*.http-conduit">
>               <client ConnectionTimeout="30000" ReceiveTimeout="120000" />
>       </conduit>
> </beans:beans>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to