I am looking at demoing openfire as a way of allowing customers to access their web banking profile from atms. The atms have a “web exit,” (they aren’t on the internet) so I would use BOSH to communicate with the atms. The web banking would be accessed with an openfire plugin.
My web app is basically BOSH, so I was thinking that I would add to the openfire/resources/spank webappdir. That approach doen’t work anymore see:
“Created: 2007-05-23 17:01:15 -0500
(8 months ago)
| Author: alex
| Changeset: 8389
Decoupled http-binding service from file system. No longer dependent on the web.xml in the spank directory. JM-1074”
I am unconvinced by the Jira:
“Currently, HTTP Binding depends upon the /spank/resources/ directory in
order to function appropriately because its servlets are defined in the
resident web.xml. If HTTP binding were loaded programatically on the
other hand that directory could not exist and the the http-binding
server would still function normally. The mission is then to decouple
the functionality of HTTP binding from the layout of the file system.”
that this was a good thing. I am thinking that I will import the code and change it back in my repository, unless someone can convince me otherwise?
I am a bit dubious that httpbind works at all in this version. When I post to what I think is the url I get back a 400 status. When I investigate further in the error logs, it looks to me as though the servlets, don’t get initialized at all:
javax.servlet.UnavailableException: org.jivesoftware.wildfire.http.ResourceServlet
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:79)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:233)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:612)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:510)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollec tion.java:156)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
at org.mortbay.jetty.Server.doStart(Server.java:222)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.jivesoftware.openfire.http.HttpBindManager.start(HttpBindManager.java:92)
at org.jivesoftware.openfire.spi.ConnectionManagerImpl.startHTTPBindListeners(Conn ectionManagerImpl.java:505)
at org.jivesoftware.openfire.spi.ConnectionManagerImpl.startListeners(ConnectionMa nagerImpl.java:134)
at org.jivesoftware.openfire.spi.ConnectionManagerImpl.access$000(ConnectionManage rImpl.java:52)
at org.jivesoftware.openfire.spi.ConnectionManagerImpl$1.pluginsMonitored(Connecti onManagerImpl.java:106)
at org.jivesoftware.openfire.container.PluginManager.firePluginsMonitored(PluginMa nager.java:532)
at org.jivesoftware.openfire.container.PluginManager.access$800(PluginManager.java :46)
at org.jivesoftware.openfire.container.PluginManager$PluginMonitor.run(PluginManag er.java:1023)
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)
I still haven’t given up on using openfire to implement my coureurs.ca website. I found that I could get http-bind to work with the help of a fix to a policy-violation problem that I was having.
For testing and to get past the browser security problem, I used rhino. I attached the following javascript to the policy-violationposting. John Resig’s slightly fixed env.js, well as crypt.js from
jsjac and my own javascript code for my HttpClientConnection.js and a
test script BOSH.js that does the Romeo and Juliet scene from the
specifications. I hope that this helps others like the policy-violation fix helped me.
I made Alex’s changeset 8389 check for the existence of the web.xml file. This keeps the stated spirit of the change to remove the dependency on the directory being there, while allowing the resource to be used if it exists.
@@ -265,13 +265,27 @@
if (httpsConnector != null) {
httpBindServer.addConnector(httpsConnector);
}
if(!createWebAppContext())
{
createBoshHandler(contexts, "/http-bind");
createCrossDomainHandler(contexts, "/");
loadStaticDirectory(contexts);
}
createBoshHandler(contexts, "/http-bind");
createCrossDomainHandler(contexts, "/");
loadStaticDirectory(contexts);
httpBindServer.setHandlers(new Handler[]{contexts, new DefaultHandler()
I am pleased that I was able to get this going so that I can use jetty and openfire to run my web-site, which is mostly openfire anyways. The only other thing that I need to do is to enable the openfire embedded jetty to do setuid.