Skip to content

CodePage.getCodePageByClass sometimes gives ClassNotFoundException from Maven #273

@schaloner-kbc

Description

@schaloner-kbc

When running a Maven build of a project, a ClassNotFoundException is thrown when a custom codepage is used. Through debugging, it can be seen this is linked to the classloader used by Class.forName(String) not having visibility of the requested class. By specifying a classloader to use, this can be avoided.

To Reproduce

Tricky. While this is happening consistently in Maven builds on both Mac and Windows, I can't reproduce it in the tests here. The associated pull request has updated how an instance of the class is obtained, and all existing tests still pass.

Expected behaviour

A custom CodePage instance should be created.

Additional context

Interestingly, this issue does not occur when the tests are run from IntelliJ.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions