JVM errors when trying to run Openfire in Ubuntu Feisty (7.04)

I am trying to run the latest Openfire in Ubuntu 7.04. However, when I try to run it (sudo ./openfire in the relevant directory), I get the following error:

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/james/.install4j

I have checked, and I definitely do have the JRE installed in /usr/lib/jvm/java-6-sun-1.6.0.00/jre/bin/java. I tried setting the INSTALL4J_JAVA_HOME_OVERRIDE=/usr/lib/jvm/java-6-sun-1.6.0.00/jre/bin/java setting in the openfire script file, but I got exactly the same error.

Does anyone have any idea what the problem might be?

Message was edited by: jamespetts

Hi James,

it may be the script itself. Does it help to execute

cd /usr/local/openfire/bin # (or wherever you did install Openfire)

nohup /usr/lib/jvm/java-6-sun-1.6.0.00/jre/bin/java -jar …/lib/startup.jar >…/logs/STDOUT.log 2>…/logs/STDERR.log &

It may be possible that you did not install a server jre, the scripts starts Openfire with the -server JRE option.

LG

Thank you for your reply. I am rather confused, however: what exactly is a server JRE? I have never before heard of the concept of having a separate JRE for server applications, and, searching “server jre” on Synaptic Package Manager produced no results. What is a server JRE, and how would I go about getting one installed?

Aha, I’'ve just tried your suggested commands, and it worked! Thank you very much. Might I ask, out of interest, what about your command made it work that just plain using ./openfire did not?

Hi,

the client and server JRE’'s differ only a little bit, and are of designed for good client or server performance. Anyhow I have no idea how much % faster or stable one or the other version is.

I did never like the script supplied by Igniterealtime and I do not care about it any more. It executes to much checks and may select the wrong JRE.

You could also try

cd /usr/local/openfire/bin # (or wherever you did install Openfire)

nohup /usr/lib/jvm/java-6-sun-1.6.0.00/jre/bin/java -server -jar …/lib/startup.jar >…/logs/STDOUT.log 2>…/logs/STDERR.log &

to verify whether the “-server” option causes the trouble.

LG

Hmm, the -server option works fine. It must have been an error in the supplied script. Thank you for your help

I thought that it was working, but, in fact, it really isn’'t properly. Firstly, when I got it set up first of all (running it from the command line), I was able to get into the web setup, and that seemed to work fine, and I could log onto it from the local machine using Gaim (2.0-RC6) specifying the hostname as “localhost”, but could not log onto it from anywhere else, nor even from the local machine using the IP address in the hostname field (I would get a “read error”).

I restarted the machine on which the Openfire server was running, and now the server won’'t start at all: when I check the logs, I get the following:

STDERR.log

java.lang.ClassNotFoundException: org.jivesoftware.openfire.XMPPServer

at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

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

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

error.log

2007.04.28 13:06:09 org.jivesoftware.util.log.util.CommonsLogFactory$1.fatal(CommonsLogFactory.java: 95) The scratchDir you specified: /tmp/Jetty_0_0_0_0_9090_webapp____-dnguxu/jsp is unusable.

2007.04.28 13:06:09 org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java: 462) Error loading plugin: /usr/bin/openfire/plugins/search

java.lang.NullPointerException: No ComponentManager implementation available.

at org.xmpp.component.ComponentManagerFactory.getComponentManager(ComponentManager Factory.java:52)

at org.jivesoftware.openfire.plugin.SearchPlugin.initializePlugin(SearchPlugin.jav a:102)

at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java :404)

at org.jivesoftware.openfire.container.PluginManager.access$200(PluginManager.java :46)

at org.jivesoftware.openfire.container.PluginManager$PluginMonitor.run(PluginManag er.java:916)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)

at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101 (ScheduledThreadPoolExecutor.java:98)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodi c(ScheduledThreadPoolExecutor.java:181)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Schedu ledThreadPoolExecutor.java:205)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 885)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)

at java.lang.Thread.run(Thread.java:619)

2007.04.28 13:06:13 org.jivesoftware.openfire.spi.ConnectionManagerImpl.startServerListener(Connecti onManagerImpl.java:128) Could not setup a server socket

java.net.BindException: Address already in use

at java.net.PlainSocketImpl.socketBind(Native Method)

at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)

at java.net.ServerSocket.bind(ServerSocket.java:319)

at java.net.ServerSocket.(SocketAcceptThread.java:56)

at org.jivesoftware.openfire.spi.ConnectionManagerImpl.startServerListener(Connect ionManagerImpl.java:114)

at org.jivesoftware.openfire.spi.ConnectionManagerImpl.createSocket(ConnectionMana gerImpl.java:96)

at org.jivesoftware.openfire.spi.ConnectionManagerImpl.start(ConnectionManagerImpl .java:705)

at org.jivesoftware.openfire.XMPPServer.startModules(XMPPServer.java:528)

at org.jivesoftware.openfire.XMPPServer.access$500(XMPPServer.java:90)

at org.jivesoftware.openfire.XMPPServer$1.run(XMPPServer.java:364)

2007.04.28 13:06:13 org.jivesoftware.openfire.spi.ConnectionManagerImpl.startClientListeners(Connect ionManagerImpl.java:270) Could not setup a server socket

java.net.BindException: Address already in use

at sun.nio.ch.Net.bind(Native Method)

at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)

at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)

at org.apache.mina.transport.socket.nio.SocketAcceptor.registerNew(SocketAcceptor. java:397)

at org.apache.mina.transport.socket.nio.SocketAcceptor.access$900(SocketAcceptor.j ava:55)

at org.apache.mina.transport.socket.nio.SocketAcceptor$Worker.run(SocketAcceptor.j ava:232)

at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 885)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)

at java.lang.Thread.run(Thread.java:619)

2007.04.28 13:14:14 org.jivesoftware.util.log.util.CommonsLogFactory$1.error(CommonsLogFactory.java: 87) Line=19 The content of element type “dwr” must match “(init?,allow?,signatures?)”.

2007.04.28 14:29:55 org.jivesoftware.openfire.container.PluginManager.shutdown(PluginManager.java:10 6)

java.lang.NullPointerException

at org.jivesoftware.openfire.plugin.SearchPlugin.destroyPlugin(SearchPlugin.java:1 26)

at org.jivesoftware.openfire.container.PluginManager.shutdown(PluginManager.java:1 03)

at org.jivesoftware.openfire.XMPPServer.shutdownServer(XMPPServer.java:865)

at org.jivesoftware.openfire.XMPPServer.access$600(XMPPServer.java:90)

at org.jivesoftware.openfire.XMPPServer$ShutdownHookThread.run(XMPPServer.java:811 )

warn.log

2007.04.28 13:04:48 Error when trying to update to new name

java.sql.SQLException: Table not found in statement

at org.hsqldb.jdbc.Util.throwError(Unknown Source)

at org.hsqldb.jdbc.jdbcPreparedStatement.(Unknown Source)

at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)

at org.jivesoftware.database.AbstractConnection.prepareStatement(AbstractConnectio n.java:36)

at org.jivesoftware.database.SchemaManager.updateToOpenfire(SchemaManager.java:298 )

at org.jivesoftware.database.SchemaManager.checkOpenfireSchema(SchemaManager.java: 66)

at org.jivesoftware.database.DbConnectionManager.setConnectionProvider(DbConnectio nManager.java:467)

at org.jivesoftware.openfire.admin.setup.setup_002ddatasource_002dsettings_jsp._js pService(setup_002ddatasource_002dsettings_jsp.java:155)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1074)

at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:11 8)

at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1065)

at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:65)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1065)

at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingF ilter.java:41)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1065)

at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:69)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1065)

at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:98)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1065)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)

at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)

at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)

at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)

at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)

at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollect ion.java:146)

at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)

at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)

at org.mortbay.jetty.Server.handle(Server.java:285)

at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)

at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.j ava:751)

at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)

at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)

at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)

at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)

at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)

2007.04.28 13:06:49 Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.

2007.04.28 13:06:49 Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.

I find this behaviour unpredictable and bizarre, and the errors cryptic. Do you (or does anyone else) have any idea at all about what is causing this or how to deal with it?

Hi,

“java.net.BindException: Address already in use” means that Openfire (or another process which uses the same ports) is already running. A “ps -ef|grep java” should show you a running Openfire process. You should kill it with “kill -15 PID” - this is a Ctrl+C and a clean way to stop Openfire.

LG

That’‘s odd: I don’‘t think that Openfire is already running. And, surely, if it was, it’'d let me access the web console, as it did before I restarted?

This is what I get when I type that command that you suggested:

james 20390 20354 0 21:37 pts/0 00:00:00 grep java

Does that suggest that Openfire is running?

Hi,

this looks fine, so I wonder what “netstat -an|grep LISTEN” displays. The ports 9090, 9091, 5222, 5223, 5269, … should not be shown.

Is “james” the right user to start Openfire? I thought it would be “openfire”, “jive” or whatever the setup script creates or which you did use.

LG

When running “netstat -an|grep LISTEN”, none of the ports that you mentioned were listed.

You might be right about the usernames; if so, how would I set a startup script to run it as “openfire”, rather than as myself?

The original issue is resolved, but further problems, as yet unresolved, have since arisen.

(Ahh, I did not realise that this comment would appear in the thread. I was just marking as unanswered because of the subsequent issues. I am grateful for the help that I have received so far).

Message was edited by: jamespetts

Hi,

you may want to use “su - otheruser -c command” - if you are not root you need to enter the password of “otheruser”. You can avoid to enter the password by using the “visudo” tool.

LG

I changed the openfire.sh file in my /etc/init.d directory to:

su - root -c nohup /usr/lib/jvm/java-6-sun-1.6.0.00/jre/bin/java -server -jar /usr/bin/openfire/lib/startup.jar >/usr/bin/openfire/logs/STDOUT.log 2>/usr/bin/openfire/logs/STDERR.log &

but the ps -ef|grep java command still returns:

james 3553 3497 0 20:53 pts/0 00:00:00 grep java

and the netstat -an|grep LISTEN still does not show anything listening on port 9091. Running sudo ./openfire.sh produces no visible errors, but the openfire service still does not start. The STDERR.log contains the following text:

+su: invalid option – j

Usage: su

Options:

-c, --command COMMAND pass COMMAND to the invoked shell

-h, --help display this help message and exit

-, -l, --login make the shell a login shell

-m, -p,

–preserve-environment do not reset environment variables, and keep

the same shell

-s, --shell SHELL use SHELL instead of the default in passwd+

Running sudo nohup /usr/lib/jvm/java-6-sun-1.6.0.00/jre/bin/java -server -jar /usr/bin/openfire/lib/startup.jar >/usr/bin/openfire/logs/STDOUT.log 2>/usr/bin/openfire/logs/STDERR.log & produces this message:

  • 3853

james@Bedroom:/etc/init.d$ bash: /usr/bin/openfire/logs/STDOUT.log: Permission denied+

but leaves the prompt hanging without returning to the command line, as if a programme is running in the background. Opening http://localhost:9090/ still does not produce any results. Running netstat -an|grep LISTEN and ps -ef|grep java give the same results as before.

I am most mystified by what could be causing all these problems; I have been very grateful for your assistance so far, and should be even more grateful for something that gets the thing working ;:slight_smile:

Hi James,

you should not try to run Openfire as root, something like

su - jive -c “$my_command”

would help a lot.

I think you only need to modify the bin/openfire.sh script to start Openfire without the checks for Java versions etc.

This makes updates also quite easy as you can still use the scripts IgniteRealtime provides and you need just to replace the openfire.sh script.

LG

Thank you for your reply However, I have no user with the name “jive”, “openfire” or “wildfire” (I checked the hidden users; a “su jive” (etc.) command returned the error, “Unknown id”).

Message was edited by: jamespetts

1 / Drop your install.

2 / Create a user “jive” and a group “jive”

3 / Add user “jive” in the group “jive”

4 / Set home directory to “/opt/openfire” for user “jive”

5 / Untar “openfire_3_3_0.tar.gz” and move the extract folder in “/opt” :

$ mv openfire/ /opt

6/ Give correct permission to “/opt/openfire” folder :

$ sudo chown -R jive:jive /opt/openfire

7/ Run openfire with user “jive”:

$ su jive --command " su jive -c “/opt/openfire/bin/openfire start”

8/ Open your browser to “http://127.0.0.1:9090

Enjoy

Farf, thank you very much for your help. I went through all the stages of your process, and have two problems. Firstly, when I run

  • su jive --command " su jive -c “/opt/openfire/bin/openfire start” +

I get the following message:

  • testing JVM in /usr …

/opt/openfire/bin/openfire: 173: cannot create /opt/openfire/.install4j: Is a directory

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 /opt/openfire/.install4j +

Secondly, when I created the user “jive”, I had to create a password for it. How would I set it so that the openfire server starts automatically upon startup, without having to enter the password manually each time?

Addendum: when I run

sudo /usr/lib/jvm/java-6-sun-1.6.0.00/jre/bin/java -server -jar /opt/openfire/lib/startup.jar

I get the following error message:

+java.lang.ClassNotFoundException: org.jivesoftware.openfire.XMPPServer

at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

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

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

Message was edited by: jamespetts

Hi,

you should “cd /opt/openfire/lib” or “cd /opt/openfire/bin” before you try to start it, this usually helps a lot to start it.

LG