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

Defer to parent classloader if file not found #83

Merged
merged 4 commits into from Nov 8, 2022

Conversation

seime
Copy link
Collaborator

@seime seime commented Nov 7, 2022

No description provided.

@seime
Copy link
Collaborator Author

seime commented Nov 7, 2022

Requires you to revert your revert of #67

@seaside1
Copy link
Owner

seaside1 commented Nov 7, 2022

Reverted back. I get an loop error when jrule is started.

2022-11-07 21:14:08.305 [INFO ] [.jrule.internal.handler.JRuleHandler] - [JRuleHandler] Compiling generated sources
2022-11-07 21:14:10.258 [INFO ] [.jrule.internal.handler.JRuleHandler] - [JRuleHandler] Creating jrule-generated.jar
2022-11-07 21:14:11.907 [INFO ] [internal.events.JRuleEventSubscriber] - [JRuleSubscriber] Event processing paused, queueing event Item '....' updated to XY
2022-11-07 21:14:11.911 [INFO ] [internal.events.JRuleEventSubscriber] - [JRuleSubscriber] Event processing paused, queueing event Item '....' updated to XT
.
.
.

@seime
Copy link
Collaborator Author

seime commented Nov 7, 2022

I think I need some more debug logs to understand what is happening @seaside1

@seaside1
Copy link
Owner

seaside1 commented Nov 7, 2022

I think it is the symbolic links in my system again that is the problem.

Changing to: (Keep the Inputstream instead of file works)

if (is != null) {
                           byte[] buf = is.readAllBytes();
                           is.close();
                           return defineClass(name, buf, 0, buf.length);
                       }

My guess is that File.getCanonicalFile() will work but I haven't tested it yet.
In general File seems to work quite bad with symbolic links in linux

@seaside1
Copy link
Owner

seaside1 commented Nov 8, 2022

This works on my system with symlinks. I think it is the File.exists() that fails with a symlink.
If you think it's ok, we will merge it.

@seime seime requested a review from seaside1 November 8, 2022 19:13
@seime
Copy link
Collaborator Author

seime commented Nov 8, 2022

LGTM. (Those damn symlinks biting me again ;))

Copy link
Owner

@seaside1 seaside1 left a comment

Choose a reason for hiding this comment

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

Looks good

@seaside1 seaside1 merged commit 995a995 into seaside1:main Nov 8, 2022
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