Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-61920

java.lang.ClassNotFoundException: javax.annotation.CheckForNull

    • Jenkins 2.237

      In the logs, i see a lot of class not found:

      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    | 2020-04-15 18:07:54.686+0000 [id=15]       WARNING j.t.i.j.MissingClassTelemetry#reportException: Added a missed class for missing class telemetry. Class: javax.annotation.Nullable
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    | java.lang.ClassNotFoundException: javax.annotation.Nullable
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1387)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1342)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1089)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at java.base/java.lang.Class.forName0(Native Method)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at java.base/java.lang.Class.forName(Class.java:398)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at java.base/sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:440)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:242)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:227)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at java.base/sun.reflect.annotation.AnnotationParser.parseParameterAnnotations2(AnnotationParser.java:185)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at java.base/sun.reflect.annotation.AnnotationParser.parseParameterAnnotations(AnnotationParser.java:162)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at java.base/java.lang.reflect.Executable.parseParameterAnnotations(Executable.java:78)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at java.base/java.lang.reflect.Executable.sharedGetParameterAnnotations(Executable.java:551)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at java.base/java.lang.reflect.Method.getParameterAnnotations(Method.java:712)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.Function$InstanceFunction.getParameterAnnotations(Function.java:423)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:176)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:535)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:280)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:280)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:280)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:676)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:755)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at jenkins.security.ResourceDomainFilter.doFilter(ResourceDomainFilter.java:76)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at jenkins.telemetry.impl.UserLanguages$AcceptLanguageFilter.doFilter(UserLanguages.java:128)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:159)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      jenkins_jenkins.1.zgbcwngkyxe4@ramipont    |    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

      I'm using the official 2.231-jdk11 docker image with  couple of additional packages (https://hub.docker.com/layers/jenkins/jenkins/2.231-jdk11/images/sha256-61c6599741200705274f9841d6d101d1abbce1e599c5bc98414308d88ffccc0d?context=explore).

          [JENKINS-61920] java.lang.ClassNotFoundException: javax.annotation.CheckForNull

          Daniel Beck added a comment -

          FYI teilo for the change to annotations.

          FYI mramonleon because there's probably no need to spam the log this badly with the same message over and over.

          Daniel Beck added a comment - FYI teilo for the change to annotations. FYI mramonleon because there's probably no need to spam the log this badly with the same message over and over.

          Jenkins was exposed through an apache reverse proxy, which overrides the error responses with an error page.

          After connecting through a tunnel directly to jenkins, i couldn't reproduce the error, so it is probably related to the proxy configuration - which never changed for a long time if im not mistaken.

          Im gonna check if I missed anything in the changelog or if I can fix the proxy config and post it here.

           

          charly ghislain added a comment - Jenkins was exposed through an apache reverse proxy, which overrides the error responses with an error page. After connecting through a tunnel directly to jenkins, i couldn't reproduce the error, so it is probably related to the proxy configuration - which never changed for a long time if im not mistaken. Im gonna check if I missed anything in the changelog or if I can fix the proxy config and post it here.  

          thinking about it, the problem i had seems in fact unrelated to the warnings in the log, and this ticket title. So feel free to close it.

          If it is relevant, I will open another one for the proxy issue, sorry for the confusion.

          charly ghislain added a comment - thinking about it, the problem i had seems in fact unrelated to the warnings in the log, and this ticket title. So feel free to close it. If it is relevant, I will open another one for the proxy issue, sorry for the confusion.

          for the record, the proxy config DID change with the addition of the http/2 protocol, which was causing the issue.

          charly ghislain added a comment - for the record, the proxy config DID change with the addition of the http/2 protocol, which was causing the issue.

          Daniel Beck added a comment -

          cghislai Thanks for the update. I'll rewrite this issue then, as I've already closed another as a duplicate for the log warnings.

          Daniel Beck added a comment - cghislai Thanks for the update. I'll rewrite this issue then, as I've already closed another as a duplicate for the log warnings.

          FYI: The classes "javax.annotation.Nonnull" and "javax.annotation.CheckForNull" are included e.g. in the Maven artifact "com.google.code.findbugs:annotations". Maybe this could be the cause.

          Juergen Zimmermann added a comment - FYI: The classes "javax.annotation.Nonnull" and "javax.annotation.CheckForNull" are included e.g. in the Maven artifact "com.google.code.findbugs:annotations". Maybe this could be the cause.

          We are also facing the same issue. Here is gist with startup log and list of plugins if that would be helpful to debug more. Thank you!

          https://gist.github.com/nrayapati/3cbf84213be6d492d334be1802f65349

          Naresh Rayapati added a comment - We are also facing the same issue. Here is gist with startup log and list of plugins if that would be helpful to debug more. Thank you! https://gist.github.com/nrayapati/3cbf84213be6d492d334be1802f65349

          Daniel Beck added a comment - - edited

          Only affects Jenkins on JDK11.

          Daniel Beck added a comment - - edited Only affects Jenkins on JDK11.

          Edward Nys added a comment -

          Affected too, on jdk11

          Edward Nys added a comment - Affected too, on jdk11

          Ramon Leon added a comment -

          I analyzed the log and it's safe to ignore the CNFE thrown in CoreReflectionFactory#makeNamedType. So I've added this location to the ignored places.

          In addition, I added a way to avoid printing twice a warning for the same class name in the log, to avoid polluting it on new cases.

          The PR: https://github.com/jenkinsci/jenkins/pull/4712

          Ramon Leon added a comment - I analyzed the log and it's safe to ignore the CNFE thrown in CoreReflectionFactory#makeNamedType . So I've added this location to the ignored places. In addition, I added a way to avoid printing twice a warning for the same class name in the log, to avoid polluting it on new cases. The PR: https://github.com/jenkinsci/jenkins/pull/4712

            mramonleon Ramon Leon
            cghislai charly ghislain
            Votes:
            5 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: