Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: GroovyWS
-
Labels:None
-
Environment:n/a
-
Number of attachments :
Description
I am using groovyws in a grails application (multiple requests/threads). Everything works with I create a new Client for every request, but this is very expensive. If I don't do this, and reuse the client, I get a "ClassNotFoundException" when I ask the client for a class (the create method)
I actually downloaded and patched groovyws to use the same classloader that the client was initialized with, but when I did this, the class was never found in the classloader, so it's harder then I thought to do this.
I deployed my application and the performance is just too slow to use groovyws with this limitation.
We've got the same issue which we have a non-elegant work where we store the classloader (Thread.currentThread().getContextClassLoader() ) used for initialisation and reuse for class creation, e.g.
initialise
proxy=new WSClient("http://terraservice.net/TerraService.asmx?WSDL", this.class.classLoader)
proxy.initialize()
classLoader=Thread.currentThread().getContextClassLoader()
method call
def place = classLoader.loadClass("com.terraserver_usa.terraserver.Place").newInstance()
place.city = city
place.state = state
place.country = country
proxy.ConvertPlaceToLonLatPt(place)
See http://bemoko.googlecode.com/svn/sites/exercise_webservice_soap/trunk/plugins/LocationPlugin.groovy