SimpleTypeMapper.getOMElement throws a NullPointerException in AXIS 2.1.1 
release when given a java.util.List with some VO. In case of List of Strings it 
works fine.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: AXIS2-2288
                 URL: https://issues.apache.org/jira/browse/AXIS2-2288
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: adb
    Affects Versions: 1.1
         Environment: WIndows XP, AXIS 2.1.1 final release. 
            Reporter: Nilesh Ghorpade


Below is the method which is used for populating the List and serializaing and 
de-serializing the same.

public void testConvertFromJavaToAXIS2_ListConverion() throws Exception{
                                String namespace = "http://vo.sdm.msc.com";;
                                String prefix = "vo";
                                String localPart = "units";

                                QName qnameList = new QName(namespace, 
localPart, prefix);
                                List lstToConvertToOMElement = new ArrayList();

                                //Populate the list with some data.

                                List testUnits = new ArrayList();
                                testUnits.add(new Integer(100));

                                MySampleVO objSdmTableColumn = new 
MySampleVO("test_name",
                                                                                
                                                          "test_label",
                                                                                
                                                          
"test_expressionString",
                                                                                
                                          "test_type",
                                                                                
                                          "test_quantityType",
                                                                                
                                           testUnits,
                                                                                
                                          "test_format");

                                lstToConvertToOMElement.add(objSdmTableColumn);

                                System.out.println(" 
lstToConvertToOMElement.size() " + lstToConvertToOMElement.size());

                                OMElement omLstElement = 
org.apache.axis2.databinding.utils.BeanUtil.getOMElement(qnameList,
                                                                                
                                                                                
                                  lstToConvertToOMElement.toArray(),
                                                                                
                                                                                
                                  new QName("SdmTableColumn"),
                                                                                
                                                                                
                                  true,
                                                                                
                                                                                
                                  new TypeTable());



                                if(omLstElement != null){
                                        System.out.println(" OMElement is 
obtained. omLstElement ");
                                }

                                List objListType = 
(List)BeanUtil.processObject(omLstElement, java.util.ArrayList.class, null, 
true, new DefaultObjectSupplier());
                                if(objListType instanceof List){
                                        System.out.println(" 
Yessssssssssssssssssssssss got the List object back" );
                                        List lstDeserialized = 
(List)objListType;
                                        System.out.println(" 
lstDeserialized.size() " + lstDeserialized.size());
                                        java.util.Iterator itrList = 
lstDeserialized.iterator();
                                        while(itrList.hasNext()){
                                                        Object obj = 
itrList.next();
                                                        System.out.println(" 
Yessssssssssssssssssssssss got the object back from the list " + obj);
                                        }
                                }
}



The MySampleVO code is pasted below



import java.io.Serializable;
import java.util.List;

public class MySampleVO implements Serializable {
    
        private String name;
        private String label;
        private String expressionString;
        private String type;
        private boolean marked;
        private String quantityType;
        private List units;
        private String format;
    
    public MySampleVO() {
        this (null, null, null, null, null, null, null);
    }

    
    public MySampleVO(String name, String label, String expressionString,
                          String type, String quantityType, List units,
                          String format) {
        this.name = name;
        this.label = label;
        this.expressionString = expressionString;
        this.type = type;
        this.quantityType = quantityType;
        this.units = units;
        this.format = format;
    }

    public String getName() {
        return name;
    }

    public String getLabel() {
        return label;
    }

    public String getType() {
        return type;
    }

    public String getExpressionString() {
        return expressionString;
    }

    public List getUnits() {
        return units;
    }

    public String getQuantityType() {
        return quantityType;
    }

    public boolean isMarked() {
        return marked;
    }

    public void setMarked(boolean marked) {
        this.marked = marked;
    }

    public void setExpressionString(String expressionString) {
        this.expressionString = expressionString;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void setUnits(List units) {
        this.units = units;
    }

    public void setQuantityType(String quantityType) {
        this.quantityType = quantityType;
    }
    
    public String getFormat() {
        return format;
    }

    
    public void setFormat(String format) {
        this.format = format;
    }
}

-- 
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