This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes Caused by: java.lang.InstantiationException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Caused by: java.lang.InstantiationException" Watch "Caused by: java.lang.InstantiationException" New topic
Author

Caused by: java.lang.InstantiationException

prem mika
Greenhorn

Joined: Sep 18, 2010
Posts: 2
Hi ,
I tried to unmarshall a xml, i got the following exception

SEVERE: null
org.exolab.castor.xml.MarshalException: javaapplication1.Person{File: [not available]; line: 2; column: 9}
at org.exolab.castor.xml.Unmarshaller.convertSAXExceptionToMarshalException(Unmarshaller.java:794)
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:760)
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:626)
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:840)
at javaapplication1.PersonMarshall.main(PersonMarshall.java:30)
Caused by: java.lang.InstantiationException: javaapplication1.Person
at java.lang.Class.newInstance0(Class.java:340)
at java.lang.Class.newInstance(Class.java:308)
at org.exolab.castor.util.DefaultObjectFactory.createInstance(DefaultObjectFactory.java:107)
at org.exolab.castor.xml.UnmarshalHandler.createInstance(UnmarshalHandler.java:2579)
at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1711)
at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1436)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(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.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$JAXPSAXParser.parse(Unknown Source)
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:748)
... 3 more
Caused by: java.lang.InstantiationException: javaapplication1.Person
at java.lang.Class.newInstance0(Class.java:340)
at java.lang.Class.newInstance(Class.java:308)
at org.exolab.castor.util.DefaultObjectFactory.createInstance(DefaultObjectFactory.java:107)
at org.exolab.castor.xml.UnmarshalHandler.createInstance(UnmarshalHandler.java:2579)
at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1711)
at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1436)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(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.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$JAXPSAXParser.parse(Unknown Source)
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:748)
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:626)
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:840)
at javaapplication1.PersonMarshall.main(PersonMarshall.java:30)






Do i need to keep my xml in any particular folder?
Can anybody tell what the error is?

Thanks

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

It's more likely an issue with the Person class; can you post its code?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Caused by: java.lang.InstantiationException
 
Similar Threads
Error while unmarshalling xml (Castor 1.3, JDK 1.5)
Exception while marshalling in spring
Help with Configuring Tomcat in Eclipse
Tomcat Error
problem with loading mapping.xml