Could not locate home

I’ve been using Wildfire and decided it was time to upgrade to OpenFire.

Only OpenFire will absolutely not start. I installed from RPM. I’ve tried adjusting permissions, etc… and it always fails with:

gourd-amber:/opt # /opt/openfire/bin/openfire.sh

Could not locate home

java.io.FileNotFoundException

at org.jivesoftware.openfire.XMPPServer.locateOpenfire(XMPPServer.java:788)

at org.jivesoftware.openfire.XMPPServer.initialize(XMPPServer.java:284)

at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:383)

at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:148)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(Unknown Source)

at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:93)

at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:49)

Critical Error! The home directory has not been configured,

which will prevent the application from working correctly.

ERROR 11874 ():

java.io.FileNotFoundException: XML properties file does not exist: openfire.xml

at org.jivesoftware.util.XMLProperties.<init>(XMLProperties.java:99)

at org.jivesoftware.util.XMLProperties.<init>(XMLProperties.java:61)

at org.jivesoftware.util.JiveGlobals.loadSetupProperties(JiveGlobals.java:771)

at org.jivesoftware.util.JiveGlobals.getHomeDirectory(JiveGlobals.java:228)

at org.jivesoftware.util.Log.initLog(Log.java:78)

at org.jivesoftware.util.Log.<clinit>(Log.java:64)

at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:421)

at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:148)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(Unknown Source)

at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:93)

at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:49)

2007.08.18 14:18:11 Error occurred opening log file: LogName was null - OpenfireHome not set?

2007.08.18 14:18:11 org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:421)

java.io.FileNotFoundException

at org.jivesoftware.openfire.XMPPServer.locateOpenfire(XMPPServer.java:788)

at org.jivesoftware.openfire.XMPPServer.initialize(XMPPServer.java:284)

at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:383)

at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:148)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(Unknown Source)

at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:93)

at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:49)

Error starting the server. Please check the log files for more information.

It has the same error if I try to start with /etc/rc.d/openfire. I’ve tried running it as daemon and root and it makes no difference. I’ve tried setting openfireHome in the scripts.

gourd-amber:/opt # cat /etc/sysconfig/openfire

  1. Set this to the path where openfire lives.

  2. If this is not set the script will look for /usr/local/openfire, then

  3. /opt/openfire.

OPENFIRE_HOME="/opt/openfire"

  1. If there is a different user you would like to run openfire as,

  2. change the following line.

OPENFIRE_USER=“daemon”

#OPENFIRE_USER=“root”

  1. If you wish to change the location of the openfire pid file,

  2. change the following line.

OPENFIRE_PIDFILE="/var/run/openfire.pid"

  1. If you wish to explictly specific the location of the log directory,

  2. you can set it here. Note that this applies to the logs generated outside

  3. openfire itself. If you want to change the location of openfire’s own

  4. logs, see the system property ‘log.directory’. If this is not set,

  5. it will default to $OPENFIRE_HOME/logs.

OPENFIRE_LOGDIR="/var/log/openfire"

  1. If you wish to override the auto-detected JAVA_HOME variable, uncomment

  2. and change the following line.

#JAVA_HOME=/usr/java/default

gourd-amber:/opt # cat /etc/SuSE-release

SuSE Linux 9.3 (i586)

VERSION = 9.3

Hi Adam,

That’s weird!!! I wonder what the exec line looks like when you run bin/openfire.sh. Could you edit that file and insert echo $openfire_exec_command at the bottom of the file right before the eval $openfire_exec_command line, and see what the exec line is when you run the file?

gourd-amber:/opt # openfire/bin/openfire.sh

exec /opt/openfire/jre/bin/java -server -DopenfireHome=/opt/openfire -Dopenfire.lib.dir=/opt/openfire/lib -classpath “/opt/openfire/lib/startup.jar” -jar “/opt/openfire/lib/startup.jar”

Could not locate home

java.io.FileNotFoundException

at org.jivesoftware.openfire.XMPPServer.locateOpenfire(XMPPServer.java:788)

at org.jivesoftware.openfire.XMPPServer.initialize(XMPPServer.java:284)

at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:383)

at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:148)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

Perhaps the FileNotFoundException is actually a SecurityException, implying that openfireHome is not readable by openfire. If you’re sure that the permissions and file modes are all correct, could it be an SELinux issue? Do you find any clue in /var/log/messages?

Never found any interesting about this. I created a new CentOS5 instance in VMware installed OpenFire, manually migrated the settings, and modified the DNS record. Now I have a working OpenFire installation.

I know it has been a long time, but here is what I found when I got this error:

Go to your installation, let’s say it’s /opt/openfire:

cd /opt/openfire/logs

cat stderror.log

see that it says it could not locate home

cd /opt/openfire/config

If you do an ls and see only:

crowd.properties openfire.xml.tmp

Then your problem is that you should see:

crowd.properties openfire.xml security.xml

You need to move openfire.xml.tmp to openfire.xml, copy in security.xml from some other installation of openfire,

and then do ls -l to check to see that the files are all properly owned by your user and group (not root!), and that

the permissions are -rw-r–r--.

Also, type ls -ld to make sure that your directory is owned by the same user and group and that it is readable

and executable. e.g.:

ls -ld /opt/openfire/conf

drwxr-xr-x. openfireuser openfiregroup /opt/openfire/conf

  • David Maxey