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

Reply via email to