eXist-db / exist

eXist Native XML Database and Application Platform
https://exist-db.org
GNU Lesser General Public License v2.1
429 stars 180 forks source link

[BUG] NoClassDefFoundError visible in logs #3969

Closed dizzzz closed 2 years ago

dizzzz commented 3 years ago

when running v5.3 (release, plain, default config), the following stacktrace is visible during startup:

2021-07-05 12:20:43,534 [main] ERROR (Configuration.java [lookupModuleClass]:503) - Module http://exist-db.org/xquery/mail could not be initialized due to a missing dependancy (NoClassDefFoundError): javax/activation/MimeTypeParseException 
java.lang.NoClassDefFoundError: javax/activation/MimeTypeParseException
        at org.exist.xquery.modules.mail.MailModule.<clinit>(MailModule.java:72) ~[exist-mail-5.3.0.jar:5.3.0]
        at java.lang.Class.forName0(Native Method) ~[?:?]
        at java.lang.Class.forName(Class.java:315) ~[?:?]
        at org.exist.util.Configuration.lookupModuleClass(Configuration.java:489) [exist-core-5.3.0.jar:5.3.0]
        at org.exist.util.Configuration.loadModuleClasses(Configuration.java:455) [exist-core-5.3.0.jar:5.3.0]
        at org.exist.util.Configuration.configureXQuery(Configuration.java:391) [exist-core-5.3.0.jar:5.3.0]
        at org.exist.util.Configuration.<init>(Configuration.java:276) [exist-core-5.3.0.jar:5.3.0]
        at org.exist.util.SingleInstanceConfiguration.<init>(SingleInstanceConfiguration.java:56) [exist-core-5.3.0.jar:5.3.0]
        at org.exist.util.SingleInstanceConfiguration.<init>(SingleInstanceConfiguration.java:52) [exist-core-5.3.0.jar:5.3.0]
        at org.exist.jetty.JettyStart.run(JettyStart.java:207) [exist-core-5.3.0.jar:5.3.0]
        at org.exist.jetty.JettyStart.main(JettyStart.java:103) [exist-core-5.3.0.jar:5.3.0]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.exist.start.Main.invokeMain(Main.java:153) [exist-start-5.3.0.jar:5.3.0]
        at org.exist.start.Main.runEx(Main.java:292) [exist-start-5.3.0.jar:5.3.0]
        at org.exist.start.Main.run(Main.java:158) [exist-start-5.3.0.jar:5.3.0]
        at org.exist.start.Main.main(Main.java:95) [exist-start-5.3.0.jar:5.3.0]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.codehaus.mojo.appassembler.booter.AppassemblerBooter.executeMain(AppassemblerBooter.java:257) [appassembler-booter-2.1.0.jar:?]
        at org.codehaus.mojo.appassembler.booter.AppassemblerBooter.main(AppassemblerBooter.java:77) [appassembler-booter-2.1.0.jar:?]

No config changes:

2021-07-05 12:20:43,201 [main] INFO  (JettyStart.java [run]:181) - Running with Java 11.0.10 [AdoptOpenJDK (OpenJDK 64-Bit Server VM) in /opt/bbb/jdk-11] 
2021-07-05 12:20:43,203 [main] INFO  (JettyStart.java [run]:188) - Approximate maximum amount of memory for JVM: 5 GB 
2021-07-05 12:20:43,203 [main] INFO  (JettyStart.java [run]:189) - Number of processors available to JVM: 4 
2021-07-05 12:20:43,203 [main] INFO  (JettyStart.java [run]:191) - Running as user 'xxx' 
2021-07-05 12:20:43,203 [main] INFO  (JettyStart.java [run]:192) - [eXist Home : /home/xxx/xss/exist-distribution-5.3.0] 
2021-07-05 12:20:43,205 [main] INFO  (JettyStart.java [run]:193) - [eXist Version : 5.3.0] 
2021-07-05 12:20:43,205 [main] INFO  (JettyStart.java [run]:194) - [eXist Build : 20210626123843] 
2021-07-05 12:20:43,205 [main] INFO  (JettyStart.java [run]:195) - [Git commit : 1934cd7cd0c0ff3decac0b770969cab435409e52] 
2021-07-05 12:20:43,206 [main] INFO  (JettyStart.java [run]:197) - [Operating System : Linux 2.6.32-754.el6.x86_64 amd64] 
adamretter commented 3 years ago

@dizzzz Ah okay, looks like a package removed from JDK 11 that we need to put an explicit dependency on, I will take a look shortly...

dizzzz commented 3 years ago

@adamretter thnx! I At this moment I am only able to report issues, I cannot investigate them (which would be better); Investigations I need to done during the eve's

dizzzz commented 3 years ago
image

ok the jakarta lib is included here, but the original one is required?

adamretter commented 3 years ago

@dizzzz Actually the Jakarta lib in the pom.xml is a newer one than is needed and is the runtime instead of the API. Looks like I made some mistakes there previously.

I do note that we fixed this in FusionDB back in February, how urgent is this for you? I could potentially back-port the fixes from FusionDB to eXist-db; upgrading to the latest Mail version and Jakarta libraries.

dizzzz commented 3 years ago

How urgent.... well this means that the mail module is not working right now, correct? For this very moment it is not a problem for me perse, but it will not allow me to upgrade my servers in 'production'. That said, there are more open ends that I need to address before I can really update. I have the impression that v5.x (I am on 4.x still) is slower than expected. Need to debug the indices ....

duncdrum commented 2 years ago

Still seeing this on J11, with exist 5.3.1

see duncdrum/distroless-exist#1

dizzzz commented 2 years ago

Fixed by #4159