views:

215

answers:

2

Hello, I'm using JAXWS for generating webservices and serving using EndPoint.publish() as well as deploying war file, but as soon as it has served 100 requests it wouldn't return 101st response. How to configure JAXWS to change this count to unlimited?

EDIT: solution found, first of all it was not related to JAXWS and I'm sorry for posting it here, in my first impression I thought problem is with JAXWS but after deep exploring and debugging I found problem with my persistence layer (Hibernate) where max number of sessions allowed are 100 by default. Sorry again for making you guys to think which actually does not make sense.

+3  A: 

This is very weird and I didn't succeed to reproduce the behavior you're describing.

I've quickly created the following Hello service (using JAX-WS RI 2.1.6 from my JDK 6):

import java.net.URL;

import javax.jws.WebService;
import javax.xml.ws.Endpoint;

@WebService()
public class Hello {

    // Business method we want to expose as Web service operation
    public String sayHello(String name) {
        return "Hello " + name + "!";
    }

    public static void main(String[] args) throws Exception {
        String address = "http://localhost:8080/HelloWebService/HelloService?WSDL";
        URL wsdlURL = new URL(address + "?wsdl");
        Endpoint ep = Endpoint.publish(address, new Hello());
    }

}

Then, I've setup a quick SoapUI test that calls the hello service 110 times, just to be sure, while the main method is running. Below a screenshot of the actual result:

alt text

As you can see, the test ran fine with 0 error on 110 (not all concurrent) calls.

Please provide some code showing what you are doing, there must be a difference somewhere (maybe you are running heavily parallelized requests in which case I'm not testing the same thing).

Pascal Thivent
A: 

Internally, a thread pool (Executor) is used for handling the requests. It's default pool size is set to 100 requests. You can set your own ThreadPoolExecutor easily through Endpoint#setExecutor(Executor) after you created the Endpoint instance.

oeogijjowefi
I was suspecting this (but wanted the OP to confirm he was talking about parallel request) but, for my culture, where is it documented? I can't find any mention of this in the javadoc.
Pascal Thivent
It is documented within the type comment, on the top of the page of the Endpoint Javadoc ( http://java.sun.com/javase/6/docs/api/javax/xml/ws/Endpoint.html ).
oeogijjowefi
Well, the 100 thread limit isn't documented. But you can look it up by getting the Executor, cast it to it's type. It must be sth. of ThreadPoolExecutor with a core pool size of 25 and a maximum of 100. I never looked that up ;)
oeogijjowefi