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

Bug Report: [JDK21] MultiRelease JAR in EAR (with Lucene)/FISH-7959 #6452

Closed
ctabin opened this issue Oct 16, 2023 · 6 comments · Fixed by #6460
Closed

Bug Report: [JDK21] MultiRelease JAR in EAR (with Lucene)/FISH-7959 #6452

ctabin opened this issue Oct 16, 2023 · 6 comments · Fixed by #6460
Assignees
Labels
Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev

Comments

@ctabin
Copy link
Contributor

ctabin commented Oct 16, 2023

Brief Summary

Hello,

We are checking our application (Jakarata EE10 with payara-embedded-all 6.2023.9) with the JDK21. All seems to run smoothly except for Lucene, which does not find a class during its lookup:

Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.MemorySegmentIndexInputProvider
        at com.sun.enterprise.loader.ASURLClassLoader.findClassData(ASURLClassLoader.java:807)
        at com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader.java:689)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)
        at com.sun.enterprise.loader.CurrentBeforeParentClassLoader.loadClass(CurrentBeforeParentClassLoader.java:83)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:534)
        at java.base/java.lang.Class.forName(Class.java:513)
        at java.base/java.lang.invoke.MethodHandles$Lookup.findClass(MethodHandles.java:2869)
        at org.apache.lucene.store.MMapDirectory.lookupProvider(MMapDirectory.java:422)

All the libraries related to Lucene are included in our EAR.

This works fine with the JDK17 because the lucene-core dependency was not a multi-release JAR before JDK19. However, since then there are some classes in META-INF/versions and the lookup in Payara fails.

META-INF/services/
META-INF/services/org.apache.lucene.analysis.TokenizerFactory
META-INF/services/org.apache.lucene.codecs.Codec
META-INF/services/org.apache.lucene.codecs.DocValuesFormat
META-INF/services/org.apache.lucene.codecs.KnnVectorsFormat
META-INF/services/org.apache.lucene.codecs.PostingsFormat
META-INF/services/org.apache.lucene.index.SortFieldProvider
META-INF/versions/
META-INF/versions/19/
META-INF/versions/19/org/
META-INF/versions/19/org/apache/
META-INF/versions/19/org/apache/lucene/
META-INF/versions/19/org/apache/lucene/store/
META-INF/versions/19/org/apache/lucene/store/MemorySegmentIndexInput$MultiSegmentImpl.class
META-INF/versions/19/org/apache/lucene/store/MemorySegmentIndexInput$SingleSegmentImpl.class
META-INF/versions/19/org/apache/lucene/store/MemorySegmentIndexInput.class
META-INF/versions/19/org/apache/lucene/store/MemorySegmentIndexInputProvider.class
META-INF/versions/20/
META-INF/versions/20/org/
META-INF/versions/20/org/apache/
META-INF/versions/20/org/apache/lucene/
META-INF/versions/20/org/apache/lucene/internal/
META-INF/versions/20/org/apache/lucene/internal/vectorization/
META-INF/versions/20/org/apache/lucene/internal/vectorization/PanamaVectorUtilSupport.class
META-INF/versions/20/org/apache/lucene/internal/vectorization/PanamaVectorizationProvider.class
META-INF/versions/20/org/apache/lucene/store/
META-INF/versions/20/org/apache/lucene/store/MemorySegmentIndexInput$MultiSegmentImpl.class
META-INF/versions/20/org/apache/lucene/store/MemorySegmentIndexInput$SingleSegmentImpl.class
META-INF/versions/20/org/apache/lucene/store/MemorySegmentIndexInput.class
META-INF/versions/20/org/apache/lucene/store/MemorySegmentIndexInputProvider.class
META-INF/versions/21/
META-INF/versions/21/org/
META-INF/versions/21/org/apache/
META-INF/versions/21/org/apache/lucene/
META-INF/versions/21/org/apache/lucene/store/
META-INF/versions/21/org/apache/lucene/store/MemorySegmentIndexInput$MultiSegmentImpl.class
META-INF/versions/21/org/apache/lucene/store/MemorySegmentIndexInput$SingleSegmentImpl.class
META-INF/versions/21/org/apache/lucene/store/MemorySegmentIndexInput.class
META-INF/versions/21/org/apache/lucene/store/MemorySegmentIndexInputProvider.class

Expected Outcome

The lookup of the classes inside Lucene should work fine.

Current Outcome

It crashes with a ClassNotFoundException.

Reproducer

You will find a reproducer here.

Operating System

Linux Debian

JDK Version

OpenJDK 21

Payara Distribution

Payara Embedded All

@ctabin ctabin added Status: Open Issue has been triaged by the front-line engineers and is being worked on verification Type: Bug Label issue as a bug defect labels Oct 16, 2023
@ctabin
Copy link
Contributor Author

ctabin commented Oct 16, 2023

I also checked my reproducer with GlassFish 7.0.9 => this works fine, so it is indeed something related in how Payara handles the ClassLoader of the EAR.

@shub8968
Copy link
Contributor

Hi @ctabin,

As documented, currently supported versions for Payara Platform of JDK are JDK 11 and JDK 17.

@shub8968 shub8968 added Status: Pending Waiting on the issue requester to give more details or share a reproducer and removed Status: Open Issue has been triaged by the front-line engineers and is being worked on verification labels Oct 20, 2023
@ctabin
Copy link
Contributor Author

ctabin commented Oct 20, 2023

Hi @shub8968,

Thanks for your feedback. However, let me argue:

  • MultiRelease Jar exist since JDK 9. We hit this problem with JDK21, but if Lucene used a MultiRelease JAR prior to JDK17 (event JDK11), the same problem would be hit. Hence, even if the JDK21 is not (yet) officially supported, shouldn't it be fixed anyway ? Any other dependency that provide a MultiRelease JAR with JDK11/JDK17 will generate the same error.
  • As far as I can tell, this is the only blocker we have to use Payara with the JDK21 so I guess the official support is not so far away 😉

I would gladly help and submit a PR to fix this if I can get some hint where to look at.

@ctabin
Copy link
Contributor Author

ctabin commented Oct 25, 2023

Hi @shub8968,

As stated, this is not related to JDK21 and I was able to provide a fix.
Is it possible to get someone to review it ?
Thanks !

@github-actions github-actions bot added Status: Abandoned User has not supplied reproducers for bug report, soon to be closed if user doesn’t come back and removed Type: Bug Label issue as a bug defect Status: Pending Waiting on the issue requester to give more details or share a reproducer labels Oct 31, 2023
@github-actions
Copy link

Greetings,
It's been more than 5 days since we requested more information or an update from you on the details of this issue. Could you provide an update soon, please?
We're afraid that if we do not receive an update, we'll have to close this issue due to inactivity.

@breakponchito
Copy link
Contributor

this is still in progress

@breakponchito breakponchito added Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev and removed Status: Abandoned User has not supplied reproducers for bug report, soon to be closed if user doesn’t come back labels Oct 31, 2023
@shub8968 shub8968 changed the title Bug Report: [JDK21] MultiRelease JAR in EAR (with Lucene) Bug Report: [JDK21] MultiRelease JAR in EAR (with Lucene)/FISH-7959 Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants