Openfire.xml is empty

Hello all, I’m in a bit of a bind here. I installed openfire a couple of weeks ago on my 64bit clearos system. I didn’t install from the rpm, and I installed it in a custom location. Here’s the situation: I got it installed, it works fine, it runs. However, if I restart the service, or the server itself, it goes back to the setup page. After some searching I found that its a possibility that my openfire.xml is setup incorrectly. To my surprise, its completely empty. The system works, I just cannot restart the server without it resetting itself. Once I do the initial setup, it loads from my database just fine and runs smoothly. I have little experience with databases and openfire in general, so any suggestions would help. Some notes, while installing, I created a user jive to act as the user for openfire.

Did you extract the .tar.gz file to /home/jive ?

Do you use ‘jive’ to start Openfire or does it run as root?

There should be the ~/openfire/conf/openfire.xml file with rw permissions for user jive (or whichever user it is running - ‘daemon’ may not have the permission to read /home/jive/ )?

There should also be and env. var OPENFIRE_HOME set to ~/openfire .

Hmmm, wonderful questions. Lets see.

When I extracted the .tar.gz file, I did so in /home/Downloads. Thus I configured most everything there.

According to the /etc/init.d/openfired file, I set the openfire home to the directory above. The OPENFIRE_USER I seem to have that set as root. I should probably change that to the jive user at some point.

Also, I did give full permissions to the file within the /home/Downloads/openfire. I’m not sure where to go from here though. Your saying that my configuration files should have OPENFIRE_HOME set to ~/openfire, instead of the address I have set?

Do the start script ‘cd’ to the /home/Downloads directory (then setting OPENFIRE_HOME is likely not necessary) or is Openfire (the java process) started from a random directory?

I always cd into the openfire directory before starting Openfire. Openfire should log that it can’t create openfire.xml during startup/configuration but I don’t know whether the full qualified path is logged.

I should update Linux Installation Guide one day.

Hmmm. I’m not sure. I have it setup as an automated service when it starts, I typically don’t start it manually. Let me go through the log files and see if there’s something we can do. If I find I don’t understand any of it(a good chance), I’ll post it. Needs to go in a code box correct?

Alright, I’ve no idea which log I’m supposed to be looking into. I’ve got multiple error logs, as well as multiple all.logs. In those error logs, I seem to be getting this repeated a bunch of times. Sorry, no idea how to get it to go into code. I don’t use forums very often.

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

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

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructor AccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:422)

at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)

at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1127)

at com.mysql.jdbc.MysqlIO.(MysqlIO.java:356)

at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2502)

at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2539)

at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2321)

at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:832)

at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:46)

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

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructor AccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:422)

at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)

at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:417)

at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:344)

at java.sql.DriverManager.getConnection(DriverManager.java:664)

at java.sql.DriverManager.getConnection(DriverManager.java:208)

at org.logicalcobwebs.proxool.DefaultConnectionBuilder.buildConnection(DefaultConn ectionBuilder.java:39)

at org.logicalcobwebs.proxool.Prototyper.buildConnection(Prototyper.java:159)

at org.logicalcobwebs.proxool.Prototyper.sweep(Prototyper.java:102)

at org.logicalcobwebs.proxool.PrototyperThread.run(PrototyperThread.java:44)

Caused by: java.net.UnknownHostException: [host-name]

at java.net.InetAddress.getAllByName(InetAddress.java:1190)

at java.net.InetAddress.getAllByName(InetAddress.java:1126)

at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:250)

at com.mysql.jdbc.MysqlIO.(MysqlIO.java:306)

… 17 more

If you want to look for errors during setup look at the timestamp (or move the old log files away before you start Openfire again). This looks like a DB UnknownHostException: [host-name] exception. I wonder why Openfire is running.

Hmmm, Looking at the info log, I’m getting a couple other Errors. Should openfire not be running at all? I assume it would be much simpler if it just refused to run in the first place. Posting the important pieces of this log thus far:

2016.04.07 15:46:22 org.jivesoftware.database.DbConnectionManager - Unable to get a connection from the database pool (attempt 0 out of 10).

java.sql.SQLException: Access denied for user ‘openfire’@‘server.vrvyasserver.lan’ (using password: YES)

I got about 50 of these, which based on the amount, might actually be each user trying to access the service after I’ve restarted it. Just my guess though.

Next:

2016.04.08 10:49:07 org.jivesoftware.database.DbConnectionManager - Unable to get a connection from the database pool (attempt 0 out of 10).

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

followed by

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

a bunch of code here in the middle which I will post if necessary, and then at the end

Caused by: java.net.ConnectException: Connection refused

This happens a bunch as well and then the info file ends.

In the warn.log all I can find that its throwing at me is it can’t find the RSS feed.

If you are correct, and it is that error, how would I go about fixing that error? I have the database setup already, so if I need to uninstall and reinstall openfire, I can definitely do that.

Run the setup again. As it seems that you have no openfire.xml file you should enter then the proper hostname and not “host-name” within the database connection string.

Are you speaking in terms of the websetup or the original configuration? Gonna go back through the original just in case, as that seems to be the only possibility. I will update you afterwards.

Alright, so update. I don’t have an automatic script installer, which I didn’t think I did, however I wanted to check anyway. The Daemon runs as root, instead of jive and the home directory for openfire is in the previously mentioned post. My Openfire works, it just doesn’t seem to be saving the xml file. After restarting the service, I go through the setup, step 1: English, step 2: my current domain name, default ports and blowfish encryption, step 3: standard database, mysql, hostname is localhost and databasename is openfire, username=openfire and my password, rest is defaults, step 4: default, step 5: skip. log into the dashboard, and everything loads fine. The only issue being if I restart the server, I have to go through the whole process again. Tedious indeed.

I’ve opened up the dashboard and gone to the server properties section. There I’m finding all the information that I would expect to be in the xml file. It says setup is true, which is the particular property that I thought was done incorrectly. Maybe I’m logging in with the incorrect username and password? The username that I input in step 3, does that need to be root instead and my password there? I had assumed it was going to be the user I made in the database.

If you skip step 5 (admin password) then you need to use the user/password you created during the initial setup. It should not be the DB username+password.

I’ve done step 5 before. Logging into the dashboard isn’t an issue. Works perfectly. the tooltip in part 3 tells me to use the DB login for that username and password. I attempted to set it to my root information, to no avail. The logs stated they were updated today, however it looked like all the information they were displaying was from earlier in the year, where I was actually having issues setting it up. I can’t seem to find any errors having to do with access permissions. I’m sure that the error I’m dealing with has to do with the empty xml file, we just need to figure out why its not being written to.

Maybe my sql database doesn’t have permission to access and change the xml file? I’m not familiar with the way the program was built. I know that all of my users and settings, and even the system properties are all saved and loaded. I changed the setup value from true to false, restarted the service, and pulled it back up again, and after re configuring it was still set to false. It clearly did nothing so I changed it back. Anymore information would be extremely helpful.

AH! I seem to have found it. the log file inside the logs section of the dashboard tells me that I haven’t specified an XML file to write to. Specifically: 2016.04.21 15:27:03 org.jivesoftware.util.XMLProperties - Unable to save XML properties; no file specified

Now, how do I tell it to specify the file?