igniterealtime / openfire-pade-plugin

A plugin for Openfire that offers web-based unified communications - chat, groupchat, telephone, audio and video conferencing.
Apache License 2.0
57 stars 30 forks source link

Bug: loading plugins causes java.lang.ExceptionInInitializerError #84

Closed ChicagoJay closed 4 years ago

ChicagoJay commented 4 years ago

I have a brand new VM, with Ubuntu 20.04.1 installed. I loaded openJDK 11.0.9 via apt. I then installed openfire server, installed the certificate (a 3rd Party (RapidSSL) wildcard certificate), and integrated with Active Directory. Everything running fine.

I then install the 3 plugins (offocus, ofmeet, and pade) downloaded today. They install, the new menus appear, and I can access ofmeet via port 7443. After that, all I did was give the focus account a password, then save. An alert showed up, that changes require openfire to be restarted, so I run sudo systemctl restart openfire. After that, the admin page (port 9091) gives a 500 java.lang.ExceptionInInitializerError and https://fqdn:7443/ofmeet is 404. However, other admin tabs, like Meetings, work fine.

From exhaustive Googling, it seems this is a rather ambiguous error, as I have seen 3 different causes. One was a conflict with multiple JREs. (I can't find the link at the moment.) Another was an incompatibility with OpenJDK 11. A third was a collation issue, in MySQL.

When I ran the same set of steps, and loaded the ofmeet that is in the openfire repository, it works fine, but it's (of course) out of control - anyone can start a meeting, and there isn't any Active Directory integration.

Can I maybe get a hand, since it seems like the plugins are what's causing my server to bomb?

Sorry if I am breaking any protocols. Please correct me, and I will comply.

Thanks!

gjaekel commented 4 years ago

You may also try to trace it down to one of the plugins:

You may first disable all and then re-enable one-by-one. Restart OpenFire in between and check the results.

ChicagoJay commented 4 years ago

I can't get to the main log page, because the Admin page is Error 500:

URI: /index.jsp

500 javax.servlet.ServletException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: Could not initialize class java.net.PlainDatagramSocketImpl org.jivesoftware.openfire.admin.index_jsp javax.servlet.ServletException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: Could not initialize class java.net.PlainDatagramSocketImpl javax.servlet.ServletException: java.lang.NoClassDefFoundError: Could not initialize class java.net.PlainDatagramSocketImpl java.lang.NoClassDefFoundError: Could not initialize class java.net.PlainDatagramSocketImpl

If you tell me which log file to include, I'll be very happy to attach it.

Java: openjdk version "11.0.9" 2020-10-20 OpenJDK Runtime Environment (build 11.0.9+11-Ubuntu-0ubuntu1.20.04) OpenJDK 64-Bit Server VM (build 11.0.9+11-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)

If I uninstall Java 11 and install Java 9, will openfire automatically use the new JRE? I'll give it a try.

The only plugins I loaded were the 3 in this project: offocus, ofmeet, and pade. ofmeet seems to be the one that caused the problem.

Thanks for your help!

-- EDIT: I don't see Java 9 in the apt list. I tried purging openjdk 11, and installing 13.0.4, then I rebooted the VM. Openfire totally died. It's not starting up at all. I can revert to my snapshot, which has of up and running, but without any plugins.

gjaekel commented 4 years ago
gjaekel commented 4 years ago
* May you try Java9?

I'm very sorry about the typo, I meant Java8, e.g OpenJDK8u272. As Java11, Java8 is a LTS.

ChicagoJay commented 4 years ago

I rolled back to the snapshot, and ONLY loaded ofmeet plugin. I didn't configure anything, and restarted openfire. I have the 500 error now, so ofmeet is definitely the cause.

Here is the all.log file: all.log

Thanks again!

gjaekel commented 4 years ago

ofmeet is definitely the cause.

Yes, the classes mentioned in the stack trace above are used with this plugin by the Jitsi Video bridge.

ChicagoJay commented 4 years ago

I'm sorry - what is the proper method for installing the older JDK? When I purge 11 and install any other version (just tried it with 8) openfire completely breaks - the service won't start.

java --version fails. Unrecognized option: --version Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

I must be doing something newb.

gjaekel commented 4 years ago

I'm sorry - what is the proper method for installing the older JDK

I'm sorry, I'm not trained in using Debian-based distributions like Ubuntu; i'm using Gentoo.

But watch out, the version option for a JVM is -version with a single dash.

The exception occurred at the last restart seems to be another one (may you please rotate the all.log at every new start). Do you use IPv6 or just IPv4? Maybe adding -Djava.net.preferIPv4Stack=true to the JVM startup options may help, because there is a exception like

2020.11.10 08:06:58 INFO  [org.jitsi.impl.osgi.framework.AsyncExecutor]: net.java.sip.communicator.impl.resources.ResourceManagementActivator - Resource manager REGISTERED
2020.11.10 08:06:58 ERROR [org.jitsi.impl.osgi.framework.AsyncExecutor]: org.jitsi.impl.osgi.framework.BundleImpl - Error starting bundle: net.java.sip.communicator.impl.netaddr.NetaddrActivator@6f867a35
java.lang.ExceptionInInitializerError: null
        at net.java.sip.communicator.util.NetworkUtils.determineAnyAddress(NetworkUtils.java:1149) ~[jitsi-util-2.13.b5f2aa0.jar:?]
        at net.java.sip.communicator.util.NetworkUtils.<clinit>(NetworkUtils.java:62) ~[jitsi-util-2.13.b5f2aa0.jar:?]
gjaekel commented 4 years ago

For the logbook: The exception looks to me the same I run into in March 2020 with the OpenJDK8_242 release (https://github.com/jitsi/jitsi/issues/654). It appeared with this and was fixed in the next release (252).

ChicagoJay commented 4 years ago

But watch out, the version option for a JVM is -version with a single dash.

Both commands seem to work:

technician@ofmeet:~$ java --version openjdk 11.0.9 2020-10-20 OpenJDK Runtime Environment (build 11.0.9+11-Ubuntu-0ubuntu1.20.04) OpenJDK 64-Bit Server VM (build 11.0.9+11-Ubuntu-0ubuntu1.20.04, mixed mode)

technician@ofmeet:~$ java -version openjdk version "11.0.9" 2020-10-20 OpenJDK Runtime Environment (build 11.0.9+11-Ubuntu-0ubuntu1.20.04) OpenJDK 64-Bit Server VM (build 11.0.9+11-Ubuntu-0ubuntu1.20.04, mixed mode)

Also - I figured out how to switch versions. Full details are here.

Going to Java 8 HAS resolved the 500 error! Just for fun, I installed java 14, switched to it, and still no 500 error!
So this definitely does appear to be a java 11 issue.

Thanks again for the assistance!

gjaekel commented 4 years ago

No matter for you as a "plain vanilla JVM user". But I would say nope, it's a regression issue already happens within the Java8 line. It's very annoying that this was also introduced into Java11.

I have to report it upstream at once!!!!

ChicagoJay commented 4 years ago

One more interesting observation: the plugins screen only shows offocus and pade, there is no ofmeet, even if I add it again. But it is working, so this is perhaps an aesthetic issue?

gjaekel commented 4 years ago

There should be a tab called 'Meetings' left of 'Plugins'

ChicagoJay commented 4 years ago

Yes - it works perfectly!

gjaekel commented 4 years ago

In the log, I also notice something about LDAP, which is off-topic here. May I contact you tell me you email address?

ChicagoJay commented 4 years ago

Absolutely!

gjaekel commented 4 years ago

OK, we continue at that channel ...