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

Update to openhab 4.0.0 #153

Merged
merged 17 commits into from Jul 1, 2023
Merged

Update to openhab 4.0.0 #153

merged 17 commits into from Jul 1, 2023

Conversation

seaside1
Copy link
Owner

Update to openHAB 4.0.0

@seaside1 seaside1 mentioned this pull request Apr 18, 2023
@seaside1
Copy link
Owner Author

seaside1 commented Apr 20, 2023

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.

@seaside1
Copy link
Owner Author

Seems to work now for openHAB 4.

@seaside1 seaside1 changed the title [WIP] Update to openhab 4.x.x Update to openhab 4.x.x Apr 20, 2023
@seaside1 seaside1 changed the title Update to openhab 4.x.x Update to openhab 4.0.0 Apr 20, 2023
@seaside1
Copy link
Owner Author

Nice fixes @querdenker2k question is when we should switch main to 4.x.x

@querdenker2k
Copy link
Collaborator

for me we could switch the main branch to 4.x

@seaside1
Copy link
Owner Author

I have created a 3.x.x branch. Please review this PR, and I'll merge it to main.

Copy link
Collaborator

@querdenker2k querdenker2k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

running this branch for ~6 weeks now, seems to be fine

@seaside1 seaside1 merged commit 1c7dc74 into main Jul 1, 2023
2 checks passed
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.

None yet

2 participants