Monday, April 23, 2007

No Line Number in Exception Stack Traces?

use "-g" java compiler parameter

Friday, April 20, 2007

Installation of Resin 3.1.0 - steps

the order of the steps as mentioned in the Resin Documentation is very very important. The logging system of the httpd process is all but helpful and you won't be able to figure out what went wrong.
For the sake of brevity -
-- if you have any previous version of resin installed as a NT service, you should remove that NT service by running "httpd -remove"
1. install JDK that you want to use. it is advisable to remove the versions that you don't want to use any more.
2. download and unzip resin to root folder (i.e. c:\resin-3.1.0) . Do not try installing it on the desktop as the httpd daemon has a hard time with long folder names
3. make sure that jdk-xxx\bin folder is in the environment PATH variable
4. make sure that the jdk-xxx\lib\tools.jar is in the CLASSPATH
5. setup JAVA_HOME
6. setup RESIN_HOME
7. (you should not have even opened the MSDOS prompt window yet. This is because the addition of environment variable do not take effect in already open DOS prompts
8. now open a new MSDOS prompt
9. go to the resin folder and run "httpd" to start resin
10. or, run "httpd -install" to install it as a NT service

Thursday, April 19, 2007

Resin 3.0.14 to 3.1.0 upgrade

Its been about 2 years since my company has been using Resin without upgrading it. So I finally decided to make the move this week. To my despair, I came across zillions of errors that had to be fixed one by one.
Major culprits for causing all the *big deal* -

1. change in taglib declaration for JSTL core. It has beenc hanged to 'http://java.sun.com/jsp/jstl/core' from 'http://java.sun.com/jstl/core'

2. changes in resin.conf structure

3. JspPrecompileListerner listener class stopped working from 3.0.23 to 3.1.0. Kept throwing a NullPointerException for JspPrecompiler package

4. our Graphing packages required some re-thinking in the way they work

5. calls to retrieve values of variables in the environment context
are no longer allowed to make null calls. The variable should ALWAYS be defined in the environment before you make the call to retrieve its value. Earlier you just got a null value.

Saturday, April 14, 2007

Enable IIS localhost for Firefox

When your IIS authentication settings are not set to basic, browsers other than IE can actually stop you from accessing the running localhost on IIS.
Here's a simple workaound to this problem -
1. In Firefox type about:config in the addressbar
2. Find the preference named network.automatic-ntlm-auth.trusted-uris
3. Enter the value 'localhost' for this preference
4. Now try again

voilla!

Thursday, April 12, 2007

building custom graphs

keywords: graph, chart, java, quality, custom

Felt the need to build custom graphs from your application?
Here's one way to do it. A very light weight JAR file that spits out nice PNGs. Many highly customizable charting options are available.

--> Easy Charts <--

Wednesday, April 4, 2007

How to get list of tables in a database

MySQL
SHOW TABLES [FROM db_name] [LIKE 'pattern']

Oracle
SELECT table_name FROM user_tables;

MS SQL
sp_help

PostgreSQL
select tablename from pg_tables

Firebird
show table (when using isql)