xmlNodeToDocument service throws ArrayIndexOutOfBoundsException

Hi ,
I am using service following built in services in sequence.

pub.file:getFile
pub.xml:xmlStringToXMLNode
pub.xml:xmlNodeToDocument

The getFile takes input xml as filename. When I execute these service in sequence I got com.wm.app.b2b.server.ServiceException: java.lang.ArrayIndexOutOfBoundsException: Array index out of range for service xmlNodeToDocument.

Any suggestion ?

Thanks in advance,
Amit

Stack strace :

com.wm.app.b2b.server.ServiceException: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: -1
at pub.xml.xmlNodeToDocument(xml.java:594)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:322)
at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:612)
at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:226)
at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:194)
at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:39)
at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:407)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:521)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:369)
at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:246)
at com.wm.app.b2b.server.BaseService.invoke(BaseService.java:168)
at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java(Compiled Code))
at com.wm.lang.flow.FlowState.invokeNode(FlowState.java:580)
at com.wm.lang.flow.FlowState.stepIncremental(FlowState.java:494)
at com.wm.lang.flow.FlowState.invoke(FlowState.java:376)
at wm.server.flowimpl.stepFlow(flowimpl.java:183)
at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:332)
at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:612)
at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:226)
at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:194)
at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:39)
at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:407)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:521)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:369)
at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:246)
at com.wm.app.b2b.server.comm.DefaultServerRequestHandler.handleMessage(DefaultServerRequestHandler.java:119)
at com.wm.app.b2b.server.HTTPMessageHandler.process(HTTPMessageHandler.java:168)
at com.wm.app.b2b.server.Dispatch.run(Dispatch.java:298)
at com.wm.util.pool.PooledThread.run(PooledThread.java:105)
at java.lang.Thread.run(Thread.java:568)

HI Amit,
When you use getFile you will get the output as bytes or stream. Default is bytes. If you get bytes you have to convet it to String using bytesToString nad then StringToNode and then NodeToDocument. If you get stream as output from getFile then convert the stream to bytes and then bytes to string and string to node and node to document. I guess this will help you,
Thanks,
Jay

Hi Jay,
Thanks for the immediate reply. I followed the same steps as mentioned by you. This service was running properly 10 days back.After that we don’t have any change. But now it is giving above exception.

Thanks,
Amit

Is it giving the exception only for that file or for all files.
Thanks,
Jay

Amit,

Please do check in the xmlstring if the structure is matching according to the IDATA documentname that you are parsing like arrays (doclists),lengths etc…Also what are the inputs you have given in the xmlNodeToDocument? makeArrays to false or true?

HTH,
RMG