Hi All,
Need help here. I’m just new to WM java service. I might made some mistakes along the code.
I wanted to create a java service that would spawn a number of threads depending on the number of input parameters, each input will do a server.doThreadInvoke to a certain flow service that will have some processing. During the implementation it keeps on throwing an error execution.
Input:
inputParam ----> string array
Output:
documents -----> documentArray
IDataCursor pipelineCursor = pipeline.getCursor();
String inputParam= IDataUtil.getStringArray( pipelineCursor, “inputParam” );
pipelineCursor.destroy();
ServiceThread svcThread = null;
for(int i=0;i<inputParam.length;i++){
IData input = IDataFactory.create();
IDataCursor inputCursor = input.getCursor();
IDataUtil.put(inputCursor, “inputToService”, inputParam[i]);
inputCursor.destroy();
Logging(“DEBUG”,inputParam[i]);
svcThread[i] = Service.doThreadInvoke(“helloFolder.anotherFold.services”, “ServiceMade”, input);
}
Logging(“DEBUG”,“reached this point”);
IDataCursor pipelineCursor_1 = pipeline.getCursor();
for(int i=0;i<=inputParam.length;i++){
try {
documents[i] = IDataFactory.create();
IDataCursor docCursor = documents[i].getCursor();
IDataUtil.put( docCursor , “documents”, svcThread[i] );
docCursor .destroy();
} catch (Exception e) {
throw new ServiceException(e);
}
}
pipelineCursor_1.destroy();
I get to see the logging of the inputParam[0]. (invoked service contains logging). however, I can’t see if it was able to process the inputParam[1] and so on. because I can’t see their process in the logs. My guess is that during the first invocation, inputParam[0]. it was able to successfully invoke the service but after the invocation, there’s some error.
I get a null pointer error at the first loop (it doesn’t reach the second loop) because I’m not seeing “reached this point” in the logs. Is there any step that I’m missing.
Error
java.lang.NullPointerException
at helloFolder.anotherFold.services.ServiceMade(services.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
#Integration-Server-and-ESB#webMethods#Flow-and-Java-services