Skip to content

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

Closed

Description

@spring-projects-issues

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:

Activity

  1. spring-projects-issues commented on Nov 2, 2015

    @spring-projects-issues
    CollaboratorAuthor
  2. spring-projects-issues commented on Nov 2, 2015

    @spring-projects-issues
    CollaboratorAuthor

    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

  3. added
    type: bug
    in: messaging
    in: core
    in: web
    on Jan 11, 2019
  4. added this to the 4.2.3 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: corein: messagingin: webtype: bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions