java
Dynamically Importing Spring Context Files
We needed to change the underlying storage mechanism (JPA2/JCR/inMemory…) dynamically from configuration and actually the neat and perfect solution for our problem is Spring Profiles from Spring 3.1 as you can see from this excellent post by Chris Beams. But since the beans with Profiles are not there yet and the Spring 3.1 GA release is [...]
Spring MVC/JPA2 Quick Startup Projects
I know there are many Spring MVC/JPA2 tutorials and projects out there, and in the previous years I have forgotten how many new projects I have started projects using Spring MVC and JPA2, so I added two template projects to Google Code, mainly for myself. Spring MVC Quick Startup: This project is a simple template [...]
log4j Custom Appender For Separate Log Files
We needed different log files for a common web project, this gateway project simply loads web services dynamically and generates the wsdd files at runtime, but the problem was huge size of the common log file used by all services. So we needed different log files for different services. Here is the step by step [...]
Eclipse Tip – Converting Java Project to Dynamic Web Project
We started to work on some projects, and after getting the source code, we could not use the web projects in eclipse because they were not defined as Eclipse Dynamic Web projects. Here is a small trick to convert these general projects to Dynamic Web projects.
Migrate Eclipse 3.2 to 3.3.1
I migrated Eclipse 3.2 to 3.3.1, at first I used the same workspace and I had some problems with myln plugins and the server did not start correctly. Then i tried with a new workspace and everything was smooth except at server startup: Timeout waiting for Tomcat v5.5 Server at localhost to start. Server did [...]
SVN Merge Branch into Trunk using Eclipse
I needed to merge the branch changes into trunk of the project, after many changes at both the branch and trunk… First we have to commit all changes, in case of some failure at the merge operation we may revert all changes. Select Team > Merge from menu, select the path of the branch and [...]
Code Analysis – Finding Duplicate Code
I tried Maven plugins for code analysis and finding duplicate/similar code. CPD-PMD’s Copy/Paste Detector can be used for finding duplicate code, which is included in PMD, a Java code analysis tool. run mvn pmd:cpd , The report is displayed at cpd.html file, and the results are very efficient. Simian – Similarity Analyser is also an [...]
Code Analysis using PMD and Checkstyle
We started code review using Crucible, so i searched for some code analysis maven plugins. PMD is a Java code analysis tool and used to find potential problems like unused code, duplicate code, unused variables… PMD is useful and easy: pom.xml:
Format and Color Code Snippets For Blog
I need formatting java code snippets at my blogs so i use an eclipse plugin, simply you can copy html code to editor. java2html Eclipse Plugin I think the most practical way to format html and xml code snippets is using: http://www.manoli.net/csharpformat Thanks to Truong Hong Thi for sharing Edit: I also found a brilliant [...]
maven 2.0.7 filtering
I upgraded maven 2.0.4 to 2.0.7 and the i couldn’t compile the existing projects because of filtering problem – filtering files couldn’t be read, the source of problem was maven-assembly-plugin. I think such kind of incongruities generally may occur. The simplest solution of such problems is simply renaming the maven folder ….m2repositoryorgapache and installing the [...]

