sdc
16 Jul 2008, 6:15 AM
In last SVN build, lines 38-47 :
ListLoadResult result = (ListLoadResult) data;
List beans = result.getData();
if (beans.size() > 0) {
BeanModelFactory factory = BeanModelLookup.get().getFactory(beans.get(0).getClass());
if (factory == null) {
throw new RuntimeException("No BeanModelFactory found for " + beans.get(0).getClass());
}
List converted = factory.createModel(beans);
beans.clear();
beans.add(converted);If you do that, the loader try to convert a list to a ModelData (ClassCastException). You should do instead (last line) or :
beans.addAll(converted);You can reproduce the issue with the explorer demo by replacing the ExplorerService.getCustomers return type from List<Customer> to ListLoadResult<Customer>
ListLoadResult result = (ListLoadResult) data;
List beans = result.getData();
if (beans.size() > 0) {
BeanModelFactory factory = BeanModelLookup.get().getFactory(beans.get(0).getClass());
if (factory == null) {
throw new RuntimeException("No BeanModelFactory found for " + beans.get(0).getClass());
}
List converted = factory.createModel(beans);
beans.clear();
beans.add(converted);If you do that, the loader try to convert a list to a ModelData (ClassCastException). You should do instead (last line) or :
beans.addAll(converted);You can reproduce the issue with the explorer demo by replacing the ExplorerService.getCustomers return type from List<Customer> to ListLoadResult<Customer>