NullPointerException "anyController" is null
darkfrog26 opened this issue · comments
Describe the bug
In the latest Scala plugin for IntelliJ update (2022.1.592), I get the following error when importing the project:
java.lang.NullPointerException: Cannot invoke "jdk.internal.platform.CgroupInfo.getMountPoint()" because "anyController" is null
at java.base/jdk.internal.platform.cgroupv2.CgroupV2Subsystem.getInstance(CgroupV2Subsystem.java:81)
at java.base/jdk.internal.platform.CgroupSubsystemFactory.create(CgroupSubsystemFactory.java:113)
at java.base/jdk.internal.platform.CgroupMetrics.getInstance(CgroupMetrics.java:167)
at java.base/jdk.internal.platform.SystemMetrics.instance(SystemMetrics.java:29)
at java.base/jdk.internal.platform.Metrics.systemMetrics(Metrics.java:58)
at java.base/jdk.internal.platform.Container.metrics(Container.java:43)
at jdk.management/com.sun.management.internal.OperatingSystemImpl.<init>(OperatingSystemImpl.java:182)
at jdk.management/com.sun.management.internal.PlatformMBeanProviderImpl.getOperatingSystemMXBean(PlatformMBeanProviderImpl.java:280)
at jdk.management/com.sun.management.internal.PlatformMBeanProviderImpl$3.nameToMBeanMap(PlatformMBeanProviderImpl.java:199)
at java.management/java.lang.management.ManagementFactory.lambda$getPlatformMBeanServer$0(ManagementFactory.java:488)
at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:273)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1779)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
at java.management/java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:489)
at wvlet.log.LogEnv$.registerJMX(LogEnv.scala:74)
at wvlet.log.LogEnv$.<init>(LogEnv.scala:69)
at wvlet.log.LogEnv$.<clinit>(LogEnv.scala)
at wvlet.log.Logger$.<init>(Logger.scala:183)
at wvlet.log.Logger$.<clinit>(Logger.scala)
at xerial.sbt.Sonatype$.<init>(Sonatype.scala:25)
How to reproduce the issue
Describe how to reproduce the issue and show the current configurations.
- sbt version: 1.6.2
- sbt-sonatype version: 3.9.12
- Show your build settings: https://github.com/outr/sgine/blob/2.0/build.sbt
$ sbt
> sonatypeProfileName
`org.sgine`
> sonatypeRepository
https://oss.sonatype.org/service/local
- GitHub repository: https://github.com/outr/sgine/blob/2.0/
Additional context
It was working before I updated the IntelliJ plugin and outside of IntelliJ everything works fine. It appears to be some issue between the Sonatype plugin and the IntelliJ Scala plugin.
Hmmm, it appears to have something to do with Java 17. Switching to Java 8 appears to have solved it.
It looks like JMX related issue in airframe-log. Maybe we need to add a safe-guard for jdk17. wvlet/airframe#2127
Perhaps if the project used Scribe, this wouldn't happen. ;)
Released sbt-sonatype 3.9.13 with a fix