[ 
https://issues.apache.org/jira/browse/CXF-3762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13091358#comment-13091358
 ] 

Glen Mazza commented on CXF-3762:
---------------------------------

Hi Aaron, the JAX-WS specification, section 6.4, Exceptions, defines 4 
exceptions that "MUST" be thrown under certain defined circumstances (defined 
at various places in the specification).  Thankfully all of those are 
subclasses of RuntimeException, *possibly* allowing us use of this flag you're 
proposing if a person wishes to use RuntimeException instead of Exception, but 
I don't think it could be more granular than that -- if we allow 
-exceptionSuper=com.mycompany.BobsException we wouldn't be able to throw any of 
those 4 exceptions, because none of them descend from BobsException.

A possible (preferred?) solution without use of this flag is to use the 
wsdl:fault element attached to wsdl:operation within your WSDL (see the JAX-WS 
specification), that will allow you to dictate the exception that would be 
thrown for each operation.



> Add an -exceptionSuper flag, allowing wsdl2java to generate exceptions which 
> extend from java.lang.RuntimeException
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-3762
>                 URL: https://issues.apache.org/jira/browse/CXF-3762
>             Project: CXF
>          Issue Type: New Feature
>          Components: Tooling
>    Affects Versions: 2.4.2
>            Reporter: aaron pieper
>              Labels: jaxb, wsdl2java
>         Attachments: patch.txt
>
>
> When using CXF's wsdl2java tool, generated exceptions always extend 
> java.lang.Exception. It would be nice if exceptions could optionally extend 
> java.lang.RuntimeException instead. This could be accomplished by adding a 
> flag like -exceptionSuper=.... on the wsdl2java tool, which would allow us to 
>  specify our own superclass.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to