Friday, April 18, 2008
In order to cultivate good habit of commenting code well I experimented with Doxygen to generate documentation for our J2EE projects. In my opinion Doxygen is a little bit more difficult to learn than Javadoc, but also more robust and flexible. For example, Doxygen goes further than Javadoc: as well as documenting the classes, it also can produce a mixture of diagrams, such as class diagrams, collaboration diagrams, and even dependency graphs using visualization Graphviz tool. Today I tried only the graphical frontend of Doxygen, which is called Doxywizard and found it very useful for learning how to use Doxygen in our environment. I think it should be an uncomplicated task to use Doxygen with Ant. I already noticed an Ant plugin for Doxygen, and will try to use this tool from LuntBuild/QuickBuild environment.
Thursday, April 10, 2008
Installing JNetDirect's JSQLConnect driver
Today I installed JDBC driver for Microsoft SQL Server for our Weblogic farm. To make JSQLConnect 5.70 available to the Weblogic J2EE server I copied JSQLConnect.jar into the /lib directory of our Weblogic installation and set 755 permission to JSQLConnect.jar file. In addition I updated the WebLogic Server's classpath to include the location of the JDBC driver classes by adding ${CLASSPATHSEP}${WL_HOME}/server/lib/sqljdbc.jar to classpath. Last step was the restart of Weblogic 9.2 servers
Labels: JNetDirect, JSQLConnect, weblogic
Thursday, March 27, 2008
Finding problems in Java code with PMD
In order to enforce correct and consistent invocation of log4j logging framework in application code, I decided to take a look at PMD – Java source code analyzer. My initial intention is to run PMD with 'Java Logging ruleset' only during each build executed with QuickBuild (LuntBuild). The build will fail, if violation is found. It may be annoying for our development team, but on the long run I'm certain that the whole team using code analysis tool like PMD will progress faster and finally developers would learn to write better code. Personally I would like to detected log4j problem in advance, but not after the code deployed to any environment. Perhaps in the future we would want to integrate PMD with Eclipse IDE, so developers would see log4j issues directly on the Eclipse IDE and commit only good code to Subversion.
Thursday, March 20, 2008
Logging Best Practices
Recently I helped developers and QA teams to identify the cause of performance issues in one of Weblogic applications and I noticed that current way of using log4j framework for all Weblogic applications is unsystematic and inconsistent:
I proposed the following solution and I have to implement it as soon as possible
- loggers, appenders and layouts set up differently for different applications
- applications do not have properly defined SMTPAppender appender (no notification is sent when error is happening)
- applications continue to write to Weblogic server logs by using System.out.print or printStackTrace() instead of using logger call.
I proposed the following solution and I have to implement it as soon as possible
- Create common log4j template
- define proper logger, appenders, layouts
- applications should define their own log file outside server logs
- application should broadcast error messages via email
- Configure QuickBuild to use new log4j template
- Update log4j template for all WebLogic applications
- Enforce correct and consistent invocation of logging framework in application code by integrating static code analysis tools in SDLC ( for example JTest, PMD, FindBugs)
- Include verification for proper application logging and error notifications to test plans
- Acquire log reader tools (for example Chainsaw, LogMX, SuperTracer)
Labels: log4j, Luntbuild, QuickBuild, weblogic
Monday, March 3, 2008
Can't open activity db: Permission denied error for SVN commits
On my way to work this morning I got an emergency call from developer who unsuccessfully tried to commit latest java code changes to Subversion repository using TortoiseSVN. The developers was getting "Can't open activity db: Permission denied" error in TortoiseSVN client when he tried to commit or create a new tag in SVN.
The Apache error log had this lines related to SVN commit problem
Could not create activity /!svn/act/9dac40a3-4acf-3456-b328-a2598c258d06
Could not open dbm files
Can't open activity db: Permission denied
Just in case I have run svnadmin verify on Subversion repository, but as expected there was no problem at all. Then I noticed that the files on the dav folder of the SVN repository are not writable by Apache server. I changed files permission and successfully committed files with TortoiseSVN again.
The configuration used in this solution
• SVN 1.4.6
• Apache 2.0.49
• Tortoise 1.4.7
Unfortunately no references related to SVN commit problem were found in Subversion FAQ or TortoiseSVN FAQ
Update: I set permissions for "activites.pag" and "activities.dir" files in dav folder to 777
The Apache error log had this lines related to SVN commit problem
Could not create activity /!svn/act/9dac40a3-4acf-3456-b328-a2598c258d06
Could not open dbm files
Can't open activity db: Permission denied
Just in case I have run svnadmin verify on Subversion repository, but as expected there was no problem at all. Then I noticed that the files on the dav folder of the SVN repository are not writable by Apache server. I changed files permission and successfully committed files with TortoiseSVN again.
The configuration used in this solution
• SVN 1.4.6
• Apache 2.0.49
• Tortoise 1.4.7
Unfortunately no references related to SVN commit problem were found in Subversion FAQ or TortoiseSVN FAQ
Update: I set permissions for "activites.pag" and "activities.dir" files in dav folder to 777
Labels: SVN, TortoiseSVN
Friday, February 22, 2008
OpenDNS
I use Comcast as my home ISP for at least eight years. They offer fast bandwidth, but Comcast's DNS services are poor and slow. Last month I was getting tired of waiting for web site request in Firefox browser to resolve. I started to look for alternatives like AT&T DSL, but accidentally noticed OpenDNS free DNS resolution service. It took a few minutes to go through OpenDSN instructions and replace existing Comcast DNS servers with two recursive nameserver addresses 208.67.222.222 and 208.67.220.220 from OpenDNS on my Linksys WRT54GS router. I have been using OpenDNS for almost a week now and I can inform you that there are real speed improvements.
Thursday, February 14, 2008
JIRA Subversion Plugin
I got the Jira/Subversion plugin up and running. This plugin checks the Subversion repository once an hour and if any commits have been made to the repository AND the developer has referenced a Jira issue, it will show up in Jira. "Subversion commits" tab is visible on Jira next to Comments and Change History. In addition to the installation steps for Jira Subversion plugin described on Atlassian web site, I added View Version Control permission for Jira users. Remaining step is to enforce developers to use reference to issues during code commit.
Labels: JIRA, Subversion, SVN
