Skip to content

Fix OSGi resolution, YAML load, and stale per-host cache on recent dotCMS#1

Open
fmontes wants to merge 1 commit into
mainfrom
fix/osgi-resolution-and-yaml-load
Open

Fix OSGi resolution, YAML load, and stale per-host cache on recent dotCMS#1
fmontes wants to merge 1 commit into
mainfrom
fix/osgi-resolution-and-yaml-load

Conversation

@fmontes
Copy link
Copy Markdown

@fmontes fmontes commented May 12, 2026

Summary

On recent dotCMS the plugin failed to deploy with cascading OSGi resolution errors, then with an empty Dotuserproxy.yml, then with stale per-host config after saves. Observed logs:

  • Unable to resolve ... osgi.wiring.package=com.dotcms.api.system.event.message
  • Unable to resolve ... osgi.wiring.package=common
  • javax.annotation [3.0.0, 4.0.0) and commons-io [1.4.0, 2.0.0) unresolved
  • AppsAPIImpl: Error reading yml file ... No content to map due to end-of-input
  • Bad token kept authenticating until a bundle restart

Fixes: dropped imports of non-exported packages (replaced with logger / inline checks), loosened Import-Package versions and disabled uses: so the bundle tolerates dotCMS library upgrades, switched to Bundle.getEntry for the YAML so resources at the JAR root resolve under the OSGi classloader, and removed the per-host lazyUserProxyMap so saved config is picked up on the next request instead of requiring a bundle restart.

Test plan

  • ./mvnw clean package builds the bundle
  • Deploy succeeds on recent dotCMS (no OSGi resolution errors)
  • Dotuserproxy.yml lands at full size; App appears in Apps UI
  • Save valid config → next request authenticates
  • Save invalid token → next request rejected without bundle restart

🤖 Generated with Claude Code

…tCMS

- Drop imports for non-exported packages (com.dotcms.api.system.event.message, common.Assert, javax.annotation.Nonnull)
- Loosen Import-Package version ranges and disable uses: directive in bundle plugin
- Load Dotuserproxy.yml via Bundle.getEntry instead of getResourceAsStream
- Remove per-host lazyUserProxyMap; rely on dotCMS AppsCache to avoid stale config after save

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant