axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Murali Krishnan <cme...@yahoo.com>
Subject Issue with BeanUtil.deserialize()
Date Thu, 07 Feb 2008 20:49:29 GMT
Hello,
BeanUtil.deserialize() throws a java.lang.InstantiationException when trying to deserialize
an xml fragment. The java classes were generated using wsdl2java and jaxbri binding. One of
the xml elements is 'notificationInterval' with data type 'xs:duration' which gets mapped
to javax.xml.datatype.Duration by JAXB.

When an xml fragment containing this type is being unmarshalled, BeanUtil fails because it
is trying to instantiate an abstract class (since Duration is abstract). 
Is there a way to get past this problem?

Attached are the generated classes and the xml fragment.

Thanks,
Murali

Note: I was able to get past a similar problem with XMLGregorianCalendar by using jaxb customization
(to create java.util.Calendar)

-------------- Stack Trace ----------------------

org.apache.axis2.AxisFault
        at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
        at org.apache.axis2.engine.DefaultObjectSupplier.getObject(DefaultObjectSupplier.java:29)
        at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:345)
        at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:385)
        at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:385)
        at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:385)
        at org.apache.axis2.databinding.utils.BeanUtil.processObject(BeanUtil.java:655)
        at org.apache.axis2.databinding.utils.BeanUtil.ProcessElement(BeanUtil.java:603)
        at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:535)
        at org.apache.axis2.rpc.receivers.RPCUtil.processRequest(RPCUtil.java:153)
        at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:188)
        at org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver.invokeBusinessLogic(RPCInOnlyMessageReceiver.java:62)
        at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
        at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
        at org.apache.axis2.transport.http.HTTPWorker.service(HTTPWorker.java:256)
        at org.apache.axis2.transport.http.server.AxisHttpService.doService(AxisHttpService.java:259)
        at org.apache.axis2.transport.http.server.AxisHttpService.handleRequest(AxisHttpService.java:166)
        at org.apache.axis2.transport.http.server.HttpServiceProcessor.run(HttpServiceProcessor.java:85)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
        at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.InstantiationException
        at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)

        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
        at java.lang.Class.newInstance0(Class.java:350)
        at java.lang.Class.newInstance(Class.java:303)
        at org.apache.axis2.engine.DefaultObjectSupplier.getObject(DefaultObjectSupplier.java:27)




      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs
Mime
View raw message