You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2009/07/10 23:41:14 UTC

[jira] Created: (WSCOMMONS-489) StAXUtil incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

StAXUtil incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
------------------------------------------------------------------------------------------------

                 Key: WSCOMMONS-489
                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
             Project: WS-Commons
          Issue Type: Bug
          Components: AXIOM
    Affects Versions: Axiom 1.2.8
            Reporter: Andreas Veithen


StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].

[1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
[2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm


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


[jira] Commented: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Ben Reif (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796198#action_12796198 ] 

Ben Reif commented on WSCOMMONS-489:
------------------------------------

Andreas, 

Thanks for the quick reply. I guess technically nothing is preventing us from using the 1.2.9-SNAPSHOT. We are using Axis2 1.4 (which came with Axiom 1.2.7) and it's really more of a question of risk and how stable the Axiom1.2.9-SNAPSHOT is and also if it is compatible with Axis2 1.4. Would you be able to provide any feedback on this?

Thanks,
Ben

> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: Axiom 1.2.9
>
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Assigned: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen reassigned WSCOMMONS-489:
-----------------------------------------

    Assignee: Andreas Veithen

> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Commented: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12762408#action_12762408 ] 

Andreas Veithen commented on WSCOMMONS-489:
-------------------------------------------

1.6.0.5 is quite old. It could be that you are seeing the issue that the SJSXP project fixed in [1]. This issue implies that even after setting "reuse-instance" to false on the XMLOutputFactory, the factory is still not thread safe. I will see if I can find a 1.6.0.5 JDK somewhere to check this.

[1] https://sjsxp.dev.java.net/source/browse/sjsxp/zephyr/src/com/sun/xml/stream/ZephyrWriterFactory.java?rev=1.8&r1=1.4&r2=1.5

> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: Axiom 1.2.9
>
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Commented: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Ben Reif (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796687#action_12796687 ] 

Ben Reif commented on WSCOMMONS-489:
------------------------------------

Aside from down loading the jars and putting them in the classpath, do yo know how I go about changing out the StAX implementation? There isn't much on the Woodstox site. Is it just a VM system property that I set, or is there another file that I need to change to point to the Woodstox classes?

> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: Axiom 1.2.9
>
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Commented: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Ben Reif (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796700#action_12796700 ] 

Ben Reif commented on WSCOMMONS-489:
------------------------------------

Ok, I'll take a look. Thanks a lot for your help!

> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: Axiom 1.2.9
>
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Issue Comment Edited: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Ben Reif (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795611#action_12795611 ] 

Ben Reif edited comment on WSCOMMONS-489 at 12/31/09 4:35 PM:
--------------------------------------------------------------

Andreas, 

We are using Axiom 1.2.7 and wanted to patch in this fix. Can you let me know what changes that you made and how I can patch them in? If I go to the Subversion Commits tab, can I just put in the changes under revision #797814, or do I also need the ones from #823973 and #823978 as well?

Thanks

      was (Author: breif):
    Andreas, 

We are using Axiom 1.2.7 and wanted to patch in this fix. Can you let me know what changes that you made and how I can patch them in?

Thanks
  
> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: Axiom 1.2.9
>
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Commented: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Ben Reif (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795611#action_12795611 ] 

Ben Reif commented on WSCOMMONS-489:
------------------------------------

Andreas, 

We are using Axiom 1.2.7 and wanted to patch in this fix. Can you let me know what changes that you made and how I can patch them in?

Thanks

> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: Axiom 1.2.9
>
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Commented: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12764386#action_12764386 ] 

Andreas Veithen commented on WSCOMMONS-489:
-------------------------------------------

I noticed that the JRE on people.apache.org (1.6.0_07) has a version of SJSXP with the same issue. I have implemented a fix that detects this issue and applies a workaround.

> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: Axiom 1.2.9
>
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Commented: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12870293#action_12870293 ] 

Andreas Veithen commented on WSCOMMONS-489:
-------------------------------------------

Adding Woodstox to the classpath is sufficient. Anyway, for Axis2, it is highly recommended to use Woodstox.

> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: Axiom 1.2.9
>
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Commented: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761830#action_12761830 ] 

Andreas Veithen commented on WSCOMMONS-489:
-------------------------------------------

Axiom now has a mechanism that detects the StAX implementation and that (among other things) makes the factories thread safe. This however only works if it correctly detects the StAX "dialect", which is probably what fails in your case.

The test you mention is executed several times during the build: once in axiom-api and several times in axiom-parser-tests, using different StAX implementations. One execution of this test in axiom-parser-tests is against the StAX implementation that is part of the JRE (on Java >= 1.6). It is probably this execution that fails. Can you please provide the following additional information:

- The tests in axiom-parser-tests output several lines starting with "INFO: Detected StAX dialect". Can you please post these messages?
- What JRE (vendor and version) do you use? Do you know which StAX parser is shipped with that JRE?

> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: Axiom 1.2.9
>
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Commented: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Aaron McIver (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761722#action_12761722 ] 

Aaron McIver commented on WSCOMMONS-489:
----------------------------------------

I just pulled down the source...mvn install...

Failed tests:
  testCreateXMLStreamWriterIsThreadSafe(org.apache.axiom.om.util.StAXUtilsTest)

Which seems to have happened as recent as September...is this really fixed?


> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: Axiom 1.2.9
>
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Resolved: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen resolved WSCOMMONS-489.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: Axiom 1.2.9

> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: Axiom 1.2.9
>
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Commented: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Jeff Hoffman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12869810#action_12869810 ] 

Jeff Hoffman commented on WSCOMMONS-489:
----------------------------------------

Hello Andreas,

I am so glad to finally find this thread--have been searching for Axis2 1.5.1 concurrency issues for a while now and struggling to solve a nagging issue in my application.  I'm pretty confident this is the answer, so thank you!

My question:  do I need to use 1.2.9-SNAPSHOT to get this fix, or will Woodstox with 1.2.8 solve it?

Thanks again,

Jeff

> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: Axiom 1.2.9
>
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Issue Comment Edited: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Aaron McIver (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12762214#action_12762214 ] 

Aaron McIver edited comment on WSCOMMONS-489 at 10/5/09 8:37 AM:
-----------------------------------------------------------------

Test information:

-------------------------------------------------------------------------------
Test set: ParserTest
-------------------------------------------------------------------------------
Tests run: 3500, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 50.548 sec <<< FAILURE!
testCreateXMLStreamWriterIsThreadSafe(org.apache.axiom.om.util.StAXUtilsTest)  Time elapsed: 0.047 sec  <<< FAILURE!
junit.framework.ComparisonFailure: expected:<[<root>951</root>]> but was:<[]>
	at junit.framework.Assert.assertEquals(Assert.java:81)
	at junit.framework.Assert.assertEquals(Assert.java:87)
	at org.apache.axiom.om.util.StAXUtilsTest$3.execute(StAXUtilsTest.java:104)
	at org.apache.axiom.om.util.StAXUtilsTest$1.run(StAXUtilsTest.java:47)
	at java.lang.Thread.run(Thread.java:619)


Dialect information:

00067: Oct 5, 2009 8:23:24 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00068: INFO: Detected StAX dialect: Woodstox
00069: Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.188 sec
 
00153: Oct 5, 2009 8:23:38 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00154: INFO: Detected StAX dialect: Woodstox
00155: Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.5 sec
 
00243: Oct 5, 2009 8:23:57 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00244: INFO: Detected StAX dialect: Woodstox
00245: Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.093 sec
 
00336: Oct 5, 2009 8:24:10 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00337: INFO: Detected StAX dialect: Woodstox
00338: Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.36 sec
 
00400: Oct 5, 2009 8:24:17 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00401: INFO: Detected StAX dialect: Woodstox
00402: Tests run: 17, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.266 sec
 
00717: Oct 5, 2009 8:24:50 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00718: INFO: Detected StAX dialect: SJSXP
00719: Oct 5, 2009 8:24:52 AM org.apache.axiom.util.blob.OverflowBlob finalize
 
00737: Oct 5, 2009 8:25:13 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00738: INFO: Detected StAX dialect: SJSXP
00739: Oct 5, 2009 8:25:15 AM org.apache.axiom.util.blob.OverflowBlob finalize
 
00757: Oct 5, 2009 8:25:33 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00758: INFO: Detected StAX dialect: BEA
00759: Oct 5, 2009 8:25:34 AM org.apache.axiom.util.blob.OverflowBlob finalize
 
00777: Oct 5, 2009 8:25:44 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00778: INFO: Detected StAX dialect: Woodstox
00779: Oct 5, 2009 8:25:45 AM org.apache.axiom.util.blob.OverflowBlob finalize
 

The below 2 lines appeared in the console but did not make it to the output file...for what that is worth...performed a mvn clean followed by a mvn install > install.txt

The current artifact axiom-osgi-run-1.2.9-SNAPSHOT.jar is not a valid bundle
[INFO] Detected StAX dialect: SJSXP

Java information:

-JDK = Sun 1.6.5
-JRE = Sun 1.6.13
-JAVA_HOME = JDK

      was (Author: e1designs):
    Test information:

-------------------------------------------------------------------------------
Test set: ParserTest
-------------------------------------------------------------------------------
Tests run: 3500, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 50.548 sec <<< FAILURE!
testCreateXMLStreamWriterIsThreadSafe(org.apache.axiom.om.util.StAXUtilsTest)  Time elapsed: 0.047 sec  <<< FAILURE!
junit.framework.ComparisonFailure: expected:<[<root>951</root>]> but was:<[]>
	at junit.framework.Assert.assertEquals(Assert.java:81)
	at junit.framework.Assert.assertEquals(Assert.java:87)
	at org.apache.axiom.om.util.StAXUtilsTest$3.execute(StAXUtilsTest.java:104)
	at org.apache.axiom.om.util.StAXUtilsTest$1.run(StAXUtilsTest.java:47)
	at java.lang.Thread.run(Thread.java:619)


Dialect information:

00067: Oct 5, 2009 8:23:24 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00068: INFO: Detected StAX dialect: Woodstox
00069: Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.188 sec
 
00153: Oct 5, 2009 8:23:38 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00154: INFO: Detected StAX dialect: Woodstox
00155: Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.5 sec
 
00243: Oct 5, 2009 8:23:57 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00244: INFO: Detected StAX dialect: Woodstox
00245: Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.093 sec
 
00336: Oct 5, 2009 8:24:10 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00337: INFO: Detected StAX dialect: Woodstox
00338: Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.36 sec
 
00400: Oct 5, 2009 8:24:17 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00401: INFO: Detected StAX dialect: Woodstox
00402: Tests run: 17, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.266 sec
 
00717: Oct 5, 2009 8:24:50 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00718: INFO: Detected StAX dialect: SJSXP
00719: Oct 5, 2009 8:24:52 AM org.apache.axiom.util.blob.OverflowBlob finalize
 
00737: Oct 5, 2009 8:25:13 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00738: INFO: Detected StAX dialect: SJSXP
00739: Oct 5, 2009 8:25:15 AM org.apache.axiom.util.blob.OverflowBlob finalize
 
00757: Oct 5, 2009 8:25:33 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00758: INFO: Detected StAX dialect: BEA
00759: Oct 5, 2009 8:25:34 AM org.apache.axiom.util.blob.OverflowBlob finalize
 
00777: Oct 5, 2009 8:25:44 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00778: INFO: Detected StAX dialect: Woodstox
00779: Oct 5, 2009 8:25:45 AM org.apache.axiom.util.blob.OverflowBlob finalize
 

The below 2 lines appeared in the console but did not make it to the output file...for what that is worth...performed a mvn clean followed by a mvn install > install.txt

The current artifact axiom-osgi-run-1.2.9-SNAPSHOT.jar is not a valid bundle
[INFO] Detected StAX dialect: SJSXP

Java information:

-JDK = Sun 1.6.5
-JRE = Sun 1.6.13
-JAVA_HOME = JDK

Just to clarify...if I build this as a one off and drop it in an axis2 jar...this is not going to 'fix' things per se as long as the only StAX implementation on the box is what ships with the Sun JDK/JRE?
  
> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: Axiom 1.2.9
>
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Commented: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795743#action_12795743 ] 

Andreas Veithen commented on WSCOMMONS-489:
-------------------------------------------

Ben,

There have been too many changes between 1.2.7 and HEAD in the part of the code affected by this fix (for example, the entire StAX dialect mechanism is new in 1.2.9), so that backporting the change using individual patches is not feasible. What is actually preventing you from using 1.2.9-SNAPSHOT?

Andreas

> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: Axiom 1.2.9
>
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Commented: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12764351#action_12764351 ] 

Andreas Veithen commented on WSCOMMONS-489:
-------------------------------------------

Anyone using Axiom together with a broken StAX parser implementation may obviously run into issues. As your case shows, this applies in particular to early versions of Sun's 1.6 JRE _IF_ the user chooses to exclude the Woodstox dependency (which is the recommended StAX parser implementation for Axiom).

I was able to reproduce the issue with 1.6.0.5. Once I find a proper way to distinguish broken versions of SJSXP, I will update the StAX dialect detector to apply a workaround for the thread safety issue. However, since I only have access to that particular JRE version at work and not at home, this might take some time.

> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: Axiom 1.2.9
>
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Commented: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796698#action_12796698 ] 

Andreas Veithen commented on WSCOMMONS-489:
-------------------------------------------

If there is a single StAX implementation (other than the one in the JRE in Java 6) in the classpath, then it will be used automatically. Only if there are multiple implementations in the classpath, you need to change system properties or property files. Have a look at the Javadoc of XMLInputFactory#newInstance for more information.

> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: Axiom 1.2.9
>
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Commented: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12735250#action_12735250 ] 

Andreas Veithen commented on WSCOMMONS-489:
-------------------------------------------

See also https://sjsxp.dev.java.net/issues/show_bug.cgi?id=4

> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Commented: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Aaron McIver (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763299#action_12763299 ] 

Aaron McIver commented on WSCOMMONS-489:
----------------------------------------

Any luck? Or is it simply the fact that I need to update the JDK? And furthermore would it imply that anyone running 1.6.0.5 for instance out in the field via the JRE...will run into this same issue?

> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: Axiom 1.2.9
>
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Updated: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen updated WSCOMMONS-489:
--------------------------------------

    Summary: StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe  (was: StAXUtil incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe)

> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Commented: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796613#action_12796613 ] 

Andreas Veithen commented on WSCOMMONS-489:
-------------------------------------------

Ben,

If you want to minimize risk and have a stable environment, then you should use Woodstox instead of SJSXP, as this eliminates the root cause of the issue.

> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: Axiom 1.2.9
>
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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


[jira] Commented: (WSCOMMONS-489) StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe

Posted by "Aaron McIver (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12762214#action_12762214 ] 

Aaron McIver commented on WSCOMMONS-489:
----------------------------------------

Test information:

-------------------------------------------------------------------------------
Test set: ParserTest
-------------------------------------------------------------------------------
Tests run: 3500, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 50.548 sec <<< FAILURE!
testCreateXMLStreamWriterIsThreadSafe(org.apache.axiom.om.util.StAXUtilsTest)  Time elapsed: 0.047 sec  <<< FAILURE!
junit.framework.ComparisonFailure: expected:<[<root>951</root>]> but was:<[]>
	at junit.framework.Assert.assertEquals(Assert.java:81)
	at junit.framework.Assert.assertEquals(Assert.java:87)
	at org.apache.axiom.om.util.StAXUtilsTest$3.execute(StAXUtilsTest.java:104)
	at org.apache.axiom.om.util.StAXUtilsTest$1.run(StAXUtilsTest.java:47)
	at java.lang.Thread.run(Thread.java:619)


Dialect information:

00067: Oct 5, 2009 8:23:24 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00068: INFO: Detected StAX dialect: Woodstox
00069: Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.188 sec
 
00153: Oct 5, 2009 8:23:38 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00154: INFO: Detected StAX dialect: Woodstox
00155: Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.5 sec
 
00243: Oct 5, 2009 8:23:57 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00244: INFO: Detected StAX dialect: Woodstox
00245: Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.093 sec
 
00336: Oct 5, 2009 8:24:10 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00337: INFO: Detected StAX dialect: Woodstox
00338: Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.36 sec
 
00400: Oct 5, 2009 8:24:17 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00401: INFO: Detected StAX dialect: Woodstox
00402: Tests run: 17, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.266 sec
 
00717: Oct 5, 2009 8:24:50 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00718: INFO: Detected StAX dialect: SJSXP
00719: Oct 5, 2009 8:24:52 AM org.apache.axiom.util.blob.OverflowBlob finalize
 
00737: Oct 5, 2009 8:25:13 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00738: INFO: Detected StAX dialect: SJSXP
00739: Oct 5, 2009 8:25:15 AM org.apache.axiom.util.blob.OverflowBlob finalize
 
00757: Oct 5, 2009 8:25:33 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00758: INFO: Detected StAX dialect: BEA
00759: Oct 5, 2009 8:25:34 AM org.apache.axiom.util.blob.OverflowBlob finalize
 
00777: Oct 5, 2009 8:25:44 AM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
00778: INFO: Detected StAX dialect: Woodstox
00779: Oct 5, 2009 8:25:45 AM org.apache.axiom.util.blob.OverflowBlob finalize
 

The below 2 lines appeared in the console but did not make it to the output file...for what that is worth...performed a mvn clean followed by a mvn install > install.txt

The current artifact axiom-osgi-run-1.2.9-SNAPSHOT.jar is not a valid bundle
[INFO] Detected StAX dialect: SJSXP

Java information:

-JDK = Sun 1.6.5
-JRE = Sun 1.6.13
-JAVA_HOME = JDK

Just to clarify...if I build this as a one off and drop it in an axis2 jar...this is not going to 'fix' things per se as long as the only StAX implementation on the box is what ships with the Sun JDK/JRE?

> StAXUtils incorrectly assumes that XMLInputFactory and XMLOutputFactory instances are thread safe
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-489
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-489
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: Axiom 1.2.9
>
>
> StAXUtil uses a single XMLInputFactory or XMLOutputFactory instance (per classloader). This means that it makes the assumption that these instances are thread safe. However, there is nothing in the StAX specs that guarantees that, and Sun's implementation in JDK 6 is not thread safe, at least with the default properties [1] [2].
> [1] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLInputFactoryImpl.java.htm
> [2] http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-com.sun/xml/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java.htm

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