REcommend ME

Tags

Featured Links

www.axisnepal.com
RetiringbyDesign

Exception in thread

When you run the Tutorial05.java and onwards in the Jena examples, you get the following error:


ERROR [main] (RDFDefaultErrorHandler.java:40) - file:///C:/Users/Ravi/Desktop/Jena-examples/(line 4 column 60): {E201} rdf:about not allowed as attribute here.
ERROR [main] (RDFDefaultErrorHandler.java:44) - file:///C:/Users/Ravi/Desktop/Jena-examples/(line 5 column 15): The prefix "vcard" for element "vcard:fn" is not bound.
Exception in thread "main" com.hp.hpl.jena.shared.JenaException: org.xml.sax.SAXParseException: The prefix "vcard" for element "vcard:fn" is not bound.
at com.hp.hpl.jena.rdf.model.impl.RDFDefaultErrorHandler.fatalError(RDFDefaultErrorHandler.java:45)
at com.hp.hpl.jena.rdf.arp.impl.ARPSaxErrorHandler.fatalError(ARPSaxErrorHandler.java:35)
at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.warning(XMLHandler.java:225)
at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.fatalError(XMLHandler.java:255)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNamespaceBinder.startElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser.parse(RDFXMLParser.java:142)

SOLUTION
This is very wierd, but the rdf (vc-db-1.rdf), which I obtained from the internet, seems to contain two different instances for vcard: viz, “vcard” and “vCard”. The namespace for “vCard” seems to be defined but “vcard” not defined. So, the solution might be just name all vcards consistently to a single name such as “vcard”.

And later I found that vc-db-1.rdf obtained from vc-db-1.rdf was not correct, and that file that the example needs is located in directory doc/tutorial/RDQL folder. Thanks to we8ver

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • PDF

29 comments to org.xml.sax.SAXParseException: The prefix “vcard” for element “vcard:fn” is not bound.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>