Hello there!
I have a problem with the same code, also trying to load resources from a
standalone application.
Jinhui schrieb:
RESOURCE_SET.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION,
UMLResource.Factory.INSTANCE);
Map uriMap = RESOURCE_SET.getURIConverter().getURIMap();
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("uml",
new UMLResourceFactoryImpl());
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*",
new XMIResourceFactoryImpl());
Resource resource = RESOURCE_SET.getResource(uri, true);
The code above gives me a
java.lang.ClassCastException:
org.eclipse.uml2.uml.internal.resource.UMLResourceFactoryImpl cannot be
cast to org.eclipse.emf.ecore.resource.Resource$Factory
which seems strange, since UMLResourceFactoryImpl implements
Resource.Factory ...
I use the plugin versions EMF SDK 2.4 (2008/06/09) and UML2 2.1.0
(2008/05/13). Are these incompatible? They are the latest available
versions ...