Log to Firefox console

You can log to the Firefox console by using the method "dump" in javascript. To enable this feature in Firefox type in about:config in the address bar and create there a new boolean entry with the name "browser.dom.window.dump.enabled" and the value "true".

Now start Firefox from the command line by entering "firefox -console". All messages passed to dump() will be printed on the command line.

To automatically add a timestamp to your messages and avoid error messages in other browsers I've created this little function:

function log(message) {
if(window.dump) {
var date = new Date();
var hours = date.getHours();
if(hours < 10) hours = "0" + hours;
var minutes = date.getMinutes();
if(minutes < 10) minutes = "0" + minutes;
var seconds = date.getSeconds();
if(seconds < 10) seconds = "0" + seconds;
dump(hours + ":" + minutes + ":" + seconds + " - someapp: " + message + "\n");
}
}

Custom database pool

If you (like me) can't download the driver thought the console of Geronimo because you're behind a proxy then use the following steps to deploy your own database driver into Geronimo:

  1. Download the JDBC driver from your vendor (e.g. the MySQL JDBC Driver).
  2. Create a new folder inside the Geronimo repository folder named after the database vedor (e.g. mysql).
  3. Create another folder with a description of the driver as name (e.g. mysql-connector-java).
  4. Create a third folder with the version number as name (e.g. 3.1.12).
  5. Now put the jar into the last created folder and name him after this structure: $description-$version.jar (e.g. mysql-connector-java-3.1.12.jar). Keep in mind that the description and the version number of the file name must match it's parent folders.
After this five steps your repository should look as followed:



As the driver is now available inside Geronimo start the server and browse to the console (http://localhost:8080/console/). Enter your user name and password (defaults are system/manager) and select the link "Services / Database Pools" from the console navigation.



Create now a new database pool by using the database pool wizard. Enter a name for your pool and select your database type (e.g. MySQL) and click "Next". The new database driver you just added should be available as "Driver JAR". Select it, provide the other required settings like authentication information and server name and click again on "Next". To finish the wizard click "Skip Test and Deploy".

Welcome to J2EE on Geronimo

I'd like to share some thoughts and experiences about developing J2EE applications for Apache Geronimo.

Copyright © 2008 - J2EE on Geronimo - is proudly powered by Blogger
Smashing Magazine - Design Disease - Blog and Web - Dilectio Blogger Template