hedha
hedha

Reputation: 276

Grails 3.2.0 Interceptors are not working

When i am migrating my project from grails-2.4.4 to grails-3.2.0. Configration : Java 8 Grails 3.2.0 Gradle 3.1.

I am also migrating filters to interceptors.

Here is my interceptor :

class MemoryUsageInterceptor {
MemoryUsageInterceptor() {
    println(">>> MemoryUsageInterceptor constructor")
    matchAll()
}

boolean before() {
    println(">>> MemoryUsageInterceptor before")

    true
}

boolean after() { true }

void afterView() {
    // no-op
}
}

When my application is up then interceptor constructor is called. But its action is not called. Can you please tell me where i am wrong.

Upvotes: 0

Views: 639

Answers (1)

James Xabregas
James Xabregas

Reputation: 766

I encountered what I believe is the same or a very similar issue. My interceptors were working when running in interactive development mode, but when I packaged them as a WAR and ran them the interceptor would not load at all.

It appears this issue was present in Grails 3.2.0 to 3.2.2.

I resolved this issue by upgrading to Grails 3.2.3.

Upvotes: 2

Related Questions