I have one object which contain Name
package com.chase.ccs.mapping.dozer.prototype;
public class testingobj2 {
private String name;
/** * @return the name */ public String getName() { return name; }
/** * @param name the name to set */ public void setName(String name) { this.name = name; }
}
i want to map the name object in the collection which contain Name object init. collection is the part of another object
package com.chase.ccs.mapping.dozer.prototype;
import java.util.ArrayList; import java.util.List;
public class tesingobj1 {
private List names = new ArrayList();
/** * @return the name */ public List getNames() { return names; }
/** * @param name the name to set */ public void setNames(List name) { this.names = name; }
}
my dozerMapping.xml is """ com.chase.ccs.mapping.dozer.prototype.testingobj2 com.chase.ccs.mapping.dozer.prototype.tesingobj1 name names[0].fname com.chase.ccs.mapping.dozer.prototype.Name com.chase.ccs.mapping.dozer.prototype.Name, java.lang.String """"
but this is giving me null pointer exception
java.lang.NullPointerException at java.lang.Class.isAssignableFrom(Native Method) at org.dozer.factory.DestBeanCreator.create(DestBeanCreator.java:81) at org.dozer.factory.DestBeanCreator.create(DestBeanCreator.java:57) at org.dozer.factory.DestBeanCreator.create(DestBeanCreator.java:53) at org.dozer.propertydescriptor.GetterSetterPropertyDescriptor.writeDeepDestinationValue(GetterSetterPropertyDescriptor.java:190) at org.dozer.propertydescriptor.GetterSetterPropertyDescriptor.setPropertyValue(GetterSetterPropertyDescriptor.java:81) at org.dozer.fieldmap.FieldMap.writeDestValue(FieldMap.java:91) at org.dozer.MappingProcessor.writeDestinationValue(MappingProcessor.java:826) at org.dozer.MappingProcessor.mapFromFieldMap(MappingProcessor.java:310) at org.dozer.MappingProcessor.mapField(MappingProcessor.java:249) at org.dozer.MappingProcessor.map(MappingProcessor.java:218) at org.dozer.MappingProcessor.map(MappingProcessor.java:163) at org.dozer.MappingProcessor.map(MappingProcessor.java:119) at org.dozer.MappingProcessor.map(MappingProcessor.java:114) at org.dozer.DozerBeanMapper.map(DozerBeanMapper.java:92) at com.chase.ccs.mapping.dozer.prototype.TestUtils.main(TestUtils.java:63)