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

Metrics Plugin relies on un-exposed module API

    Details

    • Similar Issues:
    • Released As:
      4.0.2.3

      Description

      Starting up with the Metrics plugin installed and Java 10 shows the following stack trace (Jenkins still starts though):

       

      Jun 18, 2018 5:03:23 PM hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
      WARNING: Failed to instantiate Key[type=jenkins.metrics.impl.VMMetricProviderImpl, annotation=[none]]; skipping this component
      com.google.inject.ProvisionException: Unable to provision, see the following errors:

      1) Error injecting constructor, java.lang.reflect.InaccessibleObjectException: Unable to make public long com.sun.management.internal.OperatingSystemImpl.getProcessCpuTime() accessible: module jdk.management does not "opens com.sun.management.internal" to unnamed module @1ae408df
      at jenkins.metrics.impl.VMMetricProviderImpl.<init>(VMMetricProviderImpl.java:61)

      1 error
      at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52)
      at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
      at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:432)
      at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
      at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
      at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
      at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
      at hudson.ExtensionFinder$GuiceFinder._find(ExtensionFinder.java:394)
      at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:385)
      at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:493)
      at hudson.ExtensionList.load(ExtensionList.java:380)
      at hudson.ExtensionList.ensureLoaded(ExtensionList.java:318)
      at hudson.ExtensionList.iterator(ExtensionList.java:172)
      at jenkins.metrics.api.Metrics.afterExtensionsAugmented(Metrics.java:338)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104)
      at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
      at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
      at jenkins.model.Jenkins$5.runTask(Jenkins.java:1068)
      at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
      at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
      at java.base/java.lang.Thread.run(Thread.java:844)
      Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make public long com.sun.management.internal.OperatingSystemImpl.getProcessCpuTime() accessible: module jdk.management does not "opens com.sun.management.internal" to unnamed module @1ae408df
      at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:337)
      at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:281)
      at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:198)
      at java.base/java.lang.reflect.Method.setAccessible(Method.java:192)
      at jenkins.metrics.impl.VMMetricProviderImpl$CpuUsageGauge.<init>(VMMetricProviderImpl.java:226)
      at jenkins.metrics.impl.VMMetricProviderImpl.<init>(VMMetricProviderImpl.java:71)
      at jenkins.metrics.impl.VMMetricProviderImpl$$FastClassByGuice$$bd4f8b03.newInstance(<generated>)
      at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
      at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)
      at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)
      at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
      at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
      at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
      at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
      at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
      ... 26 more

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alecharp Adrien Lecharpentier
                Reporter:
                svanoort Sam Van Oort
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: