-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
context:component-scan element says error in the mvc-cofig.xml [SPR-11221] #15846
Comments
Juergen Hoeller commented What's the stacktrace there? This exception doesn't seem to come from Spring's own parsing code... Juergen |
not-three commented <context:component-scan
base-package="com.sowell.modules,com.sowell.test,iweb.security.captcha.web"
use-default-filters="false">
<context:include-filter type="annotation"
expression="org.springframework.web.bind.annotation.ControllerAdvice" />
</context:component-scan> This is the recent configuration, and the error message prints:
|
Juergen Hoeller commented Ok, so it looks like a mismatch between ControllerAdvice's new "value" attribute of type String[]... whereas We'll fix this for 4.0.1. Juergen |
Juergen Hoeller commented Strangely enough, the Spring 4.0 version of the AnnotationBeanNameGenerator class does check whether the "value" attribute is a String in isStereotypeWithNameValue already... So as far as I can see, it wouldn't ever enter the code block where it casts the value to a String, since isStereotypeWithNameValue would have returned false before... Anyway, I'll modify that code to proceed more defensively, checking the String value type right before the case. I'm not sure how your current ClassCastException manages to happen, but after such a restructuring of the code, there is no chance in can ever happen - not even with an overridden isStereotypeWithNameValue method or the like. Juergen |
Juergen Hoeller commented Hopefully addressed through the above-mentioned code rearrangement. Please test a 4.0.1 snapshot accordingly; see http://projects.spring.io/spring-framework/ for repo information. Juergen |
not-three commented Just display errors, the application base spring 4 still run properly so far. |
not-three commented <groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.0.1.BUILD-SNAPSHOT</version> I have test this version, errors message still remained. |
not-three commented I copy ControllerAdvice and AnnotationBeanNameGenerator source file from the github, re-compile spring-context and spring-web, and replace org.springframework.context_4.0.0.20130829-M3.jar and org.springframework.web_4.0.0.20130829-M3.jar in the eclipse pulgins directory. Now it's has no errors, so the Spring Tool Suite and it's plugin need updated too. Thanks again. |
John Andrew Barnes commented If it's any help, I can reproduce this bug by adding " |
Ricardo Rodriguez Garcia commented I am testing with release version 4.0.1 the erros is still showning but if the marker is removed from eclipse the application runs fine. However the error will return if a clean is performed on the project and then rebuild. |
Fernandez Ludovic commented Please re-open this issue, problem is not resolved with 4.0.1. |
Juergen Hoeller commented Is the only remaining problem that Spring Tool Suite doesn't include Spring Framework 4.0.1 yet? In that case, it should rather be reported to the STS team... From the Spring Framework perspective, it's not clear what we could do to further improve the situation. If there is anything specific, let us know. Juergen |
Tarundeep Singh commented I am still facing this issue. Seems most likely to be same issue. Posted details here: Request you to review this issue once again. |
Baptiste Gaillard commented Hi, we also encounter this problem, I'm using Spring As the cause of this problems seems to be the |
not-three opened SPR-11221 and commented
When I migrate 3.2.5.Release to 4.0.0.Realse, the following config tells errors
The error message is, "Error occured processing XML '[Ljava.lang.String; cannot be cast to java.lang.String'. See Error Log for more details"
!https://jira.springsource.org/secure/attachment/21541/component-scan.jpg!
Affects: 4.0 GA
Attachments:
Referenced from: commits 7ad6df8, 2a3ca61, 23546b1
Backported to: 3.2.7
0 votes, 7 watchers
The text was updated successfully, but these errors were encountered: