cryostatio / cryostat-core

Core library providing a convenience wrapper and headless stubs for managing JFR with JDK Mission Control API
https://cryostat.io/
Other
8 stars 21 forks source link

[Bug] `java.lang.NullPointerException: Cannot invoke "org.openjdk.jmc.common.security.ISecurityManager.get(String)" because the return value of "org.openjdk.jmc.common.security.SecurityManagerFactory.getSecurityManager()" is null` #528

Open andrewazores opened 3 weeks ago

andrewazores commented 3 weeks ago
java.lang.NullPointerException: Cannot invoke "org.openjdk.jmc.common.security.ISecurityManager.get(String)" because the return value of "org.openjdk.jmc.common.security.SecurityManagerFactory.getSecurityManager()" is null
    at org.openjdk.jmc.common.security.SecurelyStoredByteArray.get(SecurelyStoredByteArray.java:48)
    at org.openjdk.jmc.rjmx.common.preferences.JMXRMIPreferences.getProperties(JMXRMIPreferences.java:72)
    at org.openjdk.jmc.rjmx.common.internal.JMXRMISystemPropertiesProvider.clearJMXRMISystemProperties(JMXRMISystemPropertiesProvider.java:61)
    at org.openjdk.jmc.rjmx.common.internal.RJMXConnection.connectJmxConnector(RJMXConnection.java:597)
    at org.openjdk.jmc.rjmx.common.internal.RJMXConnection.establishConnection(RJMXConnection.java:572)
    at org.openjdk.jmc.rjmx.common.internal.RJMXConnection.connect(RJMXConnection.java:357)
    at io.cryostat.core.net.JFRJMXConnection.attemptConnect(JFRJMXConnection.java:407)
    at io.cryostat.core.net.JFRJMXConnection.connect(JFRJMXConnection.java:362)
    at io.cryostat.core.net.JmxFlightRecorderService.tryConnect(JmxFlightRecorderService.java:61)
    at io.cryostat.core.net.JmxFlightRecorderService.getSnapshotRecording(JmxFlightRecorderService.java:84)
    at io.cryostat.recordings.RecordingHelper.lambda$createSnapshot$11(RecordingHelper.java:464)
    at io.cryostat.targets.TargetConnectionManager.lambda$executeConnectedTaskUni$1(TargetConnectionManager.java:201)
    at io.smallrye.mutiny.unchecked.UncheckedFunction.lambda$toFunction$0(UncheckedFunction.java:45)
    at io.smallrye.context.impl.wrappers.SlowContextualFunction.apply(SlowContextualFunction.java:21)
    at io.smallrye.mutiny.operators.uni.UniOnItemTransform$UniOnItemTransformProcessor.onItem(UniOnItemTransform.java:36)
    at io.smallrye.mutiny.operators.uni.builders.UniCreateFromCompletionStage$CompletionStageUniSubscription.forwardResult(UniCreateFromCompletionStage.java:63)
    at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
    at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
    at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1773)
    at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:635)
    at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1495)
    at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:11)
    at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:11)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:1583)
andrewazores commented 3 weeks ago

I think this is supposed to be avoided here:

https://github.com/cryostatio/cryostat-core/blob/dbc4dd99c6b48a99aaa56c211085fb6e5b7f9980/cryostat-core/src/main/java/io/cryostat/core/CryostatCore.java#L28

and it doesn't look like modern versions of Cryostat are calling this method anymore, so this may actually just be a Cryostat bug.