I also have problem with this.

My best shot is to set the parameter DrillDownToRootCauseForFaultReason to true in the axis2.xml configuration file at the server side.

Then I can read the exception name (among a lot of other exceptions) in a field in the AxisFault message at the client side. I think I used the method getDetails().

But I dont think this is a good solution... :(

/Pär

 


From:  "John McLaughlin" <[EMAIL PROTECTED]>
Reply-To:  axis-user@ws.apache.org
To:  axis-user@ws.apache.org
Subject:  Problem with client side exceptions
Date:  Wed, 5 Sep 2007 15:50:39 +0100

Hi  all,

        I'm a newbie to Axis2, though have used Axis1 before, and am having trouble with exceptions on the client end.

        I've deployed a POJO as a service under Tomcat. I generated the service and client using Eclipse WTP, so to be as brief as possible, the service has a method:


    public CounterLight getCounter(Long nsuk)
        throws CounterNotFoundException
    {
        :
        throw new CounterNotFoundException("Exception!!!!") ;
    }

        CounterNotFoundException is simply an extension of
java.lang.Exception (it implements Serializable as well, though I don't think this makes any difference)

    Wsdl2java generates a class called CounterNotFoundExceptionException2 alongside the stub for the service


    On the client side I have:

   try {
        stub.getCounter(params) ; // Params initialised properly etc
   }
   catch(CounterNotFoundExceptionException2 e) {
        e.printStackTrace() ;
    }
    catch (AxisFault e) {
        e.printStackTrace() ;
    }

    The AxisFault is ALWAYS the one that is received, never the generated exception (though the compiler insists that I check for it).

    On the server side, I also get a "java.lang.reflect.InvocationTargetException...Caused by CounterException"

    Can anybody point me in the right direction here, am I missing something? I've googled extensively, searched the list archives etc, but couldn't find much of help.


Thanks for any help!

John





Express yourself instantly with MSN Messenger! MSN Messenger Download today it's FREE! --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to