Uploaded image for project: 'Stanbol (Retired)'
  1. Stanbol (Retired)
  2. STANBOL-970

TikaEngine may fail if XML framewoks are present in the Context ClassLoader

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • enhancement-engines-0.10.0
    • Enhancement Engines
    • None
    • Should only affect usages where Stanbol runs within an Embedded OSGI environment and the host application uses XML framewoks

    Description

      This is caused if the context ClassLoader (Thread#getContextClassLoader) provides Implementations of XML frameworks.

      Most Java XML libs prefer to load implementations by using the Thread#getContextClassLoader(). However OSGI has no control over this ClassLoader. Because of that there can be situations where Interfaces are loaded via the Bundle Classloader and the implementations are taken from the context Classloader.

      Reported Exception can be very manifold. Typically one would expect ClassCastException mentioning the same class two time. However more often Errors such as ExceptionInInitializerError are reported, as loading of implementations is often done by static members (or static blocks) and the JVM can not report the real exception in such cases.

      The only workaround for this problem is resetting the context ClassLoader with the bundle ClassLoader.

      Attachments

        Activity

          People

            rwesten Rupert Westenthaler
            rwesten Rupert Westenthaler
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: