Raptor plugin ExceptionInInitializerError

Folks,

When loading the plugin into Openfire, I see the plugin listed under “Plugins” tab, but otherwise no added functionality. Is there someplace special that Raptor’s functions should show up. Also I see the following backtrace when attempting to restart/load it. I am trying to load the latest from http://www.igniterealtime.org/community/docs/DOC-1644, v Raptor 0.2-544.**** Any ideas?

Thanks

2010.01.29 17:03:50 [org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.jav a:507)] Error loading plugin: /usr/local/share/java/openfire/plugins/raptor

java.lang.ExceptionInInitializerError
at org.jivesoftware.openfire.plugin.raptor.Raptor.initializePlugin(Raptor.java:73)
at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java :448)
at org.jivesoftware.openfire.container.PluginManager.access$300(PluginManager.java :47)
at org.jivesoftware.openfire.container.PluginManager$PluginMonitor.run(PluginManag er.java:1032)
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)
Caused by: java.lang.NullPointerException
at org.jivesoftware.openfire.plugin.raptor.util.RaptorUtil.getAppDir(RaptorUtil.ja va:115)
at org.jivesoftware.openfire.plugin.raptor.util.RaptorUtil.(RaptorUtil.jav a:53)
… 13 more

Which version of Openfire are you using? Openfire 3.5.2 or newer is required.

That’s the method causing trouble by throwing an NullPointerException in line 115:

private static String getAppDir() {
    File binDir;
    if (System.getProperty("appdir") != null) {
        binDir = new File(System.getProperty("appdir"));
    }
    else {
        binDir = new File("").getAbsoluteFile();
    }
    return binDir.getParent().toString();   // <-- line 115
}

The system property “appdir” is normally set to “/opt/openfire/bin”, when Openfire is installed in “/opt/openfire”. In that case this method should return “/opt/openfire”.

So, where do you have installed Openfire? And to what path is “appdir” set?

From the Server->Server Manager->System Properties, adding ‘appdir’=/my/opf/home works, thanks. Curious, why not just used property openfireHome? This is a java_options define (-DopenfireHome) for the service start.

Probably because it was first in the list and the description doesn’t point out the difference

For me “appdir” was set by default.

Well, to save someone else the trouble, the solution for this on ubuntu (and probably debian as well) is to edit /etc/default/openfire and include:

DAEMON_OPTS="-Dappdir=/usr/share/openfire"

Just my two cents.

1 Like

I’ve applied the following change on a FreeBSD system, but I still receive the NullPointerException:

appdir="/usr/local/share/java/openfire"

Is there someplace else I can look?

Thank you in advance.