Note that there are some explanatory texts on larger screens.

plurals
  1. POGrails Oauth2 Provider NullPointerException
    primarykey
    data
    text
    <p>I’m trying to use Oauth2 in Grails but can’t get it working. When trying to get access point I have NullPointerException. <br> So more details: Using <a href="http://grails.org/plugin/spring-security-oauth2-provider" rel="nofollow">Spring Security Oauth2 Provider</a> plugin. I have registered a client (with BaseClientDetails) in BootStrap.groovy and according to the <a href="https://github.com/adaptivecomputing/grails-spring-security-oauth2-provider" rel="nofollow">tutorial</a> the client could login with the URL given in the tokenEndpointUrl setting (/oauth/token by default) by using the following url: localhost:8080/app/oauth/token?grant_type=client_credentials&amp;client_id=clientId&amp;client_secret=clientSecret . </p> <p>But grails.plugin.cache.web.filter.PageFragmentCachingFilter throws exception, in the method described bellow controllerClass is null for some strange reason.</p> <pre><code>841 protected Object lookupController(Class&lt;?&gt; controllerClass) { &lt;br&gt; 842 return getBean(controllerClass.getName()); &lt;br&gt; 843 } </code></pre> <p>and controller class is null because grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter trying to get controller class from context ( getContext().getControllerClass() ) but null is returned. <br> Full stack is here <a href="http://pastebin.com/euramNaS" rel="nofollow">http://pastebin.com/euramNaS</a></p> <p>When I passing regular login flow (not directly using URL but via login form). I have LoginController fetched in the same place. And when in debug mode I set breakpoint to the “problematic” line and manually change controllerClass with LoginController (adding controllerClass = LoginController.class to watch) it made the trick and I receive JSON with tokens. <br><br> Tried to make empty application to clearly reproduce the problem and it is reproduced. So test project could be found <a href="http://goo.gl/1gmtT" rel="nofollow">http://goo.gl/1gmtT</a> . <br> Any ideas why controller could be not initialized when accessing url directly?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload