XFire
  1. XFire
  2. XFIRE-1001

Concurrency issue in StaxUtils.createXMLStreamReader

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.6
    • Fix Version/s: 1.2.7
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Windows XP, Java 5 update 9
    • Number of attachments :
      2

      Description

      I've created a simple HelloWorld service that echoes a name back to the client. This works fine until i create 2 or more threads that calls the service at the same time. Every now and then, I get an XML parsing error. The content of the request is always correct however and making this small change to StaxUtils fixes the issue.

      759 synchronized(factory)

      { 760 return factory.createXMLStreamReader(in, encoding); 761 }

      So this would indicate that it is not safe to use the same XMLInputFactory instance in a multi-threaded way. Obviously synchronisation is not an optimal solution, but hopefully you guys can think of something better .

      1. HelloWorldClient.java
        3 kB
        Walter Seymore
      2. HelloWorldService.java
        0.1 kB
        Walter Seymore

        Activity

        Dan Diephouse made changes -
        Field Original Value New Value
        Fix Version/s 1.2.7 [ 13470 ]

          People

          • Assignee:
            Dan Diephouse
            Reporter:
            Walter Seymore
          • Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated: