AbsaOSS / cobrix

A COBOL parser and Mainframe/EBCDIC data source for Apache Spark

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CodePage.getCodePageByClass sometimes gives ClassNotFoundException from Maven

schaloner-kbc opened this issue · comments

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.

Interesting. Will take a look.

Thanks for the PR! Releasing 2.0.7 which contains the fix...

Thanks!