eclipse ant prompting for build type every time

I had this issue for a while. When ever I tried to launch an ant task by clicking on the target in ant view in eclipse it would prompt me to select a build type and would give me a list of build favorites to choose from. I was able to fix this issue by deleting everything in the favorites and external tool configurations.

Advertisements

Query for showing open cursors in oracle

select sql_text, count(1) from V$OPEN_CURSOR group by sql_text
order by count(1) desc;

eclipse generating old version of class files

When I did a clean build of a project using eclipse 3.5, it was generating an older version of the sources. For example, there was this class where I added a method. During run time I would get NoSuchMethod exception. This is what I tried: I deleted all the class files every where in the project. (there could be some old build directories that eclipse might be picking from). Also launch eclipse using ‘eclipse -clean’ option. This will clear any cached files. Thats it. I’m not sure which step fixed it.

I guess I started having this problem after the OS crashed due overclocking the processor. Another issue I noticed was that eclipse would close by itself. I’ll update this post if the ‘-clean’ option fixed the issue.

Easy bean to string conversion using commons-lang

String bnStr=org.apache.commons.lang.builder.ReflectionToStringBuilder.toString(myBean, ToStringStyle.MULTI_LINE_STYLE );
This will print all the properties of the bean by invoking their toString method. This method won’t go down the bean hierarcy to print each nested property. If you want that feature, you write a ParentBean class and override its toString method and make all other beans extend this one. That way, you should be able to see everything in the bean tree.

Credit goes to this:
http://www.benmccann.com/dev-blog/easy-java-bean-tostring-using-beanutils/