cancel
Showing results for 
Search instead for 
Did you mean: 

ArrayIndexOutofBoundsException

Former Member
0 Kudos

hi experts,

I have an existing application in production.There were some change requirements pertaining to the same.Hence i added 4fields in the output structure of the RFC.Made corresponding changes in webdynpro, build and deployed in development.

It is running properly in development ....i transported the ABAP request to production and deployed the ear of the corresponding dc.But am getting a dump in production as :

java.lang.ArrayIndexOutOfBoundsException: -1

Any clues on the same ??

Accepted Solutions (1)

Accepted Solutions (1)

srinivas_sistu
Active Contributor
0 Kudos

Hi,

Do one thing.

re import the RFC, then remove the mappings and remap and deploy. Hope this works. Same thing happened with me after changing the RFC structure in the backend.

Regards,

SrinivaS

Former Member
0 Kudos

Hi Srinivas,

Thanks for your solution.But the scenario is , it is running perfectly fine at development , but while deploying the same at production throwing the error.

Any clues on the same ?

Former Member
0 Kudos

Hi,

This is a metadata cache issue (My strong guess).

Please go through the document and invalidate the cache , If still the problem exists

Restart the Portal Server

. Even we have faced this kind of issue many times.

Note: If this java exception is not bcause of your code (becaues you are telling its working fine in Dev)

And check if this is the issue with data also.

Regards,

Charan

srinivas_sistu
Active Contributor
0 Kudos

Hi,

As you are telling that it is working in Dev but not in PROD, compare the RFC definition (import and Export params) in dev and Prod.

As a final weapon, restart your J2EE engine

PS: Do put some success messages so that you can find out exactly at what line you are getting the eception.

Regards,

SrinivaS

Edited by: srinivas sistu on May 27, 2009 7:32 PM

nitin_mahajan2
Contributor
0 Kudos

There would be only 2 arrays

One for the number of attributes in your node and then the number of nodes.

you are saying you have added some parameters to the node, so now your code is running for 4 more loops assuming the attributes are there.

Your production server would have definately cached the node structure and is still assuming that you dont have those extra attributes.

As Karthikaye said, the BAPI structure gets cached in Portal. If there is a change, HAVE TO (no exception) restart portal after moving the portal and ABAP changes.

Restart the server and you should solve the problem. I don't see otherwise why you would have any issue as it is working in development.

Good Luck, i know it is very irritating, been there.

Regards,

Nitin

Former Member
0 Kudos

Hi Parama,

You need to restart your server, as RFC structure is cached on the server and since there is change in the structure, it is picking up the cached structure rather than updated one and giving this dump. If restart will not resolve your problem, then there are 2 possibilities either your development code is not transported to the production or ABAP structure change is not migrated to their Prod.(You can verify this by directly logging in through SAP GUI and verify that structure)

If you can give the details of the dump, then can confirm about whether its a metadata cache issue or code issue.

Regards,

Gurmat

Former Member
0 Kudos

Thanks Gurmat for the reply.

Please do refer to the piece of dump :

java.lang.ArrayIndexOutOfBoundsException: -1

at com.sap.aii.proxy.framework.core.JcoBaseTypeData.getElementValueAsBigDecimal(JcoBaseTypeData.java:648)

at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClass.getAttributeValueAsBigDecimal(DynamicRFCModelClass.java:259)

at com.ltitl.tdc.wd.modelr.tdc_wimsreport_model.Zsm_Wims_Det.getCsi(Zsm_Wims_Det.java:209)

at com.ltitl.tdc.wd.controller.tdc_datacust.wdp.IPublicTdc_DataCust$IWims_Report_OutputElement.getCsi(IPublicTdc_DataCust.java:13229)

at com.ltitl.tdc.wd.controller.tdc_uicust.Tdc_UICust.executeWIMSReport(Tdc_UICust.java:461)

at com.ltitl.tdc.wd.controller.tdc_uicust.wdp.InternalTdc_UICust.executeWIMSReport(InternalTdc_UICust.java:303)

at com.ltitl.tdc.wd.view.tdc_wimsreport_view.Tdc_WimsReport_View.onActionExecute(Tdc_WimsReport_View.java:594)

at com.ltitl.tdc.wd.view.tdc_wimsreport_view.wdp.InternalTdc_WimsReport_View.wdInvokeEventHandler(InternalTdc_WimsReport_View.java:339)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)

at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)

at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420)

at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132)

at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)

at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:321)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)

at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)

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)

Former Member
0 Kudos

Hi,

I told you at the beginning that

Please restart portal server.

That is the only solution (my strong guess).

We have faced this many times.

And go though this below link

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10465350-b4f5-2910-61ba-a58282b3...

See this secton in pdf document:

5. Disclaimer

The tool has been intended for ease of use and may not have tested all scenarios. In case some features donu2019t update, please restart the J2EE engine. Any support needed will be provided for the versions mentioned above released with the Web Dynpro Console.

Regards,

Charan

Former Member
0 Kudos

Hi Parama,

This is for Metadata cache issue. Please restart your server, this should resolve the problem. Let me know if problem still persists.

Gurmat

Former Member
0 Kudos

When you add new fields by reimporting the model,you have to restart the server.

It might be working in development server becoz it might be restarted after you did a reimport.

So for the new fields to be updated in the cahce of Production,I think you have to restart the Prodcution server also.Unfortunately this is the only solution for your issue.

Do the same as many of SDN memebers suggest

Former Member
0 Kudos

Hi Parama,

This is a meta data cache issue. Please restart the server.

The meta data cache is most common issue web dynpro has. As mentioned in my earlier post there is another option in the web dynpro console to invalidate the meta data cache. You can try the same if the SAP portal is has the functionality.

But, restart is best and ideal solution to the meta data cache issue.

Regards,

Kartikaye J Gomber

Former Member
0 Kudos

Hi Guys ,

Thanks a lot for all your replies.

Restarting the portal server only did solve my issue.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Parama,

As mentioned, this is a Meta data caching issue. The meta data of the BAPIs included in a model are cached in the portal, so that the meta data is not retrieved every time the model is executed. This because of performance reasons.

When the structure of the BAPI changes its meta data changes. Hence, the meta data cached on the portal does not match the one in the backend. The best option is to reimport and restart the server.

Another option is from SP 11 or 12 the Web Dynpro console has a Invalidation of ARFC Meta Data Cache functionality.

Please the following article on the functionality:

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10465350-b4f5-2910-61ba-a58282b3...

Remember to reimport the model in NWDS.

Regards,

Kartikaye

Former Member
0 Kudos

Hi parama laha,

I think the problem is in your code.

The reason why the issue is coming in Production and not in Development could be because of data. Some where you are trying to access an array element which is not present. Kindly paste your code where you are executing the RFC model.

Regards,

Jaya.

Former Member
0 Kudos

Hi,

This is an issue for Adaptive RFC Models

See this pdf link for complete details and resolution:

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10465350-b4f5-2910-61ba-a58282b3...

As per my knowledge final solution is restarting the Portal server.

See this part in pdf document:

5. Disclaimer

The tool has been intended for ease of use and may not have tested all scenarios. In case some features donu2019t update, please restart the J2EE engine. Any support needed will be provided for the versions mentioned above released with the Web Dynpro Console.

Regards,

Charan