G
G
Gena2017-03-10 09:00:54
Java
Gena, 2017-03-10 09:00:54

My EndpointInterceptor implementation executes the handleRequest code twice. I can't understand why?

Good afternoon.
In a project using spring, it was necessary to implement an interceptor to log soap messages. But I can’t understand why my methods work out twice (two identical entries are poured into the log).
Example,

@Component
public class SecurityInterceptor implements EndpointInterceptor {

    private Logger logger = Logger.getLogger(this.getClass());

    public boolean handleRequest(MessageContext messageContext, Object endpoint) throws IOException, SOAPException {
       logger.info("test message");

        return true;
    }
}

such an example also doubles. I can’t understand where exactly what is wrong, and where to look in the configs or somewhere else.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
aol-nnov, 2017-03-10
@aol-nnov

You need the source code of a minimal example in which this behavior is reproduced.
while you are preparing such an example, you will find the error yourself :)
it can be anything - for example, you registered an interceptor twice.

* {@link MessageDispatcher} processes an endpoint in an invocation chain, consisting of any number of interceptors,
* with the endpoint itself at the end. With this method, each interceptor can decide to abort the chain, typically
* creating a custom response.

docks rule :)

G
Gena, 2017-03-10
@GAS812

The problem was solved and turned out to be in the wrong contextConfigLocation setting in web.xml

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question