1
votes

I have a few controllers and services that grab values from the grailsApplication using the PostConstruct annotation. These were all working fine in 2.4.0 and before, but suddenly after upgrading to 2.4.2 I now get an error during startup:

Message: Error creating bean with name 'com.domain.AuthenticationController': Invocation of init method failed; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.

The init method in question:

@PostConstruct
def init() {
    tokenValidity = grailsApplication.config.user.accessToken.validity
}

As you can see, I'm not using nor referencing the request object in the init method at all. It seems to be coming from my use of the config.

Any help would be greatly appreciated.

1

1 Answers

0
votes

Looks like your app does not have webxml plugin installed. Please double check it.