How do I resolve ClassNotFoundExceptions in OSGi environments?

Solution Verified - Updated -

Issue

The following will discuss how to troubleshoot ClassNotFoundExceptions in an OSGi (Karaf) environment. In an OSGi environment, if a bundle X requires a class from another bundle, two basic requirements must be met:

  1. There must be an import for the class's package in bundle X's OSGi header
  2. The package must be exported by another bundle.

With that in mind, how can we effectively troubleshoot a basic class-loading problem in Karaf?

Environment

  • Red Hat JBoss Fuse
    • 6.x, 7.x
  • Red Hat JBoss A-MQ
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In