Good Morning list, I am trying to read an existing epf library with the classical emf way:
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl()); ResourceSet resourceSet = new ResourceSetImpl(); URI fileURI = URI.createFileURI(new File("mypo.xml").getAbsolutePath()); Resource resource = resourceSet.getResource(fileURI, true); ***** Ok, no problems until run the last line (the exception above): The default epf library has a package reference of http:///org/eclipse/epf/uma/resourcemanager.ecore. I´ve known that this ecore is in eclipse.org.epf.library.persistence and I get those jar and put in build path of my project.edit (where´s this code), but don´t fix this problem. I want to read this library and get the ecore objects. Someone has a tip how I could read this xmi? Follow the exception: Exception in thread "main" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1$DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http:///org/eclipse/epf/uma/resourcemanager.ecore' not found. ("uri", 6, 38) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:307) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:268) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:390) at org.eclipse.ales.persistence.PersistenceObject.readingObjectLibrary(PersistenceObject.java:50) at org.eclipse.ales.persistence.PersistenceObject.main(PersistenceObject.java:38) Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http:///org/eclipse/epf/uma/resourcemanager.ecore' not found. ("uri", 6, 38) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(XMLHandler.java:2347) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefix(XMLHandler.java:2185) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1142) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1244) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:880) at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:84) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:863) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:627) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:533) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:878) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1693) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242) at javax.xml.parsers.SAXParser.parse(SAXParser.java:375) at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:180) at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:179) at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1094) at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:900) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:249) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:264) ... 3 more _______________________________________________ epf-dev mailing list epf-dev@eclipse.org https://dev.eclipse.org/mailman/listinfo/epf-dev