Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » Meet the "Package with uri 'null' not found" ERROR(An error occured while i was reading a XML file into SymptomDatabase using tptp)
Meet the "Package with uri 'null' not found" ERROR [message #551047] Thu, 05 August 2010 02:32
No real name is currently offline No real nameFriend
Messages: 5
Registered: August 2010
Junior Member
This is the original link to the post http://www.eclipse.org/forums/index.php?t=msg&th=173050& amp;start=0&S=03af70165d831b58362aae9b4c89b2ce

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.DemoSymptomDataba se.merge(DemoSymptomDatabase.java:127)
at eclipseworld.tutorial.demo.analysis.engine.DemoSymptomDataba se.main(DemoSymptomDatabase.java:74)
Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'null' not found. (file:/d:/symptomdb.xml, 52, 18)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1307)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1468)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1019)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:1001)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unk nown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unkn own Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanSt artElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatc her.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragme ntContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDo cument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1494)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1282)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
... 4 more

The XML file is as below:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE symptomDatabase [

<!ELEMENT symptomDatabase (runtime+)>

<!ELEMENT runtime (symptom+ , solution+ , directive*)>
<!ATTLIST runtime
id ID #REQUIRED
name CDATA #IMPLIED
symptomUrl CDATA #IMPLIED
localExternalFileLocation CDATA #IMPLIED>

<!ELEMENT symptom (matchPattern+)>
<!ATTLIST symptom
id ID #REQUIRED
description CDATA #IMPLIED
solutions IDREFS #REQUIRED>

<!ELEMENT matchPattern EMPTY>
<!ATTLIST matchPattern
name CDATA #IMPLIED
value CDATA #REQUIRED>

<!ELEMENT solution EMPTY>
<!ATTLIST solution
id ID #REQUIRED
description CDATA #IMPLIED
directives IDREFS #IMPLIED>

<!ELEMENT directive EMPTY>
<!ATTLIST directive
id ID #REQUIRED
description CDATA #IMPLIED
directiveString CDATA #REQUIRED>
]>

<!-- Created on Thursday, December 09, 2004 at 9:00:53:0315 PM EST -->

<!-- NOTE: Do not translate any content in this XML file. -->

<symptomDatabase>
<runtime id="Runtime_0" name="symptomDB" symptomUrl="http://www.eclipse.org" localExternalFileLocation="www.eclipse.org">

<!-- Symptoms: -->

<symptom id="Symptom_0" description="Could not determine server name" solutions="Solution_0">
<matchPattern name="null" value="httpd: Could not determine the server&apos;s fully qualified domain name"/>
</symptom>
<symptom id="Symptom_1" description="File does not exist" solutions="Solution_1">
<matchPattern name="null" value="File does not exist:"/>
</symptom>

<!-- Solutions: -->

<solution id="Solution_0" description="Add Severname &apos;servername&apos; to httpd.conf and enter the&#xD;&#xA;corresponding entry for &apos;servername&apos; in /etc/hosts file.&#xD;&#xA;&#xD;&#xA;Where &apos;servername&apos; is the name of your server." />
<solution id="Solution_1" description="Try reinstalling the apache server." directives="Directive_0"/>

<!-- Directives: -->

<directive id="Directive_0" description="Contact your local administrator." directiveString=""/>
</runtime>
</symptomDatabase>

I am working on it for a day time, and i still don't know how to fix it.Really need your help!
Previous Topic:JVMPI error with helios and TPTP 4.7 and JDK1.6.0_19
Next Topic:UML Testing Profile
Goto Forum:
  


Current Time: Fri Apr 26 21:21:30 GMT 2024

Powered by FUDForum. Page generated in 0.02066 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top