Are JBossWS webservices threadsafe?

Solution Verified - Updated -

Issue

  • We are converting from Websphere and our webservice is behaving differently on JBoss which makes us wonder if JBossWS is not thread safe.

Here is a simple web service example:

@WebService
public class TestWS {
  private String myName = "Test"; 
  @WebMethod
  public void doSomething() {
    myName = myName + ".";
  }

  @WebMethod
  public String getSvcName() {
    return myName;
  }
}

In this example the class variable myName keeps changing with each invocation of doSomething() method. This behavior makes the web service thread unsafe.

Environment

  • JBoss Enterprise Application Server (EAP) 6.x
  • JBoss Enterprise Application Server (EAP) 5.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content