Skip to content

Fix ClassNotFoundException when triggering debugger actions#3

Closed
wl2027 wants to merge 1 commit into
mainfrom
codex/analyze-and-resolve-issue-#1
Closed

Fix ClassNotFoundException when triggering debugger actions#3
wl2027 wants to merge 1 commit into
mainfrom
codex/analyze-and-resolve-issue-#1

Conversation

@wl2027
Copy link
Copy Markdown
Owner

@wl2027 wl2027 commented May 26, 2026

Motivation

  • Fix a ClassNotFoundException that occurs when runtime expressions try to load com.runtime.pivot.agent.ActionExecutor from the system classloader in environments where the debugger uses a non-system classloader.

Description

  • Change ActionExecutorUtil to generate an execution expression that first attempts to load com.runtime.pivot.agent.ActionExecutor using the current thread's context classloader and then falls back to ClassLoader.getSystemClassLoader() if not found.
  • Preserve the existing reflective invocation of execute(...) and keep behavior identical when the class is available from the system classloader.
  • Modified file: src/main/java/com/runtime/pivot/plugin/utils/ActionExecutorUtil.java.

Testing

  • Attempted to run ./gradlew test --no-daemon, but the Gradle wrapper bootstrap failed to download the Gradle distribution due to an environment proxy returning HTTP/1.1 403 Forbidden, so unit tests could not be executed in this environment.
  • No automated tests were run successfully because of the wrapper download failure.

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7832a7f4f2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +19 to +20
" actionExecutorClass = contextClassLoader.loadClass(\"com.runtime.pivot.agent.ActionExecutor\");\n" +
" } catch (java.lang.ClassNotFoundException ignore) {\n" +
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fall back to system loader when context load fails to link

contextClassLoader.loadClass("com.runtime.pivot.agent.ActionExecutor") is only wrapped for ClassNotFoundException, but loadClass can also fail with linkage errors (for example NoClassDefFoundError/LinkageError when the class exists in that loader but its dependencies are incompatible). In that case this code aborts before reaching the system-loader fallback, so debugger actions still fail in mixed classloader setups instead of recovering. Treating linkage failures as a fallback condition here would preserve the intended behavior.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant