powered by Jive Software

Need help compiling openfire/webchat!

I need to make some revisions to webchat, so I’m trying to compile webchat with ant, and I can’t seem to find some of the dependencies (mainly Jetty, and other eclipse libraries). Here’s what I’ve got:

Ubuntu VM running version 12.04

Java version 1.6.0_24

Ant version 1.8.2

webchat source from https://svn.igniterealtime.org/svn/repos/fastpath/webchat

openfire source from https://svn.igniterealtime.org/svn/repos/openfire

webchat’s build.xml modified to allow ant 1.8 per this thread: http://community.igniterealtime.org/message/204367

also modified line 43 to point to my openfire directory:

patched all references in openfire code from “org.mortbay.jetty” to “org.eclipse.jetty” (ex: lines 27-38 of AdminConsolePlugin.java)

What I need now, is to know where I get Jetty from? I’ve tried downloading the source, which almost works, but then it wants more and more dependencies of that source (and how do I know I’m finding the right versions?). I’ve also noticed that the build/lib/merge directory has a lot of jetty-XXX.jar files, which it seems to me would be the easiest to use, but either I can’t use them to compile, or Ant isn’t including them? I guess I don’t know enough about the compiling process, and what exactly Ant is doing? I’ve read through the build.xml, and I have a primitive idea of what’s going on. I’ve even tried some statements here and there, but they don’t seem to work…

I don’t know too much about Java, and it’s been a while since I’ve used it, but it seems like there should be an easier way to compile this than scouring the internet for a seemingly endless stack of depenencies.

What I’m really looking for is some direction from the developers/comunity. Where should these dependencies be found, and is there something wrong with my environment that’s making this not work?

I should add that I’ve successfully compiled Spark, Spark’s fastpath plugin, and some other plugins for Spark. It’s just Openfire that’s giving me all this trouble.

Thanks in advance! What a great project!

I figured it out! I just had to update WebClientPlugin.java to Jetty 7. Changes are:

Lines 24-26:

import org.eclipse.jetty.servlet.ServletContextHandler;

import org.eclipse.jetty.server.handler.ContextHandlerCollection;

import org.eclipse.jetty.webapp.WebAppContext;

Line 42:

private ServletContextHandler context;

Tested and compiles with openfire 3_7_0 and the Head SVN revision (13077).

Hi, Could you kindly prepare a patch of your changes for inclusion into the source code trunk?

daryl

Just checked back to this thread. Here’s the patch. (Can’t commit so here’s the text of the file)

Index: WebClientPlugin.java

===================================================================

— WebClientPlugin.java (revision 13102)

+++ WebClientPlugin.java (working copy)

@@ -21,9 +21,9 @@

import org.jivesoftware.openfire.container.Plugin;

import org.jivesoftware.openfire.container.PluginManager;

import org.jivesoftware.openfire.XMPPServer;

-import org.mortbay.jetty.servlet.Context;

-import org.mortbay.jetty.handler.ContextHandlerCollection;

-import org.mortbay.jetty.webapp.WebAppContext;

+import org.eclipse.jetty.servlet.ServletContextHandler;

+import org.eclipse.jetty.server.handler.ContextHandlerCollection;

+import org.eclipse.jetty.webapp.WebAppContext;

import java.io.File;

import java.util.HashMap;

@@ -39,7 +39,7 @@

*/

public class WebClientPlugin implements Plugin {

  • private Context context;
  • private ServletContextHandler context;

public void initializePlugin(PluginManager pluginManager, File pluginDirectory) {

// Specify it’s a demo.
WebClientPlugin.java.patch.zip (549 Bytes)

You can attach patches here as files via Advanced editor

I followed Jeff’s instruction for both openfire and webchat but only webchat failed to build. The errors are about ant couldn’t find those 3 lines in WebClientPlugin.java file. Did I do anything wrong? Are there additional tasks to do before running ant to build webchat.war?

I’m assuming by “those 3 lines” you mean the other imports referring to Openfire? I had to modify my build.xml to point to my openfire source directory.

Here is what my filesystem looks like:

C:\Dev\openfire

  • build

  • documentation

  • src

c:\Dev\webchat

  • build

  • src

So, in order for ant to find openfire from webchat\build, I needed to modify line 43 to say

Hope that helps!

I just tried again with build.xml modification but still failed with the same errors, I think. Pls see the attach. When compiled, just run “ant” command, right? If you don’t mind, maybe you can send me that compiled version of webchat.war. I wanna test web authentication of fastpath webchat. Thank you in advance.
error.txt.zip (1354 Bytes)

Looks like you missed a step of the patch (did you manually make the changes?). Line 24 of webclientplugin.java needs to be

import org.eclipse.jetty.servlet.ServletContextHandler;

not

import org.eclipse.jetty.servlet.Context; (They refactored Context a lot, resulting in a name change).

Line 25 needs to be

import org.eclipse.jetty.server.handler.ContextHandlerCollection;

not

import org.eclipse.jetty.handler.ContextHandlerCollection;

That should fix your issue!

Jeff

OF-561

I updated the patch manually by just replacing mortbay with eclipse. That’s why it failed. You are exactly right about those 3 lines modification mistakes. Once done, I can compile webchat properly and install in openfire and both works fine. Thank you for your prompt response.