Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OsgiLocator CNF and suppress XStream warnings on Java 9+ #991

Merged
merged 1 commit into from
Nov 1, 2019

Conversation

wborn
Copy link
Member

@wborn wborn commented Nov 1, 2019

Updates the path used with the patch-module options to fix the following warning on Java 9+:

WARNING: package org.apache.karaf.specs.locator not in java.base
Error starting karaf activator org.apache.karaf.specs.activator.Activator: org/apache/karaf/specs/locator/OsgiLocator

Adds a few more "add-opens" to the Karaf scripts so we can suppress the warnings on Java 9+ caused by XStream's reflection usage.
Because XStream still works without any issues on Java 11 there is no need for users to see these warnings:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/openhab/userdata/cache/org.eclipse.osgi/66/0/bundleFile) to field java.lang.reflect.Proxy.h
WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Related to #768

Updates the path used with the patch-module options to fix the following warning on Java 9+:

WARNING: package org.apache.karaf.specs.locator not in java.base
Error starting karaf activator org.apache.karaf.specs.activator.Activator: org/apache/karaf/specs/locator/OsgiLocator

Adds a few more "add-opens" to the Karaf scripts so we can suppress the warnings on Java 9+ caused by XStream's reflection usage.
Because XStream still works without any issues on Java 11 there is no need for users to see these warnings:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/openhab/userdata/cache/org.eclipse.osgi/66/0/bundleFile) to field java.lang.reflect.Proxy.h
WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Related to openhab#768

Signed-off-by: Wouter Born <github@maindrain.net>
@kaikreuzer kaikreuzer merged commit 731718d into openhab:master Nov 1, 2019
@wborn wborn deleted the fix-resolve-java-warnings branch November 1, 2019 22:14
@cweitkamp cweitkamp added this to the 2.5 milestone Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants