Skip to content

Tycho 5.x: Context class loader set in Surefire Plugin leads to ClassNotFoundExceptions #5281

@glatuske

Description

@glatuske

We are currently trying to update to Tycho 5.0. A lot of our test cases fails because of different context class loader (compared to 4.x).

The context class loader set by Tycho in OsgiSurefireBooter allows to load classes reachable by the test plugin.

In some third party libraries (or even the JRE) the context class loader is used to load factory classes, with the Tycho class loader they get access to classes they actually should not have.

In our case REST-Assured checks for access to some optionally available classes using context class loader:
https://github.com/rest-assured/rest-assured/blob/master/rest-assured-common/src/main/groovy/io/restassured/internal/common/classpath/ClassPathResolver.java#L21
We are using a version of jakarta.xml.bind which is outside of the version range used in REST-Assured as optional dependency.

In similar ways javax.xml.parsers.DocumentBuilderFactory.newInstance() also returns an implementation provide by Apache Xerces bundles and not the an implementation part of the JRE.

If required I can try to create an example next week.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions