users@glassfish.java.net

JAX-WS client locking and multiple threads

From: <glassfish_at_javadesktop.org>
Date: Wed, 11 Mar 2009 08:21:39 PDT

I am trying to invoke JAX-WS client from my Stateless Bean which works fine with a single thread. When I invoke same function in multiple threads, it seem to be locking at
port.<FunctionaCall>.

Here is my code for Web Service:

@WebService
@Stateless
public class StatelessBean implements StatelessLocal {
     
   public StatelessBean() {}
   
   @WebMethod(operationName = "getStaticString")
    public String getStaticString() {
        
        return "Hello.";
     
     }
}
and URL to access it: http://localhost:8080/StatelessBeanService/StatelessBean?WSDL

Now in my Bean, I am trying to access above web service via JAX-WS as below

@Stateless
public class StatelessIterateBean implements StatelessIterateLocal {
   
 @WebServiceRef(wsdlLocation = "http://localhost:8080/StatelessBeanService/StatelessBean?WSDL")
private StatelessBeanService service;

    public String getData() {
         
        try {
            com.my.stateless.StatelessBean port = service.getStatelessBeanPort();
           //IT IS LOCKED HERE
            java.lang.String result = port.getStaticString();
          
            return result;
        } catch (Exception ex) {
            // TODO handle custom exceptions here
        }
      return "error";
   }
}


Now when I call GetData function in a multithreaded enviornment, it is getting stuck at java.lang.String result = port.getStaticString();

Here port is a local function variable.

I would really appreciate any hint as I spent two days on this. :(

Thx.
[Message sent by forum member 'rinku24' (rinku24)]

http://forums.java.net/jive/thread.jspa?messageID=336399