cancel
Showing results for 
Search instead for 
Did you mean: 

Adaptive RFC: JCo throws ArrayIndexOutOfBoundsException

Former Member
0 Kudos

Hi All,

I need some help here.

<b>java.lang.ArrayIndexOutOfBoundsException: -128

at com.sap.mw.jco.JCO$Record.initializeRow(JCO.java:12118)</b>

This is what I get when trying to call a new RFC I've just added to my model which did not cause any problems so far.

Below you will find more of the StackTrace.

So here is what I tried/found out so far:

- Creation of the RFC *_Input works but as soon as some attribute is set or execute() is called JCO internally calls ensureBufferCapacity which throws the exception.

- The rest of the Adaptive RFC model is working fine, i.e. no problem with setup of JCo connections

- Using ABAP Workbench I can execute the RFC without problems

- Re-Importing the model does not help

- Importing the RFC in a different model does not change the behaviour. (It is therefore very unlikely that the import was not working properly)

- Restarting the server did not solve the issue.

Any hints from your side?

Thanks & Regards

Markus

<b>java.lang.ArrayIndexOutOfBoundsException: -128

at com.sap.mw.jco.JCO$Record.initializeRow(JCO.java:12118)</b>

at com.sap.mw.jco.JCO$Record.ensureBufferCapacity(JCO.java:12162)

at com.sap.mw.jco.JCO$Record.<init>(JCO.java:11636)

at com.sap.mw.jco.JCO$Structure.<init>(JCO.java:17718)

at com.sap.aii.proxy.framework.core.JcoMarshaler.newRecord(JcoMarshaler.java:71)

at com.sap.aii.proxy.framework.core.JcoMarshaler.newRecord(JcoMarshaler.java:89)

at com.sap.aii.proxy.framework.core.JcoBaseTypeData.init(JcoBaseTypeData.java:96)

at com.sap.aii.proxy.framework.core.JcoBaseTypeData.<init>(JcoBaseTypeData.java:87)

at com.sap.aii.proxy.framework.core.BaseTypeDataFactory.createNewBaseTypeData(BaseTypeDataFactory.java:26)

at com.sap.aii.proxy.framework.core.AbstractType.baseTypeData(AbstractType.java:118)

at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClass.setAttributeValueAsBoolean(DynamicRFCModelClass.java:525)

at my.package.MyRFC_Input.setMyAttribute(MyRFC_Input.java:5337)

...

Message was edited by: Markus Wissmann

My code looks like this:

my.package.MyRFC_Input bapi = new my.package.MyRFC_Input();

bapi.setMyAttribute(true); // boolean property, not array related

bapi.execute();

Problem also persists if code looks like this:

my.package.MyRFC_Input bapi = new my.package.MyRFC_Input();

// bapi.setMyAttribute(true);

bapi.execute();

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Is there any change made in BAPI?

See this Thread

Kind Regards

Mukesh

Former Member
0 Kudos

Hi Mukesh,

Thanks for your reply.

No, I imported and re-imported (see former post) the BAPI this morning and there was no change.

Therefore I guess the problem is a different one than in the thread you pointed out.

I guess there must be a problem with the meta data or the generated classes but this is just a wild guess.

Regards

Markus

Former Member
0 Kudos

Markus,

The fact that you have re-imported model may cause this error. If you can, try to re-start WebAS and check whether or not error goes away.

VS

Former Member
0 Kudos

Hi Valery,

Thanks for your time.

I had tried to restart the server after the re-import and it did not change anything :o(

Any other ideas?

Best Regards

Markus

Former Member
0 Kudos

Markus,

No other ideas except the following wired one:

I expirienced similar problems when quite esoteric combination of input/output parameters in RFC is used. Say, one of input parameters is table, or structure with nested table. Actually, such combos are not supprted by Adaptive RFC or at least they are not recommended.

VS

Former Member
0 Kudos

Hi Valery,

Full points. Input parameters are table types :o(

Guess I need someone to create me a WD-friendly wrapper.

Thanks again

Markus

Former Member
0 Kudos

Markus,

Just to make sure you understand me correctly

Open RFM in question using SE37 transaction in SAP GUI, run "Display". Check where your table parameters are located among tabs -- there are "Input", "Table", "Changing", "Output" and "Exception" groups. If they are inside "Input" or "Output" then this could be a reason. If they are inside "Table" then it's ok, and the reason is something different.

VS

Former Member
0 Kudos

Hi Valery,

Yes, I've understood your point and I had checked my BAPI, unfortunately there are table types used in the import section.

Just for curiosity: Is there no way to pass collections to a BAPI except in the tables section?

Thanks again

Markus

Former Member
0 Kudos

Markus,

Strictly speaking, it is not recommended to have table parameters in input for remote-enabled functions. JCo / Adaptive RFC must use very complex marshalling for them (both time-consuming and large in size).

However, Adaptive RFC adds several bugs to the picture (the one reported by you seems to be third), in effect making such parameters impossible.

So the answer is: "you may, also this this not recommended, just wait for bug fix"

And what's wrong with table section?

VS

Answers (0)