Uploaded image for project: 'Talend Component Kit'
  1. Talend Component Kit
  2. TCOMP-565

Class loader issue : java.lang.LinkageError (osgi/tcomp)

Apply templateInsert Lucidchart Diagram
    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Minor
    • None
    • None
    • None
    • None
    • All
    • Hide

      no more relevant

      Show
      no more relevant
    • Small

    Description

      This error occur when a class is loaded with two different class loader in the same JVM.

      In our case, this happens when the definition part use a class from a package of the runtime part that is not referenced or imported explicitly in the osgi bundle of the definition part.
      (Note that this may occur in other containers as spring for example)

      When such a class is used, it will be loaded by the sandbox class loader first as it not present in the parent class loader (not imported by the bundle).
      So when the parent class loader try to loaded this class for some reason we will get a java.lang.LinkageError

      A solution is to import the package explicitly in the definition bundle with the maven bundle plugin using the `Import-Package` tag

      So, if we have such a behavior (definition => runtime) we can't really guess which package is needed or not by the definition to be imported and we will discover the error only at runtime.

      Attachments

        Activity

          People

            Unassigned Unassigned
            akhabali Anas Khabali
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: