Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.3
-
Fix Version/s: None
-
Component/s: XML
-
Labels:None
-
Number of attachments :
Description
Trying to create a simple mapping file using MappingTool.write results in
Caused by: java.lang.IllegalArgumentException: list is not a valid FieldMappingCollectionType
at org.exolab.castor.mapping.xml.types.FieldMappingCollectionType.valueOf(FieldMappingCollectionType.java:248)
at org.exolab.castor.tools.MappingTool.addClass(MappingTool.java:390)
at fi.ains.jp.model.service.PersistenceService.autoGenerateMappingFile(PersistenceService.java:173)
at fi.ains.jp.model.service.PersistenceService.saveModel(PersistenceService.java:149)
at fi.ains.jp.controller.applicationModel.JPApplicationModel.saveModel(JPApplicationModel.java:93)
at fi.ains.jp.view.JPApplicationMainView.save(JPApplicationMainView.java:186)
... 34 more
Tried to map simple example:
public class Owner {
private String name;
private List<Vehicle> vehicles = new ArrayList<Vehicle>();
public String getName()
{ return name; }public void setName(String name) { this.name = name; }
public List<Vehicle> getVehicles() { return (ArrayList<Vehicle>) vehicles; }
public void setVehicles(List<Vehicle> vehicles) { this.vehicles = vehicles; }
}
public class Vehicle {
private String name;
private Owner owner;
public String getName() { return name; }
public void setName(String name)
{ this.name = name; }public Owner getOwner()
{ return owner; }public void setOwner(Owner owner)
{ this.owner = owner; }}
private void autoGenerateMappingFile() {
FileWriter fw = null;
try
catch (IOException ex)
{ throw new RuntimeException(ex); } catch (MappingException ex) { throw new RuntimeException(ex); }finally
{ IOUtils.closeQuietly(fw); }}
forgot one extraneous cast there,
public List<Vehicle> getVehicles()
{ return (ArrayList<Vehicle>) vehicles; }should have been
public List<Vehicle> getVehicles()
{ return vehicles; }but has no effect on the end result