cancel
Showing results for 
Search instead for 
Did you mean: 

ArrayIndexOutOfBoundsException

Former Member
0 Kudos

Hey Experts,

I am facing simple mapping problem.

My source structure is as follows

Details... 1...unbound

-


name..1..1

-


empid..1..1

Target structure is also same

I have following UDF

if(a.length == 0 )

Throw CustomException();

else

result.addValue(a[0]).

Mapping:

name - UDF - name

empid - UDF - empid.

I have given folloiwng values while testing

Details

-- name - abc

-- empid - 123

Details

-- empid - 234

If I am not giving the "name" at first level it is throwing custom exception

If I am not giving the "name: at second level ( like ex specified above) it is not throwing the custom exception it is throwing ArrayIndexOutOfBoundsException 0.

Can any one suggest me why?

Regards

Sowmya

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Sowmya:

Your testing scenario violate your data type schema:

Your "Details" occur from 1, it means your your source message, you will have at least 1 "Details" node.

Inside your your "Details", you have "name" and 'empid", they are both 1:1, means under your "detals" node,

you have to pass "name" node and "empid" node.

However, in your test, you did not pass your "name" node, it violate your data type defination.

I think your UDF is "Queue" type, so it only process your first context, this is the reason that you got exception when you did not pass your first name. and you did not get exception for missing second "name".

If you change your UDF to "Context" type, you will see exception when you missing second "name"

Regards.

Liang

Edited by: Liang Ji on Mar 17, 2009 7:42 PM

Former Member
0 Kudos

Hi Liang

My UDF is of type "Context" only but still I am getting the same error.

Regards

Sowmya

Former Member
0 Kudos

Check the context level of each node.

This will help.

Nilesh

Former Member
0 Kudos

Sowmya,

Check out the all inputs to your UDF having same number of inputs or node context is set properly.

This problem is because of the context level. You can right click on node and set context level.

Hope this will help.

Nilesh