aspose file tools*
The moose likes XML and Related Technologies and the fly likes problem with loading mapping.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "problem with loading mapping.xml " Watch "problem with loading mapping.xml " New topic
Author

problem with loading mapping.xml

venkataramana raju
Greenhorn

Joined: Sep 11, 2005
Posts: 28
Hi All,

1)Please tell me the cause of this problem.

2)how to solve this problem?

i am getting this problem while loading mapping.xml

Error is
there rg.exolab.castor.mapping.MappingException:
Nested error: org.xml.sax.SAXException: The namespace associated with the prefix: xmlns is null.
org.xml.sax.SAXException: The namespace associated
with the prefix: xmlns is null.
at
org.exolab.castor.xml.UnmarshalHandler.resolveNamespace(UnmarshalHandler.java:2751)
at
org.exolab.castor.xml.UnmarshalHandler.processAttribute(UnmarshalHandler.java:2512)
at
org.exolab.castor.xml.UnmarshalHandler.processAttributes(UnmarshalHandler.java:2218)
at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1922)
at
org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1149)
at
org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)
at
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1284)
at
org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1806) at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1182)
at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
at
org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
at
org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:291)
at
org.exolab.castor.mapping.Mapping.loadMappingInternal(Mapping.java:296) at
org.exolab.castor.mapping.Mapping.loadMappingInternal(Mapping.java:269)
at
org.exolab.castor.mapping.Mapping.loadMapping(Mapping.java:222)
at
com.hcl.scorm.mappingbeans.manifest.organizations.sequencing.TestSeq.main(TestSeq.java:124)

if u want i can send my mapping.xml also.

its urgent so plz help me.

thanks in advance
venkataramana
[ June 02, 2006: Message edited by: Bear Bibeault ]
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Can you please post the first 5 lines of the mapping file?

Please don't put 'urgent' in the title, it won't make people get here any faster.

Dave
venkataramana raju
Greenhorn

Joined: Sep 11, 2005
Posts: 28
Hi David O'Meara

First of all thanks for reply
and sorry for the (URGENT) word in subject


I am using castor.0.9.5.2.jar for xml binding
and i am getting problem while

mapping.loadMapping( "mappingFilePath" );
Below lines are my Mapping.xml :-

<?xml version="1.0"?>
<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Object Mapping DTD Version 1.0//EN" "mapping.dtd" >

<mapping>
<class name="com.hcl.scorm.mappingbeans.manifest.Manifest">
<map-to xml="manifest"/>

<field name="Identifier"
type="java.lang.String">
<bind-xml name="identifier" node="attribute"/>
</field>

<field name="Xmlns"
type="java.lang.String">
<bind-xml name="xmlns" node="attribute"/>
</field>

<field name="Xsi"
type="java.lang.String">
<bind-xml name="xmlns:xsi" node="attribute"/>
</field>

<field name="Adlcp"
type="java.lang.String">
<bind-xml name="xmlns:adlcp" node="attribute"/>
</field>

<field name="Imsss"
type="java.lang.String">
<bind-xml name="xmlns:imsss" node="attribute"/>
</field>

<field name="Adlseq"
type="java.lang.String">
<bind-xml name="xmlns:adlseq" node="attribute"/>
</field>
<field name="Adlnav"
type="java.lang.String">
<bind-xml name="xmlns:adlnav" node="attribute"/>
</field>

<field name="SchemaLocation"
type="java.lang.String">
<bind-xml name="xsi:schemaLocation" node="attribute"/>
</field>


<field name="Metadata"
type="com.hcl.scorm.mappingbeans.manifest.metadata.MetaData">
<bind-xml name="metadata"/>
</field>

<field name="Organizations"
type="com.hcl.scorm.mappingbeans.manifest.organizations.Organizations">
<bind-xml name="organizations"/>
</field>
<field name="Resources"
type="com.hcl.scorm.mappingbeans.manifest.resources.Resources">
<bind-xml name="resources"/>
</field>


</class>


..............
................
</mapping>

Thanks
venkataramana
venkataramana raju
Greenhorn

Joined: Sep 11, 2005
Posts: 28
Hi All
Even Our JavaRanch people doesn't help me then,
it is better to change from castor to other Xml Binding Technologies.
Becoz as a open source castor there own website is down .
and i mailed so many castor forums but i dnt get any reply
But i will try to solve this problem for some more days
so that i may find solution and in future i can help others

Thanks
venkataramana
venkataramana raju
Greenhorn

Joined: Sep 11, 2005
Posts: 28
as i told u i sloved this problem

Actualy problem is with xmlns namespace
this namespace already spicifeid as "http://www.w3.org/2001/XMLSchema"

so we just need to spicify in our xml file like below

<mapping xmlns:xmlns1="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:adlcp="http://www.adlnet.org/xsd/adlcp_rootv1p2"
xmlns:imsss="http://www.imsglobal.org/xsd/imsss"
xmlns:adlnav="http://www.adlnet.org/xsd/adlnav_v1p3">

Thats it Problem is solved
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with loading mapping.xml
 
Similar Threads
Caused by: java.lang.InstantiationException
XML creation error "The namespace prefix "ns1" was not declared."
Exception in using CASTOR
Castor mapping problem
[Castor] "unmarshalling exception: unable to find FieldDescriptor for"