Hi all!
I have a SOAP client with several threads that use the same instance of a helper class
to create a Service object and a Call object in parallell. The helper class has no
instance fields, so all fields are private to each thread. When I run the client I
get the exception listed below.
When I run the initialization without threads, it works.
Any help is greatly appreciated.
With kind regards,
Uwe Kubosch
Exception:
java.lang.NullPointerException
at
org.apache.commons.discovery.resource.classes.DiscoverClasses$1.getNextClass(DiscoverClasses.java:128)
at
org.apache.commons.discovery.resource.classes.DiscoverClasses$1.hasNext(DiscoverClasses.java:116)
at
org.apache.commons.discovery.resource.classes.ResourceClassDiscoverImpl$1.getNextResource(ResourceClassDiscoverImpl.java:159)
at
org.apache.commons.discovery.resource.classes.ResourceClassDiscoverImpl$1.hasNext(ResourceClassDiscoverImpl.java:147)
at
org.apache.axis.configuration.EngineConfigurationFactoryFinder$1.run(EngineConfigurationFactoryFinder.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:152)
at
org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:199)
at org.apache.axis.client.Service.getEngineConfiguration(Service.java:731)
at org.apache.axis.client.Service.getAxisClient(Service.java:140)
at org.apache.axis.client.Service.<init>(Service.java:149)
at no.bbs.apptest.helpers.SOAPTask.init(SOAPTask.java:71)
at no.bbs.apptest.core.JobImpl.prepareTasks(JobImpl.java:320)
at no.bbs.apptest.core.JobImpl.initTasks(JobImpl.java:305)
at no.bbs.apptest.core.JobImpl.run(JobImpl.java:394)
at java.lang.Thread.run(Thread.java:536)
The method in the client in which the exception occurs is below:
public class SOAPTask {
...
public void init(JobContext jobContext) {
String runUrl;
String uri;
String method;
Object[] params;
Service service;
Call call;
runUrl =
getConfigParam(jobContext, URLUtils.PARAM_BASEURL, true).getValue()
+ getConfigParam(jobContext, "href").getValue();
uri = getConfigParam(jobContext, "uri", true).getValue();
method = getConfigParam(jobContext, "method", true).getValue();
service = new Service();
try {
call = (Call) service.createCall();
call.setTargetEndpointAddress(runUrl);
call.setOperationName(new QName(uri, method));
} catch (ServiceException sex) {
logger.error("Error creating call.", sex);
call = null;
}
params = addParameters(jobContext, call);
jobContext.setAttribute(getName() + "_call", call);
jobContext.setAttribute(getName() + "_params", params);
}
...
}
---------------------------------------------------------------
This email and any files transmitted with it are confidential
and is for authorised use by the intended recipient(s) only.
This email has been swept for the presence of computer viruses.
---------------------------------------------------------------