You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Nishant Joshi (JIRA)" <tu...@ws.apache.org> on 2008/04/28 14:44:55 UTC

[jira] Created: (TUSCANY-2275) Problem when with Bean[] and null

Problem when with Bean[] and null
---------------------------------

                 Key: TUSCANY-2275
                 URL: https://issues.apache.org/jira/browse/TUSCANY-2275
             Project: Tuscany
          Issue Type: Bug
          Components: Java SCA Data Binding Runtime
    Affects Versions: Java-SCA-1.2
         Environment: Tuscnay 1.2-RC4, WAS
            Reporter: Nishant Joshi
             Fix For: Java-SCA-1.2


I have one service, in which i m passgin Bean[]... If i try to pass null instead then it gives exception 
-------------------------------------------------------------------------------------------------
Exception in thread "main" org.osoa.sca.ServiceRuntimeException: Target fault type cannot be resolved: null
	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:134)
	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286)
	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
	at $Proxy6.processBean(Unknown Source)
	at com.client.Client.processBean(Client.java:22)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:109)
	at org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286)
	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
	at org.apache.tuscany.sca.core.invocation.CglibProxyFactory$CglibMethodInterceptor.intercept(CglibProxyFactory.java:149)
	at com.client.Client$$EnhancerByCGLIB$$b5aedbbb.processBean(<generated>)
	at com.client.Client.main(Client.java:34)
Caused by: org.apache.tuscany.sca.interfacedef.util.FaultException: Array index out of range: 0
	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:97)
	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:78)
	... 15 more
Caused by: org.apache.axis2.AxisFault: Array index out of range: 0
	at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
	at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
	at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
	at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
	at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invokeTarget(Axis2BindingInvoker.java:118)
	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:89)
	... 16 more
-------------------------------------------------------------------------------------------------

please find the attached sample to reproduce it.
please note that this error was on client side and can be generated using attached sample...
same works for servcie having  bean (not an array of bean)


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TUSCANY-2275) Problem when with Bean[] and null

Posted by "Raymond Feng (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-2275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raymond Feng resolved TUSCANY-2275.
-----------------------------------

    Resolution: Won't Fix

Resolved as a user error.

> Problem when with Bean[] and null
> ---------------------------------
>
>                 Key: TUSCANY-2275
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2275
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>    Affects Versions: Java-SCA-1.2
>         Environment: Tuscnay 1.2-RC4, WAS
>            Reporter: Nishant Joshi
>            Assignee: Raymond Feng
>             Fix For: Java-SCA-1.2
>
>         Attachments: null problem.zip
>
>
> I have one service, in which i m passgin Bean[]... If i try to pass null instead then it gives exception 
> -------------------------------------------------------------------------------------------------
> Exception in thread "main" org.osoa.sca.ServiceRuntimeException: Target fault type cannot be resolved: null
> 	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:134)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
> 	at $Proxy6.processBean(Unknown Source)
> 	at com.client.Client.processBean(Client.java:22)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:109)
> 	at org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
> 	at org.apache.tuscany.sca.core.invocation.CglibProxyFactory$CglibMethodInterceptor.intercept(CglibProxyFactory.java:149)
> 	at com.client.Client$$EnhancerByCGLIB$$b5aedbbb.processBean(<generated>)
> 	at com.client.Client.main(Client.java:34)
> Caused by: org.apache.tuscany.sca.interfacedef.util.FaultException: Array index out of range: 0
> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:97)
> 	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:78)
> 	... 15 more
> Caused by: org.apache.axis2.AxisFault: Array index out of range: 0
> 	at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
> 	at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
> 	at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
> 	at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
> 	at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invokeTarget(Axis2BindingInvoker.java:118)
> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:89)
> 	... 16 more
> -------------------------------------------------------------------------------------------------
> please find the attached sample to reproduce it.
> please note that this error was on client side and can be generated using attached sample...
> same works for servcie having  bean (not an array of bean)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (TUSCANY-2275) Problem when with Bean[] and null

Posted by "Raymond Feng (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-2275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raymond Feng reassigned TUSCANY-2275:
-------------------------------------

    Assignee: Raymond Feng

> Problem when with Bean[] and null
> ---------------------------------
>
>                 Key: TUSCANY-2275
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2275
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>    Affects Versions: Java-SCA-1.2
>         Environment: Tuscnay 1.2-RC4, WAS
>            Reporter: Nishant Joshi
>            Assignee: Raymond Feng
>             Fix For: Java-SCA-1.2
>
>         Attachments: null problem.zip
>
>
> I have one service, in which i m passgin Bean[]... If i try to pass null instead then it gives exception 
> -------------------------------------------------------------------------------------------------
> Exception in thread "main" org.osoa.sca.ServiceRuntimeException: Target fault type cannot be resolved: null
> 	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:134)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
> 	at $Proxy6.processBean(Unknown Source)
> 	at com.client.Client.processBean(Client.java:22)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:109)
> 	at org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
> 	at org.apache.tuscany.sca.core.invocation.CglibProxyFactory$CglibMethodInterceptor.intercept(CglibProxyFactory.java:149)
> 	at com.client.Client$$EnhancerByCGLIB$$b5aedbbb.processBean(<generated>)
> 	at com.client.Client.main(Client.java:34)
> Caused by: org.apache.tuscany.sca.interfacedef.util.FaultException: Array index out of range: 0
> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:97)
> 	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:78)
> 	... 15 more
> Caused by: org.apache.axis2.AxisFault: Array index out of range: 0
> 	at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
> 	at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
> 	at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
> 	at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
> 	at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invokeTarget(Axis2BindingInvoker.java:118)
> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:89)
> 	... 16 more
> -------------------------------------------------------------------------------------------------
> please find the attached sample to reproduce it.
> please note that this error was on client side and can be generated using attached sample...
> same works for servcie having  bean (not an array of bean)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TUSCANY-2275) Problem when with Bean[] and null

Posted by "Nishant Joshi (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-2275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nishant Joshi updated TUSCANY-2275:
-----------------------------------

    Attachment: null problem.zip

> Problem when with Bean[] and null
> ---------------------------------
>
>                 Key: TUSCANY-2275
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2275
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>    Affects Versions: Java-SCA-1.2
>         Environment: Tuscnay 1.2-RC4, WAS
>            Reporter: Nishant Joshi
>             Fix For: Java-SCA-1.2
>
>         Attachments: null problem.zip
>
>
> I have one service, in which i m passgin Bean[]... If i try to pass null instead then it gives exception 
> -------------------------------------------------------------------------------------------------
> Exception in thread "main" org.osoa.sca.ServiceRuntimeException: Target fault type cannot be resolved: null
> 	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:134)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
> 	at $Proxy6.processBean(Unknown Source)
> 	at com.client.Client.processBean(Client.java:22)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:109)
> 	at org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
> 	at org.apache.tuscany.sca.core.invocation.CglibProxyFactory$CglibMethodInterceptor.intercept(CglibProxyFactory.java:149)
> 	at com.client.Client$$EnhancerByCGLIB$$b5aedbbb.processBean(<generated>)
> 	at com.client.Client.main(Client.java:34)
> Caused by: org.apache.tuscany.sca.interfacedef.util.FaultException: Array index out of range: 0
> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:97)
> 	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:78)
> 	... 15 more
> Caused by: org.apache.axis2.AxisFault: Array index out of range: 0
> 	at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
> 	at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
> 	at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
> 	at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
> 	at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invokeTarget(Axis2BindingInvoker.java:118)
> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:89)
> 	... 16 more
> -------------------------------------------------------------------------------------------------
> please find the attached sample to reproduce it.
> please note that this error was on client side and can be generated using attached sample...
> same works for servcie having  bean (not an array of bean)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (TUSCANY-2275) Problem when with Bean[] and null

Posted by Simon Nash <na...@apache.org>.
Simon Nash wrote:
> Raymond Feng (JIRA) wrote:
>>     [ 
>> https://issues.apache.org/jira/browse/TUSCANY-2275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12593441#action_12593441 
>> ]
>> Raymond Feng commented on TUSCANY-2275:
>> ---------------------------------------
>>
>> Hi,
>>
>> I debugged the issue and it turned out an interesting case.
>> 1) When the client side pass 'null' for the service.processBean() 
>> method, the body of soap message becomes:
>>
>> <ns1:processBean xmlns1="..."/>
>>
>> It's the wrapper element with empty children.
>>
>> 2) On the receiving side, the empty data get converted into 
>> SimpleBean[0] which is an empty array of SimpleBean.
>>
>> 3) The user code in SimpleServiceImpl.java only tests if the 
>> simpleBean==null and it causes an ArrayOutofBoundException. Adding the 
>> test of simpleBean.length>0 fixes the problem and the client runs 
>> successfuly.
>>
>> I would resolve it as a user error. I'm not so sure if we should 
>> present the data as null or [0]. If you can find any spec covering 
>> this corner case, I would be happy to revisit it.
>>
> I think the marshalled form should be a wrapper containing a Bean
> element with xsi:nil="true", not an empty wrapper.  Would this be
> unmarshalled as null instead of an empty array?
> 
To answer my own question, this would be unmarshalled as an array of
length 1 containing a single null.  This seems correct.  Unfortunately
it seems that there is no way to disambiguate this case from the null
array case.  I will do some more investigation into this.

   Simon

>   Simon
> 
>> Thanks,
>> Raymond
>>
>>> Problem when with Bean[] and null
>>> ---------------------------------
>>>
>>>                 Key: TUSCANY-2275
>>>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2275
>>>             Project: Tuscany
>>>          Issue Type: Bug
>>>          Components: Java SCA Data Binding Runtime
>>>    Affects Versions: Java-SCA-1.2
>>>         Environment: Tuscnay 1.2-RC4, WAS
>>>            Reporter: Nishant Joshi
>>>            Assignee: Raymond Feng
>>>             Fix For: Java-SCA-1.2
>>>
>>>         Attachments: null problem.zip
>>>
>>>
>>> I have one service, in which i m passgin Bean[]... If i try to pass 
>>> null instead then it gives exception 
>>> ------------------------------------------------------------------------------------------------- 
>>>
>>> Exception in thread "main" org.osoa.sca.ServiceRuntimeException: 
>>> Target fault type cannot be resolved: null
>>>     at 
>>> org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:134) 
>>>
>>>     at 
>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286) 
>>>
>>>     at 
>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154) 
>>>
>>>     at $Proxy6.processBean(Unknown Source)
>>>     at com.client.Client.processBean(Client.java:22)
>>>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>     at 
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>>
>>>     at 
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>>>
>>>     at java.lang.reflect.Method.invoke(Method.java:585)
>>>     at 
>>> org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:109) 
>>>
>>>     at 
>>> org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61) 
>>>
>>>     at 
>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286) 
>>>
>>>     at 
>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154) 
>>>
>>>     at 
>>> org.apache.tuscany.sca.core.invocation.CglibProxyFactory$CglibMethodInterceptor.intercept(CglibProxyFactory.java:149) 
>>>
>>>     at 
>>> com.client.Client$$EnhancerByCGLIB$$b5aedbbb.processBean(<generated>)
>>>     at com.client.Client.main(Client.java:34)
>>> Caused by: org.apache.tuscany.sca.interfacedef.util.FaultException: 
>>> Array index out of range: 0
>>>     at 
>>> org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:97) 
>>>
>>>     at 
>>> org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:78) 
>>>
>>>     ... 15 more
>>> Caused by: org.apache.axis2.AxisFault: Array index out of range: 0
>>>     at 
>>> org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486) 
>>>
>>>     at 
>>> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343) 
>>>
>>>     at 
>>> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389) 
>>>
>>>     at 
>>> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211) 
>>>
>>>     at 
>>> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163) 
>>>
>>>     at 
>>> org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invokeTarget(Axis2BindingInvoker.java:118) 
>>>
>>>     at 
>>> org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:89) 
>>>
>>>     ... 16 more
>>> ------------------------------------------------------------------------------------------------- 
>>>
>>> please find the attached sample to reproduce it.
>>> please note that this error was on client side and can be generated 
>>> using attached sample...
>>> same works for servcie having  bean (not an array of bean)
>>
> 
> 


Re: [jira] Commented: (TUSCANY-2275) Problem when with Bean[] and null

Posted by Simon Nash <na...@apache.org>.
Raymond Feng (JIRA) wrote:
>     [ https://issues.apache.org/jira/browse/TUSCANY-2275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12593441#action_12593441 ] 
> 
> Raymond Feng commented on TUSCANY-2275:
> ---------------------------------------
> 
> Hi,
> 
> I debugged the issue and it turned out an interesting case. 
> 
> 1) When the client side pass 'null' for the service.processBean() method, the body of soap message becomes:
> 
> <ns1:processBean xmlns1="..."/>
> 
> It's the wrapper element with empty children.
> 
> 2) On the receiving side, the empty data get converted into SimpleBean[0] which is an empty array of SimpleBean.
> 
> 3) The user code in SimpleServiceImpl.java only tests if the simpleBean==null and it causes an ArrayOutofBoundException. Adding the test of simpleBean.length>0 fixes the problem and the client runs successfuly.
> 
> I would resolve it as a user error. I'm not so sure if we should present the data as null or [0]. If you can find any spec covering this corner case, I would be happy to revisit it.
> 
I think the marshalled form should be a wrapper containing a Bean
element with xsi:nil="true", not an empty wrapper.  Would this be
unmarshalled as null instead of an empty array?

   Simon

> Thanks,
> Raymond
> 
>> Problem when with Bean[] and null
>> ---------------------------------
>>
>>                 Key: TUSCANY-2275
>>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2275
>>             Project: Tuscany
>>          Issue Type: Bug
>>          Components: Java SCA Data Binding Runtime
>>    Affects Versions: Java-SCA-1.2
>>         Environment: Tuscnay 1.2-RC4, WAS
>>            Reporter: Nishant Joshi
>>            Assignee: Raymond Feng
>>             Fix For: Java-SCA-1.2
>>
>>         Attachments: null problem.zip
>>
>>
>> I have one service, in which i m passgin Bean[]... If i try to pass null instead then it gives exception 
>> -------------------------------------------------------------------------------------------------
>> Exception in thread "main" org.osoa.sca.ServiceRuntimeException: Target fault type cannot be resolved: null
>> 	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:134)
>> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286)
>> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
>> 	at $Proxy6.processBean(Unknown Source)
>> 	at com.client.Client.processBean(Client.java:22)
>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> 	at java.lang.reflect.Method.invoke(Method.java:585)
>> 	at org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:109)
>> 	at org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
>> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286)
>> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
>> 	at org.apache.tuscany.sca.core.invocation.CglibProxyFactory$CglibMethodInterceptor.intercept(CglibProxyFactory.java:149)
>> 	at com.client.Client$$EnhancerByCGLIB$$b5aedbbb.processBean(<generated>)
>> 	at com.client.Client.main(Client.java:34)
>> Caused by: org.apache.tuscany.sca.interfacedef.util.FaultException: Array index out of range: 0
>> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:97)
>> 	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:78)
>> 	... 15 more
>> Caused by: org.apache.axis2.AxisFault: Array index out of range: 0
>> 	at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
>> 	at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
>> 	at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
>> 	at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
>> 	at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
>> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invokeTarget(Axis2BindingInvoker.java:118)
>> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:89)
>> 	... 16 more
>> -------------------------------------------------------------------------------------------------
>> please find the attached sample to reproduce it.
>> please note that this error was on client side and can be generated using attached sample...
>> same works for servcie having  bean (not an array of bean)
> 


[jira] Commented: (TUSCANY-2275) Problem when with Bean[] and null

Posted by "Raymond Feng (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-2275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12593441#action_12593441 ] 

Raymond Feng commented on TUSCANY-2275:
---------------------------------------

Hi,

I debugged the issue and it turned out an interesting case. 

1) When the client side pass 'null' for the service.processBean() method, the body of soap message becomes:

<ns1:processBean xmlns1="..."/>

It's the wrapper element with empty children.

2) On the receiving side, the empty data get converted into SimpleBean[0] which is an empty array of SimpleBean.

3) The user code in SimpleServiceImpl.java only tests if the simpleBean==null and it causes an ArrayOutofBoundException. Adding the test of simpleBean.length>0 fixes the problem and the client runs successfuly.

I would resolve it as a user error. I'm not so sure if we should present the data as null or [0]. If you can find any spec covering this corner case, I would be happy to revisit it.

Thanks,
Raymond

> Problem when with Bean[] and null
> ---------------------------------
>
>                 Key: TUSCANY-2275
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2275
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>    Affects Versions: Java-SCA-1.2
>         Environment: Tuscnay 1.2-RC4, WAS
>            Reporter: Nishant Joshi
>            Assignee: Raymond Feng
>             Fix For: Java-SCA-1.2
>
>         Attachments: null problem.zip
>
>
> I have one service, in which i m passgin Bean[]... If i try to pass null instead then it gives exception 
> -------------------------------------------------------------------------------------------------
> Exception in thread "main" org.osoa.sca.ServiceRuntimeException: Target fault type cannot be resolved: null
> 	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:134)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
> 	at $Proxy6.processBean(Unknown Source)
> 	at com.client.Client.processBean(Client.java:22)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:109)
> 	at org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
> 	at org.apache.tuscany.sca.core.invocation.CglibProxyFactory$CglibMethodInterceptor.intercept(CglibProxyFactory.java:149)
> 	at com.client.Client$$EnhancerByCGLIB$$b5aedbbb.processBean(<generated>)
> 	at com.client.Client.main(Client.java:34)
> Caused by: org.apache.tuscany.sca.interfacedef.util.FaultException: Array index out of range: 0
> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:97)
> 	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:78)
> 	... 15 more
> Caused by: org.apache.axis2.AxisFault: Array index out of range: 0
> 	at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
> 	at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
> 	at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
> 	at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
> 	at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invokeTarget(Axis2BindingInvoker.java:118)
> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:89)
> 	... 16 more
> -------------------------------------------------------------------------------------------------
> please find the attached sample to reproduce it.
> please note that this error was on client side and can be generated using attached sample...
> same works for servcie having  bean (not an array of bean)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (TUSCANY-2275) Problem when with Bean[] and null

Posted by "Nishant Joshi (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-2275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12594156#action_12594156 ] 

nishantrjoshi edited comment on TUSCANY-2275 at 5/5/08 9:26 PM:
----------------------------------------------------------------

Hi Raymond,
You are absolutely right... but if you change the method signature as below then it will throw exception....

SimpleBean processBean(int n,SimpleBean simpleBean[]);

and from client change it as...

SimpleBean fromServiceSimpleBean = service.processBean(1,null);

If you add the diff. parameter like i have added then error msg will change like 
SimpleBean processBean(int n, foat f, SimpleBean simpleBean[]);
then

java.lang.IndexOutOfBoundsException: Index: 2, Size: 2.

if you put "SimpleBean simpleBean[]" as first parameter then it will not come as null as what you have mentioned......like "SimpleBean processBean(SimpleBean simpleBean[], int n);"

Conclusion is if you put your Bean[] at last parameter place and pass null value from client it will throw error.

error on service side will come for "SimpleBean processBean(int n,SimpleBean simpleBean[]);"  like.....................................

also please note that this error was come before executing anything of the method.

java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
                                 org.osoa.sca.ServiceRuntimeException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
	at org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:123)
	at org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:89)
	at org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:83)
	at org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.invoke(RuntimeWireImpl.java:138)
	at org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceProvider.invokeTarget(Axis2ServiceProvider.java:641)
	at org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceInOutSyncMessageReceiver.invokeBusinessLogic(Axis2ServiceInOutSyncMessageReceiver.java:68)
	at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:42)
	at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
	at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
	at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at org.apache.tuscany.sca.host.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:102)
	at org.apache.tuscany.sca.host.webapp.TuscanyServletFilter.doFilter(TuscanyServletFilter.java:91)
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:761)
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:673)
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:688)
	at com.ibm.ws.wswebcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:101)
	at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:758)
	at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:718)
	at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:113)
	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3276)
	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
	at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:113)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
	at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
	at java.util.ArrayList.RangeCheck(ArrayList.java:572)
	at java.util.ArrayList.get(ArrayList.java:347)
	at org.apache.tuscany.sca.databinding.axiom.OMElementWrapperHandler.getChild(OMElementWrapperHandler.java:161)
	at org.apache.tuscany.sca.databinding.axiom.OMElementWrapperHandler.getChildren(OMElementWrapperHandler.java:95)
	at org.apache.tuscany.sca.databinding.axiom.OMElementWrapperHandler.getChildren(OMElementWrapperHandler.java:47)
	at org.apache.tuscany.sca.core.databinding.transformers.Input2InputTransformer.transform(Input2InputTransformer.java:175)
	at org.apache.tuscany.sca.core.databinding.transformers.Input2InputTransformer.transform(Input2InputTransformer.java:43)
	at org.apache.tuscany.sca.databinding.impl.MediatorImpl.mediate(MediatorImpl.java:73)
	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.transform(DataTransformationInterceptor.java:186)
	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:76)
	at org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:114)

      was (Author: nishantrjoshi):
    Hi Raymond,
You are absolutely right... but if you change the method signature as below then it will throw exception....

SimpleBean processBean(int n,SimpleBean simpleBean[]);

and from client change it as...

SimpleBean fromServiceSimpleBean = service.processBean(1,null);

If you add the diff. parameter like i have added then error msg will change like 
SimpleBean processBean(int n, foat f, SimpleBean simpleBean[]);
then

java.lang.IndexOutOfBoundsException: Index: 2, Size: 2.

if you put "SimpleBean simpleBean[]" as first parameter then it will not come as null as what you have mentioned......like "SimpleBean processBean(SimpleBean simpleBean[], int n);"

Conclusion is if you put your Bean[] at last parameter place and pass null value from client it will throw error.

error on service side will come for "SimpleBean processBean(int n,SimpleBean simpleBean[]);"  like.....................................



java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
                                 org.osoa.sca.ServiceRuntimeException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
	at org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:123)
	at org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:89)
	at org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:83)
	at org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.invoke(RuntimeWireImpl.java:138)
	at org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceProvider.invokeTarget(Axis2ServiceProvider.java:641)
	at org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceInOutSyncMessageReceiver.invokeBusinessLogic(Axis2ServiceInOutSyncMessageReceiver.java:68)
	at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:42)
	at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
	at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
	at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at org.apache.tuscany.sca.host.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:102)
	at org.apache.tuscany.sca.host.webapp.TuscanyServletFilter.doFilter(TuscanyServletFilter.java:91)
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:761)
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:673)
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:688)
	at com.ibm.ws.wswebcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:101)
	at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:758)
	at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:718)
	at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:113)
	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3276)
	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
	at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:113)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
	at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
	at java.util.ArrayList.RangeCheck(ArrayList.java:572)
	at java.util.ArrayList.get(ArrayList.java:347)
	at org.apache.tuscany.sca.databinding.axiom.OMElementWrapperHandler.getChild(OMElementWrapperHandler.java:161)
	at org.apache.tuscany.sca.databinding.axiom.OMElementWrapperHandler.getChildren(OMElementWrapperHandler.java:95)
	at org.apache.tuscany.sca.databinding.axiom.OMElementWrapperHandler.getChildren(OMElementWrapperHandler.java:47)
	at org.apache.tuscany.sca.core.databinding.transformers.Input2InputTransformer.transform(Input2InputTransformer.java:175)
	at org.apache.tuscany.sca.core.databinding.transformers.Input2InputTransformer.transform(Input2InputTransformer.java:43)
	at org.apache.tuscany.sca.databinding.impl.MediatorImpl.mediate(MediatorImpl.java:73)
	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.transform(DataTransformationInterceptor.java:186)
	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:76)
	at org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:114)
  
> Problem when with Bean[] and null
> ---------------------------------
>
>                 Key: TUSCANY-2275
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2275
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>    Affects Versions: Java-SCA-1.2
>         Environment: Tuscnay 1.2-RC4, WAS
>            Reporter: Nishant Joshi
>            Assignee: Raymond Feng
>             Fix For: Java-SCA-1.2
>
>         Attachments: null problem.zip
>
>
> I have one service, in which i m passgin Bean[]... If i try to pass null instead then it gives exception 
> -------------------------------------------------------------------------------------------------
> Exception in thread "main" org.osoa.sca.ServiceRuntimeException: Target fault type cannot be resolved: null
> 	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:134)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
> 	at $Proxy6.processBean(Unknown Source)
> 	at com.client.Client.processBean(Client.java:22)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:109)
> 	at org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
> 	at org.apache.tuscany.sca.core.invocation.CglibProxyFactory$CglibMethodInterceptor.intercept(CglibProxyFactory.java:149)
> 	at com.client.Client$$EnhancerByCGLIB$$b5aedbbb.processBean(<generated>)
> 	at com.client.Client.main(Client.java:34)
> Caused by: org.apache.tuscany.sca.interfacedef.util.FaultException: Array index out of range: 0
> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:97)
> 	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:78)
> 	... 15 more
> Caused by: org.apache.axis2.AxisFault: Array index out of range: 0
> 	at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
> 	at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
> 	at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
> 	at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
> 	at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invokeTarget(Axis2BindingInvoker.java:118)
> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:89)
> 	... 16 more
> -------------------------------------------------------------------------------------------------
> please find the attached sample to reproduce it.
> please note that this error was on client side and can be generated using attached sample...
> same works for servcie having  bean (not an array of bean)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (TUSCANY-2275) Problem when with Bean[] and null

Posted by "Nishant Joshi (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-2275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nishant Joshi reopened TUSCANY-2275:
------------------------------------


Hi Raymond,
You are absolutely right... but if you change the method signature as below then it will throw exception....

SimpleBean processBean(int n,SimpleBean simpleBean[]);

and from client change it as...

SimpleBean fromServiceSimpleBean = service.processBean(1,null);

If you add the diff. parameter like i have added then error msg will change like 
SimpleBean processBean(int n, foat f, SimpleBean simpleBean[]);
then

java.lang.IndexOutOfBoundsException: Index: 2, Size: 2.

if you put "SimpleBean simpleBean[]" as first parameter then it will not come as null as what you have mentioned......like "SimpleBean processBean(SimpleBean simpleBean[], int n);"

Conclusion is if you put your Bean[] at last parameter place and pass null value from client it will throw error.

error on service side will come for "SimpleBean processBean(int n,SimpleBean simpleBean[]);"  like.....................................



java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
                                 org.osoa.sca.ServiceRuntimeException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
	at org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:123)
	at org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:89)
	at org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:83)
	at org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.invoke(RuntimeWireImpl.java:138)
	at org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceProvider.invokeTarget(Axis2ServiceProvider.java:641)
	at org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceInOutSyncMessageReceiver.invokeBusinessLogic(Axis2ServiceInOutSyncMessageReceiver.java:68)
	at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:42)
	at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
	at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
	at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at org.apache.tuscany.sca.host.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:102)
	at org.apache.tuscany.sca.host.webapp.TuscanyServletFilter.doFilter(TuscanyServletFilter.java:91)
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:761)
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:673)
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:688)
	at com.ibm.ws.wswebcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:101)
	at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:758)
	at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:718)
	at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:113)
	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3276)
	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
	at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:113)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
	at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
	at java.util.ArrayList.RangeCheck(ArrayList.java:572)
	at java.util.ArrayList.get(ArrayList.java:347)
	at org.apache.tuscany.sca.databinding.axiom.OMElementWrapperHandler.getChild(OMElementWrapperHandler.java:161)
	at org.apache.tuscany.sca.databinding.axiom.OMElementWrapperHandler.getChildren(OMElementWrapperHandler.java:95)
	at org.apache.tuscany.sca.databinding.axiom.OMElementWrapperHandler.getChildren(OMElementWrapperHandler.java:47)
	at org.apache.tuscany.sca.core.databinding.transformers.Input2InputTransformer.transform(Input2InputTransformer.java:175)
	at org.apache.tuscany.sca.core.databinding.transformers.Input2InputTransformer.transform(Input2InputTransformer.java:43)
	at org.apache.tuscany.sca.databinding.impl.MediatorImpl.mediate(MediatorImpl.java:73)
	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.transform(DataTransformationInterceptor.java:186)
	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:76)
	at org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:114)

> Problem when with Bean[] and null
> ---------------------------------
>
>                 Key: TUSCANY-2275
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2275
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>    Affects Versions: Java-SCA-1.2
>         Environment: Tuscnay 1.2-RC4, WAS
>            Reporter: Nishant Joshi
>            Assignee: Raymond Feng
>             Fix For: Java-SCA-1.2
>
>         Attachments: null problem.zip
>
>
> I have one service, in which i m passgin Bean[]... If i try to pass null instead then it gives exception 
> -------------------------------------------------------------------------------------------------
> Exception in thread "main" org.osoa.sca.ServiceRuntimeException: Target fault type cannot be resolved: null
> 	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:134)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
> 	at $Proxy6.processBean(Unknown Source)
> 	at com.client.Client.processBean(Client.java:22)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:109)
> 	at org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286)
> 	at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
> 	at org.apache.tuscany.sca.core.invocation.CglibProxyFactory$CglibMethodInterceptor.intercept(CglibProxyFactory.java:149)
> 	at com.client.Client$$EnhancerByCGLIB$$b5aedbbb.processBean(<generated>)
> 	at com.client.Client.main(Client.java:34)
> Caused by: org.apache.tuscany.sca.interfacedef.util.FaultException: Array index out of range: 0
> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:97)
> 	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:78)
> 	... 15 more
> Caused by: org.apache.axis2.AxisFault: Array index out of range: 0
> 	at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
> 	at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
> 	at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
> 	at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
> 	at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invokeTarget(Axis2BindingInvoker.java:118)
> 	at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:89)
> 	... 16 more
> -------------------------------------------------------------------------------------------------
> please find the attached sample to reproduce it.
> please note that this error was on client side and can be generated using attached sample...
> same works for servcie having  bean (not an array of bean)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.