Hi

I have an inbound interceptor that performs some actions before invoking my
webservice. In my interceptor I call method from classes that I instantiate
on runtime with Class.forName(cls);

I am currently testing what happens when I give invalid class name in the
cls variable and I noticed that despite the fact that ClassNotFoundException
occurs (which I am catching) the method handleFault() is never called. 

Why is that happening? I've read that handleFault() is called when the
process in the handleMessage is interrupted but what this exactly means?
Isn't an Exception an interruption?

My code:

public class ESMAPISecurityInterceptor extends
                AbstractPhaseInterceptor<Message> {

        public ESMAPISecurityInterceptor(String phase) {
                super(phase);
        }

        @Override
        public void handleMessage(Message message) throws Fault {
                try {
                        Class<?> c = Class.forName("an.invalid.class.name");
                } catch (ClassNotFoundException e) {
                        e.printStackTrace();
                }
        }

        @Override
        public void handleFault(Message message) {
                System.out.println("Prints from handleFault()");
        }
}

Thanks



--
View this message in context: 
http://cxf.547215.n5.nabble.com/handleFault-method-not-called-when-exception-occurs-in-handleMessage-tp5738573.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to