Skip to content

Fixed ClassNotFoundException on plugin installation/upgrade (issue #146) - #147

Merged
oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/issue-146-cnfe-on-installation
Jun 1, 2026
Merged

oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/issue-146-cnfe-on-installation

Conversation

@oleg68

@oleg68 oleg68 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replaced broken migrateWindowsSettings (text replacement) with removeStaleComponentSettings(OLD_PKG) in ClaudeCodeInstaller.restored()
  • Text replacement fixed the XML class attribute in stale .settings files but left the <serialdata> base64 blob intact; that blob embeds the class name in binary Java serialization, causing TopComponent$Replacer.readObject → Class.forName("io.github.nbclaudecodegui.ui.ClaudeSessionTab") → CNFE
  • Deleting the stale file causes the window system to fall back to the module-layer default (correct class name, no binary data)
  • Added 4 new unit tests for removeStaleComponentSettings, including a regression test for the serialdata scenario

Test plan

  • mvn test passes (13 tests in V1MigrationHelperTest, all green)
  • Create a stale ClaudeSessionTopComponent.settings containing io.github.nbclaudecodegui.ui.ClaudeSessionTab in ~/.netbeans/<ver>/config/Windows2Local/Components/, install the NBM, verify no CNFE on startup and the file is deleted

Fixes #146

🤖 Generated with Claude Code

…session tab had been previously saved under the old package name

The existing migrateWindowsSettings helper did text replacement on
.settings files, which fixed the XML class attribute but left the
binary serialdata blob intact. That blob (base64-encoded Java
serialization) embeds the class name independently, so
TopComponent$Replacer.readObject still called
Class.forName("io.github.nbclaudecodegui.ui.ClaudeSessionTab")
and threw CNFE.

Fix: replace the text-replacement call with
removeStaleComponentSettings(OLD_PKG), which deletes any .settings
file containing the old package prefix. The window system then falls
back to the module-layer default (correct class name, no stale binary
data).

Resolves: nbplugins#146

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@oleg68
oleg68 merged commit fab4c91 into nbplugins:main Jun 1, 2026
3 checks passed
@oleg68
oleg68 deleted the bugfix/issue-146-cnfe-on-installation branch June 1, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exception upon installation of Claude plugin in NetBeans 29

1 participant