Problem in loading emf model when opening [message #191344] |
Tue, 09 August 2005 18:47 |
Eclipse User |
|
|
|
Hallo, GEF experts,
I've already spent a whole night on looking for the bugs. I could not
understand what is the reason for the java.lang.ClassCastException while
loading the model. Error was caused by following code in setInput:
URI fileURI=URI.createURI(file.getFullPath().toString());
Resource resource = new XMLResourceImpl(fileURI);
try {
resource.load(null);
model = (Model)resource.getContents().get(0);
//java.lang.ClassCastException
} catch (IOException e) {
model = ModelFactory.eINSTANCE.createModel();
resource.getContents().add(model);
}
|
|
|
Powered by
FUDForum. Page generated in 0.03492 seconds