[ 
https://issues.apache.org/jira/browse/CXF-896?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zarar Siddiqi updated CXF-896:
------------------------------

    Attachment: AegisWebFaultFixWithoutChangingWebFaultOutInterceptor.patch

Dan, I'm a little confused.  Are we talking about readers or writers?  In your 
latest comment you're referring to NodeDataReader and XMLStreamReader  when the 
problem is with *writing* the exception to the stream.

I don't see how we can use classes like W3CDOMStreamWriter in AegisBinding 
because they actually need the Element that's being written which isn't 
available in AegisDatabinding.  Either way, I've attached another patch which 
doesn't change WebFaultOutInterceptor and checks for Node.class in AegisBinding 
and then returns an ElementDataWriter (new class) which happens to be awfully 
similar to XMLStreamDataWriter.

Thoughts? Corrections?

> Aegis binding with @WebFault causes AegisDatabinding to throw 
> UnsupportedOperationException
> -------------------------------------------------------------------------------------------
>
>                 Key: CXF-896
>                 URL: https://issues.apache.org/jira/browse/CXF-896
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>    Affects Versions: 2.1
>         Environment: Platform independent.
>            Reporter: Zarar Siddiqi
>            Assignee: Dan Diephouse
>         Attachments: AegisWebFaultFix.patch, 
> AegisWebFaultFixWithoutChangingWebFaultOutInterceptor.patch
>
>
> I posted about this issue on the mailing list:
> http://www.nabble.com/forum/ViewPost.jtp?post=12037196&framed=y
> I'm getting an UnsupportedOperationException using Aegis binding and JAX-WS 
> frontend.  Here's my setup starting with the Spring beans:
>     <bean id="aegisBean"
>           class="org.apache.cxf.aegis.databinding.AegisDatabinding"/>
>     <jaxws:endpoint
>             id="sportsServiceEndpoint"
>             implementor="#sportsService"
>             address="/SportsService">
>         <jaxws:serviceFactory>
>             <bean 
> class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
>                 <property name="dataBinding" ref="aegisBean"/>
>                 <property name="serviceConfigurations">
>                     <list>
>                         <bean 
> class="org.apache.cxf.jaxws.support.JaxWsServiceConfiguration"/>
>                         <bean 
> class="org.apache.cxf.aegis.databinding.AegisServiceConfiguration"/>
>                         <bean 
> class="org.apache.cxf.service.factory.DefaultServiceConfiguration"/>
>                     </list>
>                 </property>
>             </bean>
>         </jaxws:serviceFactory>
>     </jaxws:endpoint>
> Here's the exception class:
> @WebFault(name="WebServiceException")
> public class WebServiceException extends RuntimeException {
>    // constructors hidden for brevity
>     public Object getFaultInfo() { .... }
> }
> Here's the stacktrace:
> java.lang.UnsupportedOperationException
>   at 
> org.apache.cxf.aegis.databinding.AegisDatabinding.createWriter(AegisDatabinding.java:109)
>   at 
> org.apache.cxf.jaxws.interceptors.WebFaultOutInterceptor.handleMessage(WebFaultOutInterceptor.java:82)
>   at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207)
>   at 
> org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:90)
>   at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:224)
>   at 
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:73)
>   at 
> org.apache.cxf.transport.servlet.ServletDestination.doMessage(ServletDestination.java:78)
>   at 
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:231)
> I can actually see this exception coming.  In 
> WebFaultOutInterceptor.handleMessage() the line
> DataWriter writer = service.getDataBinding().createWriter(Node.class) ;
> invokes AegisDatabinding.createWriter() where Node.class isn't being looked 
> for:
>     public <T> DataWriter<T> createWriter(Class<T> cls) {
>         if (cls.equals(XMLStreamWriter.class)) {
>             return (DataWriter<T>)new XMLStreamDataWriter(this);
>         } else {
>             throw new UnsupportedOperationException();
>         }
>     }
> Any ideas how to avoid this exception? I think my configuration is correct 
> and this might be a bug.
> Thanks,
> Zarar

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to