Openfire plugin

I’m trying to develop an Openfire plugin using 3.3.2. I basically got the plugin to work with hard-coded values. I want to add some pages to the admin console for basic configuration, control, and monitoring of the plugin. I’ve run into this problem though.

I’ve added a couple of very simple jsp pages and I inconsistently get an “Access is Denied” error in the logs. The plugin does not deploy.

2007.10.24 16:26:01 org.jivesoftware.openfire.container.PluginManager$PluginMonitor.unzipPlugin(Plu ginManager.java:976)

java.io.FileNotFoundException: E:\Program Files\Openfire\plugins\xjGateway.jar (Access is denied)

at java.util.zip.ZipFile.open(Native Method)

at java.util.zip.ZipFile.<init>(Unknown Source)

at java.util.jar.JarFile.<init>(Unknown Source)

at java.util.jar.JarFile.<init>(Unknown Source)

at org.jivesoftware.openfire.container.PluginManager$PluginMonitor.unzipPlugin(Plu ginManager.java:939)

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

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)

at java.util.concurrent.FutureTask.runAndReset(Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101 (Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodi c(Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknow n Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

The admin console part of the plugin.xml

<adminconsole>

<tab id=“tab-xjgateway” name=“XJ Gateway” url=“Admin.jsp” description=“XJ Gateway Administration”>

<sidebar id=“sidebar-xjgateway-administration” name=“XJ Gateway Administration”>

<item id=“item-xjgateway-configuration” name=“Configuration”

url=“Configuration.jsp”

description=“Configure XJGateway.”/>

<item id=“item-xjgateway-control” name=“Control”

url=“Control.jsp”

description=“Control XJGateway.”/>

<item id=“item-xjgateway-monitor” name=“Monitor”

url=“Monitor.jsp”

description=“Monitor XJGateway.”/>

</sidebar>

</tab>

</adminconsole>

And one of the jsp pages wittled down to almost nothing:

<%@ page

errorPage=“Error.jsp”

%>

<%@ page contentType=“text/html;charset=UTF-8” %>

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>

<html>

<head>

<title>XJ Gateway Monitoring</title>

<meta name=“pageID” content=“item-xjgateway-monitor”/>

</head>

<body>

<center><h2>XJ Gateway Monitoring.</h2></center>

</body>

</html>

I’m using the openfire maven plugin to generate the jar. The jar puts

in the jsp files, the generated java files, and the compiled jsp class

files. I’ve since discovered that, if I remove the .jsp files from the jar but leave in the generated classes,

the pages show up in the admin console as designed with the intended

layout and behavior, etc.

Is Openfire trying to recompile the jsp files for some reason? This could

explain the file access problem. Sometimes it deployed without me doing

this, though. Or should the Maven plugin not be providing the generated class file. Or is that all just a red herring? Any ideas on what is going on here or what I’m not doing right would be appreciated. I poked around on site and didn’t find anything that looked relevant on the access problem or adminconsole configuration.

Thx,

Mike

Hi Mike,

I haven’t used maven to build a plugin before but Openfire does require that all JSPs be pre-compiled and packaged as part of jar within the plugin.jar. Is there a reason you’re not using the Openfire’s plugin ant target?

Cheers,

Ryan

Our project uses maven. I’ve discovered that if I use the warSourceExcludes option and exclude the jsp pages, then Openfire (or Jetty) doesn’t try to compile the jsps and the plugin works without manual modification.