Woodstox

Failure under JDK1.6

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

Exception using latest 3.2.1 jar under JDK1.6 - When running Axis2 build harness

java.lang.IllegalArgumentException: Can not instantiate StAX reader for XML source type class javax.xml.transform.stax.StAXSource (unrecognized type)
at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:751)
at com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:341)
at org.apache.axis2.jaxws.dispatch.StreamSourceDispatch.testAsyncPollingPayloadMode(StreamSourceDispatch.java:240)

thanks,
dims

Activity

Hide
Tatu Saloranta added a comment -

Hmmh. This probably can only be resolved if StAXSource can be added to stax api jar. Otherwise it would be a JDK 1.6 dependency, and Woodstox aims to be 1.4 compatible at least for now (version 4.0).

I will send an email to stax-builders list to see how people feel about StAXSource being added (if that's feasible and desirable).

But on the other hand, even if possible, would such an operation even make sense? If one has StaxSource, it already implies a reader of some kind is available. Is this to be able to create an event reader for given stream reader?

Show
Tatu Saloranta added a comment - Hmmh. This probably can only be resolved if StAXSource can be added to stax api jar. Otherwise it would be a JDK 1.6 dependency, and Woodstox aims to be 1.4 compatible at least for now (version 4.0). I will send an email to stax-builders list to see how people feel about StAXSource being added (if that's feasible and desirable). But on the other hand, even if possible, would such an operation even make sense? If one has StaxSource, it already implies a reader of some kind is available. Is this to be able to create an event reader for given stream reader?
Hide
Davanum Srinivas added a comment -

Thanks Tatu, Am still looking at the usage of this. Please see the following class
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/SourceBlockImpl.java?annotate=556817&pathrev=556817

I had to add a check for woodstox to disable the "feature". I believe StaxSource can "hold" either a XMLStreamReader or a XMLEventReader, so in WstxInputFactory.createXMLStreamReader, we will have to convert from XMLEventReader to XMLStreamReader either by serializing and re-reading or by some code similar to what is in StaxUtils project.

I believe the spring team also ran into this issue:
http://opensource.atlassian.com/projects/spring/browse/SWS-99#action_23022

thanks,
dims

Show
Davanum Srinivas added a comment - Thanks Tatu, Am still looking at the usage of this. Please see the following class http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/SourceBlockImpl.java?annotate=556817&pathrev=556817 I had to add a check for woodstox to disable the "feature". I believe StaxSource can "hold" either a XMLStreamReader or a XMLEventReader, so in WstxInputFactory.createXMLStreamReader, we will have to convert from XMLEventReader to XMLStreamReader either by serializing and re-reading or by some code similar to what is in StaxUtils project. I believe the spring team also ran into this issue: http://opensource.atlassian.com/projects/spring/browse/SWS-99#action_23022 thanks, dims
Hide
Santiago Pericas-Geertsen added a comment -

This is interesting. As Tatu says, StAXSouce is available only since JAXP 1.4/JDK 6. Honestly, since most StAX implementations pre-date this version of JAXP, I doubt any would handle this case correctly (I don't think SJSXP does it either). For compatibility's sake, I would consider modifying Axis2 not to use that factory method, especially when it is marked as optional in the javadoc.

Show
Santiago Pericas-Geertsen added a comment - This is interesting. As Tatu says, StAXSouce is available only since JAXP 1.4/JDK 6. Honestly, since most StAX implementations pre-date this version of JAXP, I doubt any would handle this case correctly (I don't think SJSXP does it either). For compatibility's sake, I would consider modifying Axis2 not to use that factory method, especially when it is marked as optional in the javadoc.
Hide
Tatu Saloranta added a comment -

Support for StaxSource can be added when either Woodstox baseline JDK requirement becomes 1.6, or if Stax api jar was to include StaxSource.

Show
Tatu Saloranta added a comment - Support for StaxSource can be added when either Woodstox baseline JDK requirement becomes 1.6, or if Stax api jar was to include StaxSource.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: