Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-13634

IllegalArgumentException when using AnnotationUtils.findAnnotation

    Details

    • Last commented by a User:
      false

      Description

      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)
      
      

        Issue Links

          Activity

          Show
          rstoya05-aop Rossen Stoyanchev added a comment - Link to original report: https://github.com/rstoyanchev/spring-websocket-portfolio/issues/60
          Hide
          juergen.hoeller Juergen Hoeller added a comment -

          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

          Show
          juergen.hoeller Juergen Hoeller added a comment - 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

            People

            • Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              rstoya05-aop Rossen Stoyanchev
              Last updater:
              Juergen Hoeller
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 16 weeks, 5 days ago