You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by bu...@apache.org on 2003/12/03 17:24:09 UTC

DO NOT REPLY [Bug 16771] - cannot catch specific exception in client if it has a message

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16771>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16771

cannot catch specific exception in client if it has a message

tomj@macromedia.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID



------- Additional Comments From tomj@macromedia.com  2003-12-03 16:24 -------
Axis specifically does not serialize the data members of the Throwable class.  
See axis.utils.BeanUtils, line 124.  In order for your custom exception data 
to get passed to the client, you would need to define it as a JavaBean, with a 
default constructor and get/set methods, like this:

public class MyException extends Exception {
    private String msg;
    public MyException() {}
    public MyException(String s) {msg = s;}
    public String getMsg() { return msg; }
    public void setMsg(String s) { msg = s;}
}

Throwing this exception on the server gets the right exception on the client 
when using both this class on the client and the the WSDL2Java generated 
exception on the client.