You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Zarar Siddiqi (JIRA)" <ji...@apache.org> on 2007/08/07 21:25:59 UTC

[jira] Created: (CXF-896) Aegis binding with @WebFault causes AegisDatabinding to throw UnsupportedOperationException

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


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.


[jira] Resolved: (CXF-896) Aegis binding with @WebFault causes AegisDatabinding to throw UnsupportedOperationException

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-896?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-896.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.2
         Assignee: Daniel Kulp  (was: Dan Diephouse)

Patch applied, thanks!

> 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: Daniel Kulp
>             Fix For: 2.0.2
>
>         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.


[jira] Commented: (CXF-896) Aegis binding with @WebFault causes AegisDatabinding to throw UnsupportedOperationException

Posted by "Zarar Siddiqi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526467 ] 

Zarar Siddiqi commented on CXF-896:
-----------------------------------

Has anyone looked into this? I'm pretty sure this is a bug which makes it impossible to use an Aegis binding while using @WebFault.  As mentioned in the original post this is happening because Node.class is not being checked for in AegisDatabinding.createWriter().

Any ideas?

> 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
>
> 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.


[jira] Updated: (CXF-896) Aegis binding with @WebFault causes AegisDatabinding to throw UnsupportedOperationException

Posted by "Zarar Siddiqi (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Commented: (CXF-896) Aegis binding with @WebFault causes AegisDatabinding to throw UnsupportedOperationException

Posted by "Dan Diephouse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527066 ] 

Dan Diephouse commented on CXF-896:
-----------------------------------

Sorry, I must be on crack. I'm blaming my jetlag ;-)  Anyway, I think what you submitted is probably OK. I'll see if I can get it commited soon. Thanks again.

> 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.


[jira] Commented: (CXF-896) Aegis binding with @WebFault causes AegisDatabinding to throw UnsupportedOperationException

Posted by "Zarar Siddiqi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526781 ] 

Zarar Siddiqi commented on CXF-896:
-----------------------------------

Sure, I'll give it a shot.

> 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
>
>
> 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.


[jira] Updated: (CXF-896) Aegis binding with @WebFault causes AegisDatabinding to throw UnsupportedOperationException

Posted by "Zarar Siddiqi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-896?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: AegisWebFaultFix.patch

I've attached a patch which creates a W3CDOMStreamWriter based on a Node and then uses the W3CDOMStreamWriter to create a DataWriter.

Thanks to Dan for showing me the way.

After applying this patch Aegis bindings should be able to interpret @WebFault annotations and serialize them into SOAP faults properly.

Thanks again.

Zarar Siddiqi

> 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
>
>
> 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.


[jira] Commented: (CXF-896) Aegis binding with @WebFault causes AegisDatabinding to throw UnsupportedOperationException

Posted by "Dan Diephouse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526779 ] 

Dan Diephouse commented on CXF-896:
-----------------------------------

Hi zarrar, Thanks for the patch. Can I suggest one improvement? Some databiding frameworks (i.e. JAXB) can work with the Node object directly and more efficiently. I was wondering if you could maybe rework it so that the WebFaultInterceptor stays the same and the AegisDatabinding creates a NodeDataReader. The NodeDataReader can then do the conversion to the XMLStreamReader and pass it on to an encapsulated version of the XMLStreamReader. Any chance you could do this?

> 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
>
>
> 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.


[jira] Assigned: (CXF-896) Aegis binding with @WebFault causes AegisDatabinding to throw UnsupportedOperationException

Posted by "Dan Diephouse (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-896?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Diephouse reassigned CXF-896:
---------------------------------

    Assignee: Dan Diephouse

> 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
>
> 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.