Hi all,
I'm setting up a configuration with the Oauth2-module.
After authorization, the request should be forwarded to the user-consent page.
However, this forward fails with the message:
If I step through the code, I can see the AuthorizationRequest that is put onto the model (at AuthorizationEndpoint.java:135) is a real one and it's actually forwarded.Code:2012-03-23 09:09:46.987:WARN:oejs.ServletHandler:/oauth/authorize org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.security.oauth2.provider.AuthorizationRequest]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.springframework.security.oauth2.provider.AuthorizationRequest.<init>() at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:107) at org.springframework.web.method.annotation.ModelAttributeMethodProcessor.createAttribute(ModelAttributeMethodProcessor.java:131) at org.springframework.web.servlet.mvc.method.annotation.ServletModelAttributeMethodProcessor.createAttribute(ServletModelAttributeMethodProcessor.java:81) at org.springframework.web.method.annotation.ModelAttributeMethodProcessor.resolveArgument(ModelAttributeMethodProcessor.java:102) at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:74) at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:155) ... ... Caused by: java.lang.NoSuchMethodException: org.springframework.security.oauth2.provider.AuthorizationRequest.<init>() at java.lang.Class.getConstructor0(Class.java:2706) at java.lang.Class.getDeclaredConstructor(Class.java:1985) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:104) at org.springframework.web.method.annotation.ModelAttributeMethodProcessor.createAttribute(ModelAttributeMethodProcessor.java:131) at org.springframework.web.servlet.mvc.method.annotation.ServletModelAttributeMethodProcessor.createAttribute(ServletModelAttributeMethodProcessor.java:81) at org.springframework.web.method.annotation.ModelAttributeMethodProcessor.resolveArgument(ModelAttributeMethodProcessor.java:102) at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:74) at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:155) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:117) ...
But then it's lost down the forward-track: in RequestMappingHandlerAdapter.invokeHandlerMethod a ModelAndViewContainer is created and populated but the AuthorizationRequest is not put into it there.
This makes the "@ModelAttribute AuthorizationRequest" in AccessConfirmationController think that a new one should be created.
However, no default constructor exists for AuthorizationRequest, so this fails with the error above.
Did I miss something here?
Regards,
Geert


Reply With Quote