Resolve OSGi Bundle Startup Errors by Configuring Boot Delegation

How to resolve OSGi bundle startup errors using boot delegation

Problem

OSGi bundles or plugins may fail to resolve or start, affecting application startup. The following errors may be displayed in the terminal output or application error logs:

java.lang.NoClassDefFoundError:
com/manageengine/apminsight/agent/JavaAgent

Cause

OSGi bundles run in isolated class loaders and may not be able to access JVM-internal packages or externally injected classes, such as those provided by monitoring agents, unless the required packages are explicitly boot-delegated to the parent class loader.

When boot delegation is not configured or is configured incorrectly, the OSGi framework cannot access the APM Insight Java agent classes because the agent package is not included in the boot delegation configuration. This causes the OSGi bundle or plugin to fail to resolve or start.

Solution

Add the APM Insight Java agent package, com.manageengine.*, to the existing boot delegation Java property.

For example:

-Dorg.osgi.framework.bootdelegation=com.sun.*,com.manageengine.*
Alert
Append com.manageengine.* to the existing boot delegation values. Do not remove the existing values.

Platform-specific configuration

The platform-specific properties and configuration locations are listed in the source document.

Platform
Property
Configuration location
Liferay DXP
module.framework.properties.org.osgi.framework.bootdelegation
portal-ext.properties
Atlassian Jira/Confluence
-Datlassian.org.osgi.framework.bootdelegation.extra
setenv.sh
Adobe Experience Manager (Sling)
-Dorg.osgi.framework.bootdelegation
sling.properties
Other OSGi platforms/bundled applications
-Dorg.osgi.framework.bootdelegation
Startup script, existing JAVA_OPTS, or another location where Java properties are maintained

Restart the application

After adding the com.manageengine.* package to the appropriate boot delegation property, restart the application server for the changes to take effect.

Summary

If an OSGi-based application fails to start with a NoClassDefFoundError or ClassNotFoundException error message for an APM Insight Java agent class, verify that com.manageengine.* has been added to the platform’s existing boot delegation configuration.

    • Related Articles

    • What are the common OAuth errors and how to solve them?

      While configuring OAuth, here are a few errors that you might face. They are: Invalid Redirect URI - Error_invalid_redirect_uri Invalid Code - invalid_code OAuth Scope associated to the OAuth Access Token is disallowed. - error_code: 1120 Invalid ...
    • Troubleshoot connection errors in the MySQL plugin

      When configuring the MySQL plugin, you may encounter the following errors: Error : Connection Error - This error typically indicates that there is a problem establishing a connection to the database. Sometimes, this message is supplemented with an ...
    • Adding Java agent to Spring Boot application

      Refer here to install Java agent to Spring Boot application
    • How are network interface metrics calculated using SNMP?

      Interface reports provide visibility into the performance and health of network interfaces. These reports use SNMP data collected at intervals to compute key metrics that help monitor traffic flow, detect anomalies, and optimize bandwidth usage. ...
    • Monitor and validate DNS IP changes using regex

      DNS administrators often monitor their DNS servers to detect changes in domain resolution and ensure IP mappings remain secure and accurate. Problem When your organization adds or modifies an IP address for your domain name, it’s critical to: Be ...