Closed seaside1 closed 1 year ago
JRule works under openHAB 4.0.0. One problem is that it is not possible to extract the jar-files like it is done in Java 11.
09:17:33.319 [docker-java-stream-1769901458] INFO docker.openhab - STDOUT: 07:17:33.315 [ERROR] [.jrule.internal.handler.JRuleHandler] - [JRuleHandler] Compilation failed, not creating jar file 09:17:33.319 [docker-java-stream-1769901458] INFO docker.openhab - STDOUT: 07:17:33.315 [INFO ] [.jrule.internal.handler.JRuleHandler] - [JRuleHandler] Compiling rules 09:17:33.319 [docker-java-stream-1769901458] INFO docker.openhab - STDOUT: 07:17:33.316 [DEBUG] [utomation.jrule.internal.JRuleConfig] - [+JRuleConf+] Openhab Conf Property: /openhab/conf
This is what is failing under java 17
private Vector<Class<?>> getLoadedClasses(ClassLoader classLoader) {
Field field = null;
try {
field = ClassLoader.class.getDeclaredField("classes");
field.setAccessible(true);
} catch (Throwable t) {
return null;
}
try {
@SuppressWarnings("unchecked")
final Vector<Class<?>> classes = (Vector<Class<?>>) field.get(classLoader);
return classes;
} catch (IllegalArgumentException | IllegalAccessException ignored) {
}
return null;
}
Since jar file extraction is failing compiling will fail and all docker-tests will fail.
Seems to work now for openHAB 4.
Nice fixes @querdenker2k question is when we should switch main to 4.x.x
for me we could switch the main branch to 4.x
I have created a 3.x.x branch. Please review this PR, and I'll merge it to main.
Update to openHAB 4.0.0