You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Jonathan Whitall (JIRA)" <ji...@apache.org> on 2010/04/01 05:04:27 UTC

[jira] Created: (CXF-2749) org.apache.cxf.configuration.spring.JAXBBeanFactory cannot handle elements with namespace prefixes

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.


[jira] Commented: (CXF-2749) org.apache.cxf.configuration.spring.JAXBBeanFactory cannot handle elements with namespace prefixes

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852669#action_12852669 ] 

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



Can you test this with CXF 2.2.7?   I think this is actually fixed.   In anycase, I cannot reproduce it with 2.2.6 or 2.2.7 using the sun stax stuff built into the JDK.    Any chance you can create a small testcase outside of WebSphere (since I don't have WebSphere)?

> 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.


[jira] Commented: (CXF-2749) org.apache.cxf.configuration.spring.JAXBBeanFactory cannot handle elements with namespace prefixes

Posted by "Jonathan Whitall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852487#action_12852487 ] 

Jonathan Whitall commented on CXF-2749:
---------------------------------------

I wish I could use Woodstox, however I am running CXF on WebSphere 6.1. I get into some pretty serious class loading issues because of some of the classes that are bundled within WebSphere seem to load pieces of the Sun implementation, expecting that the rest of the implementation be there. While I have Woodstox on my classpath, I have only recently figured out that it's not being used.

Do you know if there is a way to have more than one StAX implementation on the classpath and direct CXF to use the Woodstox one?

> 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.


[jira] Commented: (CXF-2749) org.apache.cxf.configuration.spring.JAXBBeanFactory cannot handle elements with namespace prefixes

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ 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.