axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ajith Ranabahu" <ajith.ranab...@gmail.com>
Subject Re: [Axis2] Generated MyServiceMessageReceiverInOut using REST causes UnsupportedOperationException
Date Tue, 20 Jun 2006 05:49:23 GMT
Hi,
This is caused when someone accesses the parser without caching
'before' the databinding conversion (It is not at all recommended). It
is likely to happen by a handler in between. Do you have any custom
modules installed ?

Ajith


On 6/19/06, heikki <tropicano@gmail.com> wrote:
> Hallo,
>
> I'm using Axis2 to create a service that is accessed in REST style.
>
> The MyServiceMessageReceiverInOut class, which was generated by Axis2's
> WSDL2Java utility, causes the following exception when I access the service
> in REST style :
>
> java.lang.UnsupportedOperationException: The parser is
> already consumed!
> at
> org.apache.axiom.om.impl.llom.OMElementImpl.getXMLStreamReader(OMElementImpl.java:635)
> [... more ...]
>
> The following change to the method fromOM() in MyServiceMessageReceiverInOut
> fixed it :
>
>     public org.apache.xmlbeans.XmlObject
> fromOM(org.apache.axiom.om.OMElement param, java.lang.Class type,
> java.util.Map extraNamespaces) {
>         try {
>             if (MyRQDocument.class.equals(
>                         type)) {
>                 if (extraNamespaces != null) {
>                     //
>                     // replaced this line :
>                     //
>                     // return
> MyRQDocument.Factory.parse(param.getXMLStreamReaderWithoutCaching
> (),
>                     //
>                     // by this line :
>                     //
>                     return
> MyRQDocument.Factory.parse(param.getXMLStreamReader(),
>                         new
> org.apache.xmlbeans.XmlOptions().setLoadAdditionalNamespaces(
>                             extraNamespaces));
>                 } else {
>                     return
> MyRQDocument.Factory.parse(param.getXMLStreamReaderWithoutCaching
> ());
>                 }
>             }
>          [... more ...]
>
> Has someone had a similar error? Can someone explain what is going on here,
> and whether applying this fix is a viable solution?
>
> thank you,
> Heikki Doeleman
>
>


-- 
Ajith Ranabahu

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message