ResourceSet rs = new ResourceSetImpl(); rs.getResourceFactoryRegistry().getExtensionToFactoryMap().put Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl() ); URI uri = URI.createFileURI( new File( "model.xmi" ).getAbsolutePath() ); Resource r = rs.getResource( uri, true ); A a = (A)r.getContents().get( 0 );
Did you do something that register your dynamic model? Is this running
in a context where your generated model is registered?