HomePage | RecentChanges | Preferences

The 'strutsbot' that (occasionally, when I'm online and remember to start it,) inhabits the #struts channel on is an instance of fn-javabot.

It responds to all messages. In addition, you can address it with a message beginning with '|' (a piping symbol) or its name.

For sample commands, see the javabot [SYSTEM_TEST] file. Remember to replace ~ with | if you're talking to the strutsbot.

It does not do Javadoc-- ask javabot instead.


Local Setup

Start hsqldb:

cd $files/strutsbot-db
java -cp c:\java\hsqldb\lib\hsqldb.jar org.hsqldb.Server -database.0 file:c:\path\to\strutsbot-db -dbname.0 strutsbot

Create tables. This is a modified version of the provided javabot.sql file, using IDENTITY instead of a SEQUENCE.

CREATE TABLE factoids(
	name VARCHAR(255) NOT NULL,
	value VARCHAR(2000) NOT NULL,
	username VARCHAR(100) NOT NULL,
	updated TIMESTAMP

	message VARCHAR(4000) NOT NULL,
	changeDate TIMESTAMP

Modify ~/sqltool.rc to provide connection information for urlid=strutsbot.

      > java -jar c:\java\hsqldb\lib\hsqldb.jar strutsbot javabot.sql

Read the README (see patch below) and modify config.xml,,

Compile and start the bot:

$ cd $svn/strutsbot
$ ant
$ ant run
The following error at startup doesn't seem to cause a problem. I think it happens when there is no existing instance to kill off.
     [java] Exception in thread "main" Connection ref
used: connect

Stop hsqldb:

      >java -jar c:\java\hsqldb\lib\hsqldb.jar strutsbot
      sql> SHUTDOWN;
      sql> \q


To make it respond to all messages, in addition to responding to its name and '|', put the blank message tag at the bottom of the list in config.xml:

	<message tag="|"/>
	<message tag="strutsbot: "/>
	<message tag="strutsbot, "/>
	<message tag="strutsbot "/>
        <message tag="" />

Patch for fn-javabot README

--- README	(revision 154)
+++ README	(working copy)
@@ -4,8 +4,15 @@
 Edit config.xml, following the instructions in the comments (everything between <!-- and --> in that file).
-Run ant from the root (e.g., cd /home/me/javabot; ant), then run ./
+Edit, then copy it to (Yes, you need both.  Don't ask me why.)
-You might need to make executable before this will work (chmod +x
+Set up the database tables using the script found in javabot/etc/javabot.sql.  
+You may need to modify the script to suit your database.
+If you are not using PostgreSQL, add the jar containing your JDBC driver to javabot/lib.
+To compile, execute 'ant' from the project root (e.g., cd /home/me/javabot; ant)
+To start the bot, execute 'ant run' from the project root.
 Good luck, and drop us a line at and with any feedback/patches.


HomePage | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited August 26, 2006 12:09 pm by WendySmoak (diff)