cancel
Showing results for 
Search instead for 
Did you mean: 

java.lang.ArrayIndexOutOfBoundsException: -1

Former Member
0 Kudos

Hello Experts,

I had an exsisting RFC where i have added a table to save values of

'user roles' and changed the source code likewise and activate

it.The RFC at R3 is executing fine and giving the desired output.

For dynpro end, i reimported the model after the change in RFC but

am getting the following error :

java.lang.ArrayIndexOutOfBoundsException: -1

Am enclosing the code below :

-


-


IPublicTdc_DataCust.IZsm_Save_Userskill_InputNode saveNode = wdThis

.wdGetTdc_DataCustController()

.wdGetContext()

.nodeZsm_Save_Userskill_Input();

IPublicTdc_DataCust.IZsm_Save_Userskill_InputElement saveEle = null;

IPublicTdc_UICust.ICtx_vn_RoleNode RoleNode = wdContext.nodeCtx_vn_Role()IPublicTdc_UICust.ICtx_vn_RoleElement RoleElement = null;

Zsm_Save_Userskill_Input userSkillIp = new

Zsm_Save_Userskill_Input();

Zsm_Role_User userRole = null;

userRole = new Zsm_Role_User();

if(RoleNode.size()>0)

{

userRole.setUser_Id("283002");

userRole.setUser_Role("QL");

try

{

userSkillIp.addIt_Role_User(userRole)

}

catch(Exception e)

{

wdComponentAPI.getMessageManager().reportException("in catch

for role user :"+ e.toString(),false);

}

}

saveNode.bind(userSkillIp);

wdThis.wdGetTdc_DataCustController().executeZsm_Save_UserSkill_Inpu

t();

-


-


Executing it i get the following error at dynpro end :

in catch for role user :java.lang.ArrayIndexOutOfBoundsException:

-1

Any clues on the same ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please restart the server (cleans the cache) & then Deploy New Archive & Run the application.

Hope this solves your issue.

Kind Regards,

Nitin

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi...

I am modifying your code from begonning.....

firtly you have created one method in Component controller and one method in interface controller

component contlorer method---as your code executeZsm_Save_UserSkill_Inpu

public void executeZsm_Save_UserSkill_Input(){

//IPublicTdc_DataCust.IZsm_Save_Userskill_InputNode saveNode = wdThis

//.wdGetTdc_DataCustController()

//.wdGetContext()

//.nodeZsm_Save_Userskill_Input();

//whty i am commented for tjhis node belong to your ocmponent contlooer .no need to fetch this contrlooer method

IPublicTdc_DataCust.IZsm_Save_Userskill_InputNode saveNode =wdContext.nodeZsm_Save_Userskill_Input();

Zsm_Save_Userskill_Input userSkillIp = new

Zsm_Save_Userskill_Input();

//should be bind

wdcontext.nodeZsm_Save_Userskill_Input().bind(userSkillIp );

Zsm_Role_User userRole = null;

userRole = new Zsm_Role_User();

if(RoleNode.size()>0)

{

userRole.setUser_Id("283002");

userRole.setUser_Role("QL");

try

{

userSkillIp.addIt_Role_User(userRole)

}

catch(Exception e)

{

wdComponentAPI.getMessageManager().reportException("in catch

for role user :"+ e.toString(),false);

}

}

//if you bind to any node likeIZsm_Save_Userskill_InputNode

wdcontext.currentZsm_Save_Userskill_InputElement().modelobject().excute();

wdcontext.nodeoutput().invalidate();

//after execute should be bind...

saveNode.bind(userSkillIp);

}

create one custom method ininterface contlooer method as---callComonentMethod.

public void callComonentMethod(){

wdThis.wdGetTdc_DataCustController().executeZsm_Save_UserSkill_Input();

}

hope this will get your solution

thanks

jati

Edited by: sudhir kumar on Apr 25, 2009 9:30 AM

RadouaneSbaa
Explorer
0 Kudos

Hi,

I have simplified your code


	IPublicTdc_DataCust.IZsm_Save_Userskill_InputNode saveNode = 
		wdThis.wdGetTdc_DataCustController().wdGetContext().nodeZsm_Save_Userskill_Input();
		
//	IPublicTdc_DataCust.IZsm_Save_Userskill_InputElement saveEle = null;

	Zsm_Save_Userskill_Input userSkillIp = new Zsm_Save_Userskill_Input();
	Zsm_Role_User userRole = new Zsm_Role_User();

	userRole.setUser_Id("283002");
	userRole.setUser_Role("QL");

	userSkillIp.addIt_Role_User(userRole) ;

	saveNode.bind(userSkillIp);

	wdThis.wdGetTdc_DataCustController().executeZsm_Save_UserSkill_Input();

It seems good.

Are yo sure there is no error managing nodeRole

(you have truncated the code, so we cannot see...)

Kind regards,

Radouane SBAA