Skip to content

Fix Java SDK zero-to-one: NPE on OSS, no run task, helloworld requires Orkes auth#97

Open
nthmost-orkes wants to merge 2 commits intomainfrom
fix/apiclient-npe-no-auth-keys
Open

Fix Java SDK zero-to-one: NPE on OSS, no run task, helloworld requires Orkes auth#97
nthmost-orkes wants to merge 2 commits intomainfrom
fix/apiclient-npe-no-auth-keys

Conversation

@nthmost-orkes
Copy link
Copy Markdown
Contributor

@nthmost-orkes nthmost-orkes commented Mar 28, 2026

Summary

Three issues that blocked any first-time OSS user from running the Java SDK examples.

Fix 1: ApiClient NPE when auth keys not set (fixes #94)

ApiClient.applyEnvVariables() called .trim() on a null System.getenv() result when the legacy auth env vars were also absent. OSS Conductor users don't need auth keys — this crash stopped them before a single line of example code ran.

Fix 2: examples module has no run task (fixes #95)

Added application plugin to examples/build.gradle:

export CONDUCTOR_SERVER_URL=http://localhost:8080/api
./gradlew :examples:run
# → Workflow execution status: COMPLETED

Fix 3: helloworld/Main.java required Orkes auth (fixes #96)

Replaced ClientUtil (Orkes ApiClient, requires auth) with a direct ConductorClient from CONDUCTOR_SERVER_URL. Updated examples/README.md with OSS and Orkes run instructions.

Verified

./gradlew :examples:run against a local OSS Conductor server → Workflow execution status: COMPLETED

Zero-to-one tracking: conductor-oss/getting-started#51

🤖 Generated with Claude Code

nthmost-orkes and others added 2 commits March 27, 2026 19:15
When neither CONDUCTOR_AUTH_KEY nor CONDUCTOR_SERVER_AUTH_KEY is set
(the normal case for OSS Conductor users), the backwards-compatibility
fallback called .trim() on a null return value, crashing with NPE.

Null-check the legacy env vars before calling .trim() so that OSS users
who only set CONDUCTOR_SERVER_URL can build an ApiClient without error.

Fixes #94

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…om helloworld

- Add `application` plugin to examples/build.gradle so `./gradlew :examples:run`
  works out of the box (defaults to helloworld Main; override with -PmainClass=...)
- Update helloworld/Main.java to use ConductorClient directly with CONDUCTOR_SERVER_URL
  env var instead of ClientUtil/ApiClient — no auth required for OSS Conductor
- Update examples/README.md with concrete run instructions for both OSS and Orkes

Fixes #95 #96

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nthmost-orkes nthmost-orkes changed the title Fix NPE in ApiClient.applyEnvVariables() when auth keys are not set Fix Java SDK zero-to-one: NPE on OSS, no run task, helloworld requires Orkes auth Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant