cryostatio / cryostatio/cryostat-core

[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`

Open
#528 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
8
Forks
20
Avg merge
1d 20h
Merged PRs (30d)
12

Description

```
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)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with org.openjdk.jmc.common.security.SecurityManagerFactory and SecurelyStoredByteArray.java:48, then trace initialization through JMXRMIPreferences.java:72 and JMXRMISystemPropertiesProvider.java:61. Reproduce the snapshot connection path shown in the stack trace; done means the JMX connection no longer fails with a null security manager.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.