on 12-23-2008 2:21 PM
Hi,
I have scenario IDoc to JDBC...
BPM is used, in BPM Mapping is Java mapping & Java Mapping is failed.
Now am in Technical Workflow container area.
I am unable to trace that where the mapping got failed, i mean particular failed field area.
Please suggest how to trace java mapping failures & and also failures in BPM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
check the trace file in SXMB_MONI(process view). Singleclick on the link of the process instance ID where your mapping failed, it'll take you to the workflow protocoll. Go to technical details, put your cursor on the transformation step, switch to tab "container", you should find a "Trace" segment. The information there could be useful for your troubleshooting.
Anyway you can also test your JAVA mapping in integration repository. The JAVA mapping used in your BPM is assigned to an interface mapping, right? Go find the interface mapping and test it by setting the trace level into "ALL".
Basically, except for the abstract interface used here, mapping in BPM has nothing dfference with normal ones. Just use normal ways to analyse them and test them.
Have fun with debugging.
Regards,
Chen
Hi Chen,
I found trace filed in technical workflow settings but the log information is not at all dispalying any filed information. only some java log stuff is appearing.
I laready tested in interface mapping by setting the trace level into "ALL".
Same output, nothing is related to field level information.........same java stuff appearing.
please suggest.
Hi chitra,
well the java stuffs you got are exactly what you are gonna analyse. That should be the log you mentioned. There gotta be some clues to locate the error. Mind if you paste some of them here?
And by the way, I've also been through an IDOC to JDBC scenario. Why do you need JAVA mapping anyway? Is Message Mapping not capable to solve this? It'd be better to use UDF + Message Mapping to minimize the places where error may occur.
If a JAVA Mapping is strongly needed here, the debug way Patrick mentioned in the blog could be indeed helpful.
Regards,
Chen
Yes i agree with your point,
But this Java code is there from years....
We are planning to map that into graphical.
Code ...........Sorry i have deleted some detals like namespace info....if u really need them i will post again
<?xml version="1.0" encoding="utf-8" ?>
- <MappingTrace>
<Trace level="1" type="T">Mapping-Namespace:**NAME SPACE****</Trace>
<Trace level="1" type="T">Mapping-Name:******INTERFACE NAME*******</Trace>
<Trace level="1" type="T">Mapping-SWCV:A7295CA1F54311D9CC6CD6570A83C116</Trace>
<Trace level="1" type="T">Mapping-Step:1</Trace>
<Trace level="1" type="T">Mapping-Type:JAVA</Trace>
<Trace level="1" type="T">Mapping-Program:com/**/map/d_013/*******</Trace>
<Trace level="1" type="T">RuntimeException during appliction Java mapping com/*****</Trace>
<Trace level="1" type="T">java.lang.StringIndexOutOfBoundsException: String index out of range: 4 at java.lang.String.substring(String.java:1683) at com.Confirmation.doMap_(Confirmation.java:200) at com.Confirmation.execute(Confirmation.java:89) at com.sap.aii.ibrun.server.mapping.JavaMapping.executeStep(JavaMapping.java:64) at com.sap.aii.ibrun.server.mapping.Mapping.execute(Mapping.java:92) at com.sap.aii.ibrun.server.mapping.MappingHandler.run(MappingHandler.java:90) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleMappingRequest(MappingRequestHandler.java:95) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleRequest(MappingRequestHandler.java:68) at com.sap.aii.ibrun.sbeans.mapping.MappingServiceImpl.processFunction(MappingServiceImpl.java:79) at com.sap.aii.ibrun.sbeans.mapping.MappingServiceObjectImpl0_0.processFunction(MappingServiceObjectImpl0_0.java:131) at sun.reflect.GeneratedMethodAccessor570.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187) at $Proxy154.processFunction(Unknown Source) at sun.reflect.GeneratedMethodAccessor2061.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:107) at com.sap.engine.services.rfcengine.RFCJCOServer.handleRequestInternal(RFCJCOServer.java:113) at com.sap.engine.services.rfcengine.RFCJCOServer$ApplicationRunnable.run(RFCJCOServer.java:157) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)</Trace>
<Trace level="1" type="T">Runtime exception occurred during execution of application mapping program com/n/map/3/Confirmation: java.lang.StringIndexOutOfBoundsException; String index out of range: 4</Trace>
<Trace level="1" type="T">com.sap.aii.ibrun.server.mapping.MappingRuntimeException: Runtime exception occurred during execution of application mapping program com/n/map/d/Confirmation: java.lang.StringIndexOutOfBoundsException; String index out of range: 4 at com.sap.aii.ibrun.server.mapping.JavaMapping.executeStep(JavaMapping.java:73) at com.sap.aii.ibrun.server.mapping.Mapping.execute(Mapping.java:92) at com.sap.aii.ibrun.server.mapping.MappingHandler.run(MappingHandler.java:90) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleMappingRequest(MappingRequestHandler.java:95) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleRequest(MappingRequestHandler.java:68) at com.sap.aii.ibrun.sbeans.mapping.MappingServiceImpl.processFunction(MappingServiceImpl.java:79) at com.sap.aii.ibrun.sbeans.mapping.MappingServiceObjectImpl0_0.processFunction(MappingServiceObjectImpl0_0.java:131) at sun.reflect.GeneratedMethodAccessor570.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187) at $Proxy154.processFunction(Unknown Source) at sun.reflect.GeneratedMethodAccessor2061.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:107) at com.sap.engine.services.rfcengine.RFCJCOServer.handleRequestInternal(RFCJCOServer.java:113) at com.sap.engine.services.rfcengine.RFCJCOServer$ApplicationRunnable.run(RFCJCOServer.java:157) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172) Root Cause: java.lang.StringIndexOutOfBoundsException: String index out of range: 4 at java.lang.String.substring(String.java:1683) at com.n.map.d.Confirmation.doMap_(Confirmation.java:200) at com.n.map.Confirmation.execute(Confirmation.java:89) at com.sap.aii.ibrun.server.mapping.JavaMapping.executeStep(JavaMapping.java:64) at com.sap.aii.ibrun.server.mapping.Mapping.execute(Mapping.java:92) at com.sap.aii.ibrun.server.mapping.MappingHandler.run(MappingHandler.java:90) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleMappingRequest(MappingRequestHandler.java:95) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleRequest(MappingRequestHandler.java:68) at com.sap.aii.ibrun.sbeans.mapping.MappingServiceImpl.processFunction(MappingServiceImpl.java:79) at com.sap.aii.ibrun.sbeans.mapping.MappingServiceObjectImpl0_0.processFunction(MappingServiceObjectImpl0_0.java:131) at sun.reflect.GeneratedMethodAccessor570.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187) at $Proxy154.processFunction(Unknown Source) at sun.reflect.GeneratedMethodAccessor2061.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:107) at com.sap.engine.services.rfcengine.RFCJCOServer.handleRequestInternal(RFCJCOServer.java:113) at com.sap.engine.services.rfcengine.RFCJCOServer$ApplicationRunnable.run(RFCJCOServer.java:157) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)</Trace>
<Trace level="1" type="T">com/n/map/3/Confirmation~java.lang.StringIndexOutOfBoundsExceptionString index out of range: 4</Trace>
</MappingTrace>
Test Result in IR test mapping with trace level ALL
Runtime exception occurred during execution of application mapping program com/n/map/_013/ConfirmationImpl: java.lang.StringIndexOutOfBoundsException; String index out of range: 4
16:01:42 Start of test
Creating Java mapping com/n/map/_013/ConfirmationImpl
Loaded class com.n.map._013.ConfirmationImpl
Loaded class com.nutil.XmlUtil
Call method execute of the application Java mapping com.n.map._013.ConfirmationImpl
Error during appliction Java mapping com/n/map/_013/ConfirmationImpl
java.lang.StringIndexOutOfBoundsException: String index out of range: 4 at java.lang.String.substring(String.java:1683) at com.n.map._013.ConfirmationImpl.doMap_(ConfirmationImpl.java:200) at
com.n.map._013.ConfirmationImpl.execute(ConfirmationImpl.java:89) at com.sap.aii.ibrep.server.mapping.ibrun.RepJavaMapping.execute(RepJavaMapping.java:73) at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingHandler.run(RepMappingHandler.java:80) at com.sap.aii.ibrep.server.mapping.rt.MappingHandlerAdapter.run(MappingHandlerAdapter.java:107) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInterfaceMapping(ServerMapService.java:127) at com.sap.aii.ibrep.server.mapping.ServerMapService.transform(ServerMapService.java:104) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.transform(MapServiceBean.java:40) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0.transform(MapServiceRemoteObjectImpl0_0.java:167) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0p4_Skel.dispatch(MapServiceRemoteObjectImpl0_0p4_Skel.java:104) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:312) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:199) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
16:01:45 End of test
<Trace level="1" type="T">java.lang.StringIndexOutOfBoundsException: String index out of range: 4 at java.lang.String.substring(String.java:1683) at com.Confirmation.doMap_(Confirmation.java:200) at
Looks like you used substring somewhere. It's a typical "out of bound" exception, meaning basically that the characters you want to substract from the input string is longer than the input string itself. Like substring("inputstring", 5, 9), this is wrong.
Search your source code of the JAVA mapping where are you using substring on which field, and analyse your source XML message.
Normally on using substring function, we either use like this way:
substring("inputstring", 5)
means sub the input from the sixth character to the end, or, use an IF to evaulate the length of inbound string. If it's longer than a particular length, then sub it, otherwise no changes on it.
Hopefully you can make it on your corrections.
Cheers,
Chen
Hi Chen,
Thanks for the responce.
String index out of range: 4 at java.lang.String.substring(String.java:1683) at com.Confirmation.doMap_(Confirmation.java:200) at
As i am new to java mapping i couldnt able to analyse the message.
" " It's a typical "out of bound" exception, meaning basically that the characters you want to substract from the input string is longer than the input string itself " "
Is there any reference documents available for java mapping.
I mean how you said by looking at code ( "outofbound" = meaning basically that the characters you want to substract from the input string is longer than the input string itself )
can you please brief
Hi Chitra,
The best solution is to test the java maping standalone. Just extract the source payload (store it in a file input.xml) from sxmb moni which is input for java Mapping and and run the java mapping locally in your machine. You will be able to find exactly where the error is. But for compiling your java mapping in your local machine you need SAP jar files (aii_map_api.jar) and some other dependent files in your class path.
Sample code which you can test your mapping
import java.io.*;
import com.sap.aii.mapping.api.StreamTransformation;
import java.util.Map;
public class TestMapping implements StreamTransformation
{
Map map = null;
public void setParameter(Map param)
{
map = param;
}
public void execute(InputStream in)
{
//copy your code whatever you are using in java mapping execute function
}
public static void main(String ar[])
{
try
{
TestMapping testMap = new TestMapping ();
InputStream in = new FileInputStream("input.xml");
testMap .execute(in);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
Let me know if you need any further info on the same.
Thanks
Amit
Hi Chitra
In BPM SWWL did you get which step it failed.
You must me known to the step and mapping it failed i can see in thread.
Moreover it shows java.lang.StringIndexOutOfBoundsException the issue is with the payload which is not satisfying to this java mapping. test the mapping with more than one payloads
As suggested above test the mapping standalone using NWDS or Eclipse.
Thanks
Gaurav
Hi Chitra,
regarding function substring pls have a look at the following java doc:
http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html#substring(int,%20int)
The exception "outofbound" is typical and frequently happening.
Try to take a look at the source code of the java mapping to find out where is this function used. Around the function, you may see which field in the source structure are you dealing with. As suggested you'd better use a development enviroment like Netweaver Development Studio to research your java mappings. To correct this mapping, like I suggested, use an IF to avoid the "outofbound" exception.
To start on java development in SAP you can refer to SAP libaries:
http://help.sap.com/saphelp_nw04/helpdata/de/21/82a9058fa8de46b1ba7522289345b2/frameset.htm
Take the SAP course JA100, JA300 if you are really interested to java development.
Regards,
Chen
User | Count |
---|---|
71 | |
26 | |
10 | |
9 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.