debugging wildfire in idea

Fri, Jun 23, 2006

First, go get the source

Decompress it to get your wildfire directory, which we’ll call WILDFIRE_HOME

If you’re going to use LDAP with Wildfire, it’ll be a good idea to follow the instructions on this page:

Solve LDAP alias problems

otherwise you may get errors such as:

Search for userDN based on username ‘xxx’ found multiple responses, throwing exception

Note that the WILDFIRE_HOME/bin/wildfire.vmoptions doesn’t work when running in debug mode as there’s no wildfire script. So to enable the above patch, you have to add it explicitly to the VM options as -Djava.naming.ldap.derefAliases=never

Build wildfire:cd WILDFIRE_HOME/build ant

This will build everything into WILDFIRE_HOME/target

Now you need to create the database and it’s tables. If you just create the database, Wildfire will complain about the database schema not being installed. It’s one of those apps where you have to set up the database yourself:

mysql -u root -p mysql create database wildfire; grant all privileges on wildfire.* to USER@“localhost” identified by ‘PASSWORD’; flush tables; flush privileges; exit mysql -u USER -p wildfire < WILDFIRE_HOME/target/resources/database/wildfire_mysql.sql

In IDEA, create a new Application debug profile with the following parameters, assuming WILDFIRE_HOME=/Users/Alistair/dev/wildfire Main class: com.install4j.runtime.Launcher

VM parameters: -server -DwildfireHome=“.” -Dinstall4j.appDir=“.” -Dexe4j.moduleName=“./bin/wildfire” -Dwildfire.lib.dir=“./lib” -Dinstall4j.jvmDir=“/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home” -Djava.naming.ldap.derefAliases=never

Program parameters: start org.jivesoftware.wildfire.starter.ServerStarter false false “./logs/stderror.log” “./logs/stdoutt.log” true true false “” true true 0 0 “” 20 20 “Arial” “0,0,0” 8 500 “version 2.6.2” 20 40 “Arial” “0,0,0” 8 500 -1 -DwildfireHome=. -Dwildfire.lib.dir=./lib

Working directory (IDEA should fill this in for you): /Users/alistair/dev/wildfire/target

The next step is to add all the JARs to IDEA: WILDFIRE_HOME/build/lib WILDFIRE_HOME/build/lib/dist WILDFIRE_HOME/build/lib/merge WILDFIRE_HOME/src/plugins/userImportExport/lib

Then tell IDEA to build everything to this directory: WILDFIRE_HOME/classes

To stop wildfire generating this error:

Failed to load admin-sidebar.xml file from Wildfire classes - admin console will not work correctly

copy WILDFIRE_HOME/target/lib/wildfire.jar to WILDFIRE_HOME/classes

jar xvf WILDFIRE_HOME/classes/wildfire.jar

This will put all the XML files into IDEA’s CLASSPATH

comments powered by Disqus