Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML creation error "The namespace prefix "ns1" was not declared."

 
Deepa S.
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have an xsd. I have used castor to generate the code. However during marshalling I am faced with this error

org.jdom.input.JDOMParseException: Error on line 2: The namespace prefix "ns1" was not declared.
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:466)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:769)
at com.polaris.liquidity.processing.interfaces.GCM.XercesParser.marshal(XercesParser.java:44)
at com.polaris.liquidity.processing.interfaces.GCM.GCMRequestHandler.main(GCMRequestHandler.java:82)
Caused by: org.xml.sax.SAXParseException: The namespace prefix "ns1" was not declared.
at weblogic.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1093)
at weblogic.apache.xerces.validators.common.XMLValidator.bindNamespacesToElementAndAttributes(XMLValidator.java:2662)
at weblogic.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1145)
at weblogic.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1891)
at weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1267)
at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:396)
at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:975)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:123)
at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:125)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:455)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:769)
at com.polaris.liquidity.processing.interfaces.GCM.XercesParser.marshal(XercesParser.java:44)
at com.polaris.liquidity.processing.interfaces.GCM.GCMRequestHandler.main(GCMRequestHandler.java:82.

Can someone please help me with this error.

I have two xsd's one included in the other and also have a targetnamespace defined.

Can someone help me if they have faced a similar error. Am I missing something. There is no ns1 declared anywhere in my code. Is this a default namespace taken by the system.

Regards
Deepa
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Deepa S.", welcome to JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must contain your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names will be deleted.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic