1
Prerequisites
Confirm the following before you begin:
- NSP daemon installed and running on port 7842. Download from platform.nelieo.com/download.
- JDK 11 or later installed on the host machine. The JVM probe requires the
AttachAPIfromtools.jar(JDK 11+). A JRE alone is not sufficient. - The target Java application is running. The daemon scans for processes every 5 seconds, so start your app before querying for it. This guide uses a generic Java GCS application as its primary example; the same steps apply to IntelliJ IDEA, Jenkins, SAP ERP, Eclipse, Elasticsearch, and any other JVM-based app.
- Python 3.11+ and the NSP SDK installed.
- An NSP API key from platform.nelieo.com, stored in the
NSP_API_KEYenvironment variable.
2
Detect the Java App
Call Example response for a Java GCS application:You can also list apps with the Python SDK:Expected output:
/substrate/v1/apps to verify the daemon has classified your application as a JVM app. Look for "runtime": "jvm" in the response.The first JVMTI attachment (cold probe) can take up to 60–90 seconds as the probe enumerates all loaded classes and builds the schema. Subsequent runs use the cached schema and attach in under two seconds. Watch
probe_status progress from attaching → cold_probe → active.3
Read Java App State
Attach to the app by name and read state using dot-notation keys. The JVM probe normalises Java object fields into SSF, giving you typed access with Expected output:
get_int(), get_float(), get_str(), and get_bool().4
Explore Available Actions
Iterate Example output for a Java GCS:
session.actions to see every action the JVM probe discovered for this application. The probe discovers both NSP-native actions defined in the schema registry and raw Java method invocation actions exposed via JNI reflection.5
Execute a JVM Action
Use Expected output:
session.execute() to run actions on the Java app. Reversible actions (like set_mode) do not require a verify_expression. Irreversible actions (like take_off) require verify=True and a verify_expression — NSP enforces this safety gate automatically.6
Handle the jvm_invoke_snapshot Field
When NSP executes a JVM action that invokes a Java method directly, the action response includes a Example
jvm_invoke_snapshot field. This field contains a serialised snapshot of the Java object returned by the method call — useful when the method returns a complex object rather than a primitive.jvm_invoke_snapshot output:jvm_invoke_snapshot is null for actions that do not invoke a Java method directly. Always check result.success first — a True result with a null snapshot simply means the action completed without returning a value (i.e. the Java method returns void).7
Cold Probe Timing and Confidence
JVMTI attachment involves loading a native agent into the JVM and performing class enumeration — this takes time on first run. Understanding the lifecycle helps you write robust agents.The
probe_status field progresses through these stages:JVM confidence typically stabilises at 0.93–0.97 once active. Actions are gated by confidence level:
reversible_write requires >= 0.80; irreversible_write requires >= 0.95.