I was analysing the thread dump and found this :
Most of the threads that are BLOCKED are hung from stacktrace originating from :
.
.
javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:211)
javax.xml.bind.ContextFinder.find(ContextFinder.java:372)
javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
org.jboss.ws.core.jaxws.CustomizableJAXBContextFactory.createContext(CustomizableJAXBContextFactory.java:92)
.
.
These threads are either executing the actual web-service method or are trying to perform a getPort() operation.
My Java code for invoking the webservice is of the type :
public SomeResponse invoke(Payload payload)
{
SOcreation.ServiceManagementAPIService SO_service = new SOcreation.ServiceManagementAPIService();
SOcreation.ServiceManagementAPI SO_port = SO_service.getServiceManagementAPIPort();
SO_port.callWebService(payload); //Sample
}
Is this a good practice ? Or should the service and port objects be created as Class-level (making them global and/or static too) ?
Is there any way to escape the getPort() thing ? Why does the WSDL be read out each and every time the WebService is called ? Doesn't JBoss cache it ? In the "debug" log mode, I find that the entire WSDL is printed out (i.e., read from the file) and then parsed (XML parsing is costly).
(The synchornized Map method which I was discussing also arises out of the creation of JAXB context)
Any answers ?
Cheers
Rohit M