Openfire no longer starts

I have been running openfire for the better part of two years without issue. The last change I made was about 3 months ago, I installed a new plugin. Suddenly today for an unknown reason server stopped authenticating new SSOs. Typically, when this happens I just restart the entire linux server and everything is fine for another six months. Today, I restarted the server and openfire didn’t come back up automatically. I tried to start the server manually to no avail. I don’t remember the exact version of openfire running, but I believe it to be the more recent release.

I am not very linux savy, I know/knew/learned just enough to install and setup openfire.

When I try to restart the server I get the following error:

/etc/init.d/openfire start

No suitable Java Virtual Machine could be found on your system.

The version of the JVM must be at least 1.5.

Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.

You can also try to delete the JVM cache file /home/username/.install4j

If it wasn’t obvious, the web interface is down and the port 9090 is not listening per:

netstat -a | egrep 'Proto|LISTEN'

Any help you can provide would be greatly appreciated.

The results of java -version are:

The program ‘java’ can be found in the following packages:

  • gcj-4.4-jre-headless

  • gcj-4.6-jre-headless

  • openjdk-6-jre-headless

  • gcj-4.5-jre-headless

  • openjdk-7-jre-headless

Try: sudo apt-get install

My ubuntu version is:

lsb_release -a

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu 11.10

Release: 11.10

Codename: oneiric

The contents of my plugin folder:

:/opt/openfire/plugins$ ls -l

total 29172

drwxr-xr-x 3 root root 4096 2013-05-28 07:44 admin

drwxr-xr-x 3 root root 4096 2013-06-04 13:45 broadcast

-rw-r–r-- 1 root root 9776 2013-06-04 13:45 broadcast.jar

drwxr-xr-x 5 root root 4096 2013-08-01 11:59 fastpath

-rw-r–r-- 1 root root 416074 2013-08-01 11:59 fastpath.jar

drwxr-xr-x 12 root root 4096 2013-06-03 11:18 redfire

-rw-r–r-- 1 root root 27128472 2013-06-03 11:18 redfire.war

drwxr-xr-x 5 root root 4096 2013-06-03 11:18 search

-rw-r–r-- 1 root root 32031 2013-05-28 07:42 search.jar

drwxr-xr-x 4 root root 4096 2013-06-04 13:43 userservice

-rw-r–r-- 1 root root 16148 2013-06-04 13:43 userservice.jar

drwxr-xr-x 9 root root 4096 2013-08-01 08:21 webchat

-rw-r–r-- 1 root root 2231993 2013-08-01 08:21 webchat.war

So this is for all the linux noobs to follow. If you are a non-linux noob please feel free to follow up with nuance. Also, if someone could explain what might have happened, and how I can prevent it in the future that would be awsome.

This is the error I started with, but what does it mean?

No suitable Java Virtual Machine could be found on your system.

The version of the JVM must be at least 1.5.

Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.

You can also try to delete the JVM cache file /home/username/.install4j

Well, this message is coming out of the openfire startup script. When you run /etc/init.d/openfire, you are not executing a program as you would in windows, you are running a script that will in turn execute openfire. The script does a bunch of stuff, best I can tell, it’s searching for versions of java that are installed, aparently it’s got some flaws.

About the .install4j file; I am pretty sure it’s hidden and doesn’t show up with the DIR command, or the LS command. None of my research pointed to that resolving the problem anyway. But if you insist on trying to delete it, I found mine in the root directory, just type cd … until you can go any farther, then nano .install4j. if you see text you found it, if not look elsewhere.

While researching the problem; I saw this parameter everywere:

INSTALL4J_JAVA_HOME_OVERRIDE=

But no one ever explains where you can find it; well it’s also in the openfire script. On my box the name of the script file is /etc/init.d/openfire

Lots of people will tell you to use VI, it’s just a text editor, and I hate it, never could figure it out. I use NANO, it’s not automatically installed with my distrobution of Ubuntu but well worth installing. Use this command to install nano [sudo apt-get install nano].

To fix my problem I edited the script with:

sudo nano /etc/init.d/openfire

Set the parameter to

INSTALL4J_JAVA_HOME_OVERRIDE=/usr/lib/jvm/java-1.7.0-openjdk

Don’t forget to delete the leading hash tag. (#) Keep in mind that this exact text won’t work for everyone because you might have a different version of java installed. Use these commands to find your java directory.

cd /usr/lib/jvm

ls -l

Here I got several different versions of java. I didn’t immediatly know which to use, but I did remembered that I couldn’t get SSO to work until after I upgraded to 1.7 so I ignored the 1.6 versions and picked the 1.7.

Started the openfire script again and it started.

Again, please, if someone who knew what they were talking about could shed some light on why this might have happened, and what I can do to prevent it in the future that would be totally wicked.