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

IllegalArgumentException when using AnnotationUtils.findAnnotation [SPR-13634] #18212

Closed
spring-issuemaster opened this Issue Nov 2, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

spring-issuemaster commented Nov 2, 2015

Rossen Stoyanchev opened SPR-13634 and commented

java.lang.IllegalArgumentException: interface org.springframework.messaging.simp.annotation.SendToUser is not visible from class loader
	at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:616)
	at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:592)
	at java.lang.reflect.WeakCache$Factory.get(WeakCache.java:244)
	at java.lang.reflect.WeakCache.get(WeakCache.java:141)
	at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:455)
	at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:738)
	at org.springframework.core.annotation.AnnotationUtils.synthesizeAnnotation(AnnotationUtils.java:1280)
	at org.springframework.core.annotation.AnnotationUtils.findAnnotation(AnnotationUtils.java:500)
	at org.springframework.core.annotation.AnnotationUtils.findAnnotation(AnnotationUtils.java:561)
	at org.springframework.messaging.handler.HandlerMethod.getMethodAnnotation(HandlerMethod.java:214)
	at org.springframework.messaging.handler.HandlerMethod$HandlerMethodParameter.getMethodAnnotation(HandlerMethod.java:275)
	at org.springframework.messaging.simp.annotation.support.SendToMethodReturnValueHandler.supportsReturnType(SendToMethodReturnValueHandler.java:136)


Affects: 4.2 GA

Issue Links:

  • #18271 SynthesizedAnnotation is not visible from class loader
@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Nov 2, 2015

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Nov 2, 2015

Juergen Hoeller commented

AnnotationUtils was using the default ClassLoader for the creation of synthesized annotation proxies, which depends on the thread-context ClassLoader or on all jars sharing the same framework ClassLoader. The more reliable choice is to use the ClassLoader that the original annotation has been declared in, which we're doing as of 4.2.3 now.

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment