-
Notifications
You must be signed in to change notification settings - Fork 300
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
ClassNotFoundException when using an JCache EntryProcessor PAYARA-1257 #759
Comments
@OndrejM, any progress on this issue? |
No progress, still to reproduce and confirm if it's a bug. |
@OndrejM as it was reported as a result of the Bulgarian JUG hackathon on JCache, here is a sample project: You can find there an application where it is reproduced and under the docs directory are the (pretty lengthy) instructions to get there |
This will be indeed tricky to solve. Hazelcast is part of Payara and it is not loaded by the same classloader as a webapp. When you do However when you invoke an entry processor then the receiving Hazelcast member is not deserializing it on user-thread -> TCCL is not set -> For Payara Micro this could be solved by setting Hazelcast classloader to the same classloader as the webapp uses, but I am not sure how to solve this in general. |
It's possible we could write a classloader that could reach into the different deployed applications to look for classes and add that to Hazelcast. We did an experiment by creating one and bootstrapping Hazelcast with that classloader as its TCCL however that caused service loading issues in Hazelcast. We haven't tried the Config class. Another alternative we've been told may work is a custom Hazelcast Serializer. |
Of course, I would never write something like this (I double-checked the commit is not signed so I can still maintain plausible deniability :-D) |
did it work though? |
It did work. I deployed the demo application @ivannov linked + added a simple entry processor. Then I started a standalone application with a Hazelcast client and invoked the entry processor from the client. The entry processor (packaged inside my WAR) was executed on a Payara member. I talked to @vbekiaris about this and it appears a real solution would require 1st class multi-tenancy support inside Hazelcast. 1 app = 1 Hazelcast tenant. Otherwise there is really no good way to link a serialized blob to an application context. Unless you want to start a cluster per application. |
Has anyone tried to put hazelcast into applibs classloader? That may be a good workaround until something is devised by Payara. I have some ideas on automating this. |
I have an idea: |
we could potentially put an indication into the serialization stream with a custom serializer that indicated the application the class is from. App registry with a custom serializer should work |
Yes, or something similar |
@ivannov I am working on Payara fixes so your workarounds are no longer necessary |
I am excited to report that the application now works correctly using the custom serializer. |
Guestbook app that works with these fixes: |
Hi @ivannov, |
Relates to hazelcast/hazelcast#10875 |
Should work since 2018 |
Use Payara Enterprise Jenkinsfile
This issue is created from GitHub gist by @ivannov:
https://gist.github.com/ivannov/906096dcff2100ccd5b2ef11f97362dd
More detailed information on Java EE Guardian mailing list: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/javaee-guardians/8QxcgzGdt1o/dMU0wqh0LgAJ
Summary:
The text was updated successfully, but these errors were encountered: