wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets 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?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Caused by: java.lang.InstantiationException
 
Similar Threads
problem with loading mapping.xml
Exception while marshalling in spring
Help with Configuring Tomcat in Eclipse
Tomcat Error
Error while unmarshalling xml (Castor 1.3, JDK 1.5)