Hi, Can you show us in code how you are actually calling the Unmarshaller ? And on top of that, you might want to change the following line of your mapping file
<map-to xml="root"/> To <map-to xml="ROOT"/> Werner > -----Original Message----- > From: Swati Singhal [mailto:[EMAIL PROTECTED] > Sent: Mittwoch, 22. März 2006 13:29 > To: [email protected] > Subject: [castor-user] Getting error while unmarshalling > > Hi, > > I have an XML file that I need to unmarshall to a bean. > > The XML file is: > > <?xml version="1.0" encoding="UTF-8"?> > <ROOT> > <ID>601</ID> > <CODE>912-4W-01-001</CODE> > <COMPONENTS> > <PART> > <NUMBER>1111</NUMBER> > <DESC>SOAPS</DESC> > </PART> > <PART> > <NUMBER>0000</NUMBER> > <DESC>TOWELS</DESC> > </PART> > </COMPONENTS> > </ROOT> > > > Now my mapping.xml file is: > <?xml version="1.0"?> > <!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Object Mapping DTD > Version 1.0//EN" > > "http://castor.org/mapping.dtd"> > > <mapping> > <description>Mapping file</description> > <class name="com.itinerary.beans.OrderBean"> > <map-to xml="root"/> > <field name="id" type="string"> > <bind-xml name="id" node="element"/> > </field> > <field name="code" type="string"> > <bind-xml name="code" node="element"/> > </field> > <field name="components" > type="com.itinerary.beans.ComponentsBean"> > <bind-xml name="components"/> > </field> > </class> > > Then I further have a classdefinition for COmponentsBean > where I define a vector collection. > > I am able to load the mapping file and initialize the unmarshaller. > However, when I do the unmarshall operation it gives an error: > > Exception:The class for the root element 'ROOT' could not be found. > java.lang.NullPointerException > > When I do a <map-to xml="root">, then why am I getting this error? > Appreciate any inputs! > > Thanks > > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection > around http://mail.yahoo.com > > ------------------------------------------------- > If you wish to unsubscribe from this list, please send an > empty message to the following address: > > [EMAIL PROTECTED] > ------------------------------------------------- > > > ------------------------------------------------- If you wish to unsubscribe from this list, please send an empty message to the following address: [EMAIL PROTECTED] -------------------------------------------------

