Release Management

Friday, May 9, 2008

QuickBuild and PMD

My team started using PMD as tool for preemptive defect detection and enforcing coding standards. Quickbuild and PMD set up was easy, I just copied four jar files asm-3.1.jar, jaxen-1.1.1.jar, junit-4.4.jar, pmd-4.2.2.jar from pmd-4.2.2\lib folder to ANT 1.7.0 lib folder on QuickBuild server and slightly modified Ant example described in PMD manual. As I wanted I turned on only most obvious rule set 'Java Logging Rules' for our Java projects and deliver to developers as HTML report. The following poor logging practices were detected with PMD almost immediately: using System.out or System.err rather than a dedicated logging facility, printStackTrace() method should not be used, because its output goes to the standard error device System.err rather than the log file managed by log4j and logger variable declaration does not contain the static and final modifiers.

Labels: , , ,

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:

  • 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: , , ,

Tuesday, January 8, 2008

Luntbuild dealing with SMTP response 554

In our environment Luntbuild uses email as feedback mechanism for our continuous integration process. Luntbuild was configured to send an email in the build fails or succeeds including detail of build and release process. No emails were sent today, despite the fact that developers were actively working on the new project. In the Luntbuild's build log file I found the following lines

[Thread-472] INFO - Triggering step "Notify".
[Thread-472] INFO - Checking necessary condition of step "Notify".
[Thread-472] INFO - Condition satisfied, running step "Notify".
[Thread-472] INFO - Send build notification via email to: realias@foobar.com
[Thread-472] INFO - Sending email: Build of "SVN YYY build XXX" is successful
[Thread-472] WARN - Failed to send email
[Thread-472] ERROR - org.apache.tools.ant.BuildException(Problem while sending mime mail:) Cause: javax.mail.MessagingException(Could not connect to SMTP host: SMTP_SERVER_NAME, port: 25, response: 554)
[Thread-472] INFO - Step "Notify" is successful.

Been there done that. Somehow network people again removed the IP address of machine on which Luntbuild is installed from the list that the SMTP server will allow relaying from. Just to confirm my suspicion I logged in to Windows box where Luntbuild (Quickbuild) installed and tried to connect to SMTP server with this command 'telnet SMTP_SERVER_NAME 25' and got response '554 Blocked. Internal Relay Attempt From An Untrusted Host. Connection to host lost'. I have one more help ticket ticket to submit.

Labels: , ,


All posts in one place

  • Doxygen vs JavaDoc
  • Installing JNetDirect's JSQLConnect driver
  • Finding problems in Java code wtih PMD
  • Log4j best practices
  • Can't open activity db: Permission denied error for SVN commits
  • Jira Subversion Plugin
  • Implementing Subversion post-commit hook
  • Troubleshooting Subversion and TortoiseSVN
  • IIS 6.0 does not serve files with .docx
  • Installing ANT on Windows XP
  • Luntbuild dealing with SMTP response 554
  • Confluence and Jira OutOfMemory errors
  •