-
Notifications
You must be signed in to change notification settings - Fork 38.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optional @RequestParam with required=false no longer works in Spring 3.0.4 (compared to 3.0.2) when Controller extends interface [SPR-7483] #12141
Comments
Grant Gochnauer commented This is in Websphere 6.1 with JDK5 |
Grant Gochnauer commented In my spring servlet xml, I have this defined:
|
Grant Gochnauer commented If I change <aop:aspectj-autoproxy proxy-target-class="false"/> to <aop:aspectj-autoproxy proxy-target-class="true"/> - everything works OK but now we're back to using CGLIB and a much larger memory footprint. |
Juergen Hoeller commented This turned out as a regression caused by the fix for #11985. Fixed for 3.0.5 now to accommodate both scenarios. Feel free to give tonight's 3.0.5 snapshot a try, and let me know whether it works for you... Juergen |
Grant Gochnauer commented Thank you! :) |
Grant Gochnauer commented Confirmed fixed in: spring-framework-3.0.5.CI-804 |
Ritesh commented The exception reappeared as soon as I replaced Spring 3.0.5 jar files with 3.1 M2 jar files. |
Ritesh commented I get this exception after upgrading to 3.1 M2: java.lang.IllegalArgumentException: Name for argument type [java.lang.String] not available, and parameter name information not found in class file either. |
Ralph Schaer commented I got the same exception after upgrading from 3.1M1 to 3.1M2. This is the controller class that has the problem.
It works if I remove the |
Emmanuel Venisse commented As explained in above comments, this issue is present into 3.1 M2 |
Juergen Hoeller commented Rossen, this is probably an issue with our refactored RequestMethodHandlerAdapter. It was broken and got fixed in 3.0.x but apparently reappeared in 3.1 M2. Juergen |
Rossen Stoyanchev commented A fix related to class-proxied controllers was added after 3.1 M2 (#13110). Both interface and class-based proxying should work with the latest code. Emmanuel, Ralph, and Ritesh would you mind giving 3.1.0.BUILD-SNAPSHOT a try? The maven repository is http://maven.springframework.org/snapshot. |
Emmanuel Venisse commented ok, it is fixed in 3.1.0.BUILD-SNAPSHOT, thanks |
Rossen Stoyanchev commented Okay thanks for confirming. It sounds like the issue noticed in 3.1 M2 is addressed but feel free to reopen if not. It was a problem with proxying controllers (rather than controllers with interfaces). Ralph's code sample above confirms that as well. |
Marnel J. Rodriguez commented I am on 3.0.5.RELEASE and below is my interface code.
And still I get the error below. Handler execution resulted in exception org.springframework.web.bind.annotation.support.HandlerMethodInvocationException: Failed to invoke handler method [public abstract org.springframework.web.servlet.ModelAndView com.tmc.emr.web.template.docnotes.controller.DoctorsNotesActionController.saveDraft(java.lang.String,com.tmc.emr.workflow.model.FormResultDto,org.springframework.validation.BindingResult,javax.servlet.http.HttpSession,javax.servlet.http.HttpServletRequest)]; nested exception is java.lang.IllegalStateException: No parameter name specified for argument of type [java.lang.String], and no parameter name information found in class file either. If I remove the security context to disable the |
Marnel J. Rodriguez commented Maybe conflict on spring security AOP? |
Rossen Stoyanchev commented Does the controller method have the method parameter annotations? They need to be on the class. You'll notice the example in the original description has them. |
Ashish Kulkarni commented I am getting the same error in Spring 3.0.6 on Websphere 8.0.02 here is my code in Spring
|
Ashish Kulkarni commented here is my websphere log |
Rossen Stoyanchev commented Although you're getting the same exception, the original description is for a controller that implements an interface and is therefore wrapped with a JDK dynamic proxy. You don't have the required flag set to false either. So this is not the same issue. Perhaps you code is not compiled with debug symbols? You can add the parameter name to the |
Ashish Kulkarni commented Hi
if (StringUtils.equalsIgnoreCase(StringUtils.trimToEmpty(country), "USA")) { return myDao.getStates(); } |
Grant Gochnauer opened SPR-7483 and commented
In order to work around CGLIB and AOP memory issues all of our MVC controllers extend Interfaces for proxying.
We have something like this in our interface:
And in the class:
This worked great in Spring 3.0.2. After upgrading to 3.0.4, I receive the following stack trace:
Affects: 3.0.4
Referenced from: commits 284f98f
1 votes, 5 watchers
The text was updated successfully, but these errors were encountered: