Apache Wave (Guest Post)

My good friend @ComputerWesen managed to run Apache Wave. I had to ask him for a guest post because I really loved Wave:

After hours of trial and error I finally managed to get Apache Wave to work. Here is what I did.

What is Apache Wave?

Well, Apache Wave was originally developed by Google and was called Google Wave. After only one year of service Google gave up on it. The Apache Software Foundation started to develop a new software on the basis of Google Wave.

A screenshot of wave

Setup

Dependencies

In order of Apache Wave to work you need at least Java 8 (1.8).

So if you using Debian, just:

1
apt install openjdk-8-jdk-headless openjdk-8-jre-headless

Hint: Apparently in Debian Jessie Java 8 is not available. You might have to get that package from Debian Stretch or something.

Make sure your system actually uses the new version, so:

1
java -version

We have everything we need for now.

Let’s get down to business.

First of all we need to get

The Source Code

I found that the only way I could get all dependencies to work was to get the git version which uses gradle to fetch and build everything.

The URL can be found on the Apache Wave website.

1
git clone https://git-wip-us.apache.org/repos/asf/incubator-wave.git

This project is quite big, so this step can take a while.

After the download finished, we have to

Fix Wrong Character Encoding

I’m sure there might be a nice way to fix this, but because I just wanted to bypass compiler errors I deleted the problematic character (it’s in a comment anyway so I don’t really care).

In the version I worked with (because their last change in the code base is about I year ago, I assume this won’t change in the near future) this problem was located in /wave/src/main/java/org/waveprotocol/wave/client/common/util/SignalKeyLogic.java on line 225 in the method public void computeKeySignalType(Result, String, int, int, String, String, boolean, boolean, boolean, boolean) a couple of lines down in this comment:

1
2
3
4
// WAVE-407 Avoid missing chars with NAVIGATION_KEY_IDENTIFIERS but
// represeting a SHIFT + key char (! " · ...). Navigation events come
// with KEYDOWN, not with KEYPRESS

The interpunct (middle dot) is the problem. Just delete it or replace it with another character.

Building

1
./gradlew jar

This can take a long time. Grab a snickers.

This will download all dependencies via Maven, compile all source files and pack everything (important; remember for later) into a jar file.

Optionally everything can be tested by executing:

1
./gradlew test

Next up is:

Fixing Missing Libraries

because of course not all required libraries have been packed into the executable jar.

1
2
3
4
5
6
pushd wave/build/libs/
unzip wave-0.4.2.jar
cp -r ../api/org/ ./
cp -r ../../../pst/build/classes/main/{org,com} ./
jar -cmvf META-INF/MANIFEST.MF wave-0.4.2.jar META-INF/ cc/ com/ javax/ net/ org/
popd

Basically we unpack the jar archive, add the missing libraries (e.g. jasper), and generate a new jar file.

New we just have to

Create A Working Configuration

Apparently the supplied scripts are not compatible with the sources (and the dir-tree), so we have to make our own.

1
2
3
4
5
6
7
8
9
mkdir run
pushd run
cp ../wave/dist/{run-server.sh,run-export.sh,run-import.sh,process-script-args.sh} ./
sed -i 's/WAVEINABOX_VERSION=.*/WAVEINABOX_VERSION=0.4.2/' run-server.sh
cp -r ../wave/config ./
mkdir bin
cp ../wave/build/libs/wave-0.4.2.jar bin/
cp -r ../wave/war ./
popd

Done.

Run

In order to run the server, go into the new run-directory. And execute run-server.sh.
With default configuration the server will only be accessible on localhost:9898.

The run-directory is portable, so just copy it to your server.

Configuration

The configuration file is /run/config/reference.conf (Using the appropriate server.config does not work in my test-setup. But maybe I’m doing something wrong.).

The reference config file is documented so take a look at it.

Hints

Apparently the default Apache2 http proxy module does not work with websockets. Use a tcp proxy at least for websockets.

Get a solid internet connection if you want to use this thing with more than two users online simultaneously. Don’t underestimate the traffic caused by the software.

Conclusion

Personally I think Google Wave was great and widely under estimated piece of technology. It makes my heart cry that even it’s successor is losing support and most packages I found weren’t working at all. And even here was a surprising amount of “patching” necessary to get it up and running. And unfortunately it’s not even running really well.

Hopefully this rather bodgy guide was any help whatsoever to you.

See you soon,
Florian