Error Package Uri Not Found
Things LocationTech Long-Term Support PolarSys Science OpenMDM More Community Marketplace Events Planet Eclipse Newsletter Videos Participate Report a Bug Forums Mailing Lists Wiki IRC How to Contribute Working Groups Automotive Internet of Things LocationTech Long-Term Support PolarSys Science OpenMDM Toggle navigation Home Projects Forums Eclipse Community Forums Forum Search: Search Help Register Login Home Home» Modeling» EMF» Package with uri 'null' not found ERROR(An error occured while i was reading a XML file into SymptomDatabase) Show: Today's Messages :: Show Polls :: Message Navigator Package with uri 'null' not found ERROR [message #550646] Wed, 04 August 2010 02:54 No real nameMessages: 5Registered: August 2010 Junior Member My code is as below: import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.resource.ResourceSet; import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; //import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl; import org.eclipse.emf.ecore.xmi.impl.*; import org.eclipse.hyades.models.symptom.SymptomPackage; import org.eclipse.hyades.models.symptom.impl.*; public class hello{ public static void main(String arg[]){ ResourceSet resourceSet = new ResourceSetImpl(); Resource.Factory.Registry registry = resourceSet.getResourceFactoryRegistry(); registry.getExtensionToFactoryMap().put("xml", new XMLResourceFactoryImpl()); SymptomPackage symPack = SymptomPackageImpl.init(); System.out.println(symPack.eNS_URI); System.out.println(symPack.eINSTANCE); EPackage.Registry reg = resourceSet.getPackageRegistry(); reg.put(symPack.getNsURI(), symPack); System.out.println(symPack.getNsURI()); resourceSet.getResource(URI.createFileURI("d:\\symptomdb.xml "), true); } } The error message is as below: Exception in thread "main" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'null' not found. (file:/d:/symptomdb.xml, 52, 18) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397) at eclipseworld.tutorial.demo.analysis.engine.DemoSymptomDataba se.loadDatabase(DemoSymptomDatabase.java:329) at eclipseworld.tutorial.demo.analysis.engine.DemoSymptomD
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. https://www.eclipse.org/forums/index.php/t/173050/ Join them; it only takes a minute: Sign up Exception loading emf file up vote 2 down vote favorite When I try to load an EMF file I get the following error: Exception thrown: org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Package with uri 'blah/blah' not found. (file:/C:/Temp/OPDiag1/blah1.opmeta, 2, 124) The code I am using to try and load: opmetaFactory.eINSTANCE.eClass(); Resource opmmResource = resourceSet.createResource(URI.createURI(uri)); http://stackoverflow.com/questions/13320115/exception-loading-emf-file try { opmmResource.load(null); opd = (OPMetaModelDiagram) opmmResource.getContents().get(0); } catch(final IOException e) { // log } Does anyone have any ideas why I get this error? Thanks eclipse eclipse-emf eclipse-emf-ecore emf share|improve this question edited Nov 10 '12 at 12:22 ShiDoiSi 5,4941838 asked Nov 10 '12 at 7:13 Eyal H 569215 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote accepted You need to register the package of the metamodel in the package registry first: resourceSet.getPackageRegistry().put(BlahPackage.eNS_URI, BlahPackage.eINSTANCE); For an UML model for example it would be "UMLPackage.eNS_URI" etc. In your case, I suppose it must something like "OpmetaPackage.eNS_URI" and "OpmetaPackage.eINSTANCE". share|improve this answer answered Nov 10 '12 at 7:28 sbegaudeau 1,08979 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answ
Integration Designer and WebSphere Integration Developer > Topic: Package with uri 'null' not found. (sca:/dataObject.xml, 1, 112) https://www.ibm.com/developerworks/community/forums/thread.jspa?threadID=134722 - What's this Error??? 2 replies Latest Post - http://www.eclipsezone.com/eclipse/forums/t113417.html 2006-09-05T15:01:12Z by SystemAdmin Display:ConversationsBy Date 1-3 of 3 Previous Next SystemAdmin 110000D4XK 6089 Posts Pinned topic Package with uri 'null' not found. (sca:/dataObject.xml, 1, 112) - What's this Error??? 2006-09-01T14:12:31Z | Tags: Answered question This error package question has been answered. Unanswered question This question has not been answered yet. Hi, I am doing a simple XSLT tranformation. So only one XSLT node in mediation. But even this is not working. The mediation is exported as a JMS export. But I error package uri am a getting the exception: Package with uri 'null' not found. (sca:/dataObject.xml, 1, 112).... I don't know where is dataObject.xml.... ??? What namespace does it need... Also before installing the fix pack 6.0.2, I was getting the error as Package with uri 'null' not found. (sca:/xmlDataBinding.xml, 1, 112).... Now this has changed.... to dataObject.xml IS IT A BUG??? Or What should I do to resolve this.... ??? Detailed error: 9/1/06 19:00:40:792 IST 0000005c ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "onMessage" on bean "BeanId(XSLTTransformMediationModuleApp#XSLTTransformMediationModuleEJB.jar#export.AirlineEIS, null)". Exception data: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'null' not found. (sca:/dataObject.xml, 1, 112) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:699) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:740) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java(Compiled Code)) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java(Compiled Code)) at org.eclipse.emf.ecore.xmi.impl.SAXWrapper.startElement(SAXWrapper.java(Compiled Code)) at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerIm
stories Forum Controls Reply to this Thread Search Forum Back to Thread List Whos Online: 105 guest(s), 0 user(s). More info » Spotlight Features Read the Spotlight Archives Replies: 1 - Pages: 1 Reply Package with uri 'null' not found At 1:45 PM on Aug 22, 2008, Nuno Ferreira wrote: Hi, This is an error that has been discussed a few times here, however i tried every hint and still haven't found a solution. What i'm trying to do is to open an XML file which has a XSD associated in a EMF editor. The code responsible for this part is below: URI resourceURI = EditUIUtil.getURI(getEditorInput()); ResourceSet resourceSet = editingDomain.getResourceSet(); Exception exception = null; Resource resource = null; try { resourceSet.getPackageRegistry().put("*", new XMLResourceFactoryImpl()); resource = resourceSet.getResource(resourceURI, true); } catch (Exception e) { exception = e; resource = resourceSet.getResource(resourceURI, false); } When i open either an ecore file or a XSD, the resource variable isn't null and i get to see and navigate all the data inside the files, but when i open a XML the resource variable is null in the "try", so it means that can't be loaded on demand. My XML starts with xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="omittedNamespace"> and my XSD file starts with I confess that i don't know anymore what is going on. There was a time that i thought the problem was with the XML namespace, then i thought it was the package registry, but no matter what, i still get the same error. Any fresh ideas? Thanks in advance. 1 replies so far ( Post your own) Reply 1. At 1:55 PM on Aug 22, 2008, Ed Merks wrote: Re: Package with uri 'null' not found Nuno, Comments below. Nuno Ferreira wrote: > Hi, > > This is an error that has been discussed a few times here, however i > tried every hint and still haven't found a solution. Goodness knows I'm tired of hearing about it. :-P > > What i'm trying to do is to open an XML file which has a XSD > associated in a EMF editor. > > The code responsible for this part is below: > > URI resourceURI = EditUIUtil.getURI(getEditorInput()); > ResourceSet resourceSet = editingDomain.getResourceSet(); > Exception exception = null; > Resource resource = null; > try > { > resourceSet.getPackageRegistry().put("*", new > XMLResourceFactoryImpl()); This is getting worrisome to be sure! It's a package registry, not a resource factor