syslog-ng
syslog-ng copied to clipboard
Java 9+ support
-
javah
has been removed from JDK 10,javac -h
should be used instead - fix illegal reflection issue with Java 9+:
The system class loader of syslog-ng has been replaced with our own implementation, which extends the default URLClassLoader.
That way, the protected addURL() method can be used directly without reflection.
Please note that URLClassLoader::addURL() is protected for a good reason. Once a URL-based class loader is initialized, we should not really modify its class paths. This is still being done in this PR, a real fix would restructure our Java module's initialization logic so that we don't have to extend our class paths more than once (we'd probably have to fix Java VM reinitialization during reload first).
Fixes #3053 Fixes #1943
Requires testing:
- [x] internal regression tests
Build SUCCESS
Build SUCCESS
The CI is failing because I've enabled building Java modules in devshell and it requires rebuilding dbld images.
You can check test results in my fork: https://github.com/MrAnno/syslog-ng/commits/java-18-test
Build FAILURE
Build FAILURE
Build FAILURE
Build FAILURE
Build FAILURE
@kira-syslogng test this please test branch=newer-java-version;
Build FAILURE
@kira-syslogng test this please test branch=newer-java-version;
I've rebased this PR against the current master. We've previously run internal tests on this branch, and we had 2 reviewers before the rebase.
There is still a refcache issue with newer Java versions, but I think the PR could go in without that fix because it improves the current situation a bit anyway.
Build FAILURE
Build FAILURE
Build FAILURE
Build FAILURE
@kira-syslogng retest this please
I've rebased this PR against the current master. We've previously run internal tests on this branch, and we had 2 reviewers before the rebase.
There is still a refcache issue with newer Java versions, but I think the PR could go in without that fix because it improves the current situation a bit anyway.
I am approving this based on the two earlier reviewers and that it does not touch anything material outside of modules/java and java-modules.
I've updated NEWS.md with this sentence:
+ * `java()` destinations: fixed compatibility with newer Java versions,
+ syslog-ng is now able to compile up to Java 18.
+
If you have any more details to add, please let me know.