Openfire Plugin Exception

Hi,

We want so setup a development environment with openfire and the restAPI plugin.

we followed this setup manual as to how to setup the environment and it worked perfectly.

Openfire Plugins Setup Guide For Eclipse

We moved on to working on the plugin and followed the restAPI tutorial plugin (“Setup Launch Configuration To Build An Existing Plugin”).

However upon running the plugin we started getting some errors.

we first got a null pointer exception here:

(line 51 of the class JerseyWrapper — > JerseyWrapper.class.getPackage().getName())

we read online that some classloaders might fail using this on the initiation phase, so we just replaced it with the text it should have returned.

Upon doing that we reached a new exception (listed below).

All our instinct are saying that this is probably something in our setup that is wrong, however we can’t seem to find it, any chance you have a lead for us?

2015.11.16 11:01:30 org.jivesoftware.openfire.container.PluginServlet - Cannot cast com.sun.jersey.server.impl.container.WebApplicationProviderImpl to com.sun.jersey.spi.container.WebApplicationProvider

java.lang.ClassCastException: Cannot cast com.sun.jersey.server.impl.container.WebApplicationProviderImpl to com.sun.jersey.spi.container.WebApplicationProvider

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

at com.sun.jersey.spi.service.ServiceFinder$LazyObjectIterator.hasNext(ServiceFind er.java:833)

at com.sun.jersey.spi.container.WebApplicationFactory.createWebApplication(WebAppl icationFactory.java:64)

at com.sun.jersey.spi.container.servlet.ServletContainer.create(ServletContainer.j ava:394)

at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.crea te(ServletContainer.java:309)

at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:603)

at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:207)

at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.jav a:376)

at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.jav a:559)

at javax.servlet.GenericServlet.init(GenericServlet.java:244)

at org.jivesoftware.openfire.plugin.rest.service.JerseyWrapper.init(JerseyWrapper. java:154)

at org.jivesoftware.openfire.container.PluginServlet.registerServlets(PluginServle t.java:179)

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

at org.jivesoftware.openfire.container.PluginManager.access$1(PluginManager.java:2 78)

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

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

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

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

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

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

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

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