[ 
https://issues.apache.org/jira/browse/AXIS2-1835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12471293
 ] 

Federica Ciotti commented on AXIS2-1835:
----------------------------------------

Client code:
public class Test1 {
        public static void main(String[] args){

                RPCServiceClient sender = null;
                try{
                        sender = new RPCServiceClient();
                        EndpointReference targetEPR = new 
EndpointReference("http://localhost:8080/axis2/services/findService/";);
                        EndpointReference myEPR = new 
EndpointReference("http://localhost:8080/axis2/services/clientService";);

                        Options options = new Options();
                        options.setTo(targetEPR);
                        options.setFrom(myEPR);
                        sender.setOptions(options);

                        /*QName opInit = new QName("http://one/xsd";, 
"initFind");
                Object[] arg1 = new Object[] {};
                sender.invokeRobust(opInit, arg1);*/

                        QName opget = new QName("http://one/xsd";, 
"getFindResult");
                        Object[] arg = new Object[] {}; 
                        Class[] returnTypes = new Class[] {FindResult.class};

                        Object[] response = sender.invokeBlocking(opget, arg, 
returnTypes);
                        FindResult al = (FindResult) response[0];
                        if (al == null) {System.out.println("Null");}
                        else { 
                                System.out.println("not null");
                                ArrayList<String> list = al.getList();
                                System.out.println(list.get(0));
                        }

                        /*OMElement OMresponse = sender.invokeBlocking(opget, 
arg);
                String s = OMresponse.toString();
                System.out.println(s);*/

                }catch(AxisFault a){System.out.println("AxisFault in main"); 
a.printStackTrace();  } 

        }
}
--------------------------
Service Code:
package one;
public class FindResult {
        private ArrayList<String> myList = new ArrayList<String>();
        
        public FindResult(){
                myList.add("test");
                myList.add("test1");}
        
        public ArrayList<String> getList() {
            return myList;}
}
package one;
public class ServiceFindResult {
        
private FindResult res = new FindResult();
        
        public void initFind(){
                res = new FindResult();}
        
        public FindResult getFindResult(){
                return res;}
}


> return a java.lang.List return a java.lang.IllegalArgumentException: null rcl
> -----------------------------------------------------------------------------
>
>                 Key: AXIS2-1835
>                 URL: https://issues.apache.org/jira/browse/AXIS2-1835
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: databinding
>    Affects Versions: 1.1
>         Environment: jdk 1.5
>            Reporter: Benoit Decherf
>         Assigned To: Deepal Jayasinghe
>         Attachments: patchBeanUtil.patch, patchSimpleTypeMapper.patch
>
>
> I want to create a service which return an object containing a List:
> The object to return:
> public class Container {
>   private List myList = new ArrayList();
>   public List getList() {
>     return myList;
>   }
> }
> The service (pojo) :
> public class MyService {
>   private Container container = new Container();
>   public Container getContainer() {
>     container.getList().add("a test");
>     return container;
>   }
> }
> When I try to access the service I receive an Exception:
> Caused by: java.lang.IllegalArgumentException: null rcl
>         at 
> org.codehaus.jam.internal.reflect.ReflectClassBuilder.<init>(ReflectClassBuilder.java:47)
>         at 
> org.codehaus.jam.provider.JamServiceFactoryImpl.createBuilder(JamServiceFactoryImpl.java:173)
> I checked the code, and I saw in the class 
> org/apache/axis2/databinding/utils/BeanUtil, The only object I can use to 
> send a list is the ArrayList. Why ?
> I change the isArrayList method in 
> org/apache/axis2/databinding/typemapping/SimpleTypeMapper to detect a 
> java.util.List instead of just the ArrayList and it works fine. So why limit 
> to ArrayList (and not just Collection)?
> I think there is an other bug which return the IllegalArgumentException in 
> org.codehaus.jam.internal.reflect.ReflectClassBuilder.java:
> In the method getPullParser of the class BeanUtil, there is no check on what 
> returns beanObject.getClass().getClassLoader() before doing the 
> addClassLoader.
> Some implementations may use null to represent the bootstrap class loader. 
> This method will return null in such implementations if this class was loaded 
> by the bootstrap class loader. So that explain why the error is "null rcl".
> Thanks,
> Benoit

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to