Mylyn and trac 0.11

Eclipse, Java No Comments »

I am using trac now since about half a year for one of my current Java projects. One thing I missed from the start was the Mylyn integration in Eclipse - with bugzilla I was used to handle most of my issue tracking inside Eclipse. If you get used to this kind of “task oriented” working it is hard to do anything without.

Today I found a nice post about how to enable Mylyn to work with trac version 0.11. Basically you have to add the XMLRPC plugin to your trac installation and to configure the XMLRPC connection mode in the Mylyn trac connector.

Eclipse building workspace hangs

Eclipse, Java No Comments »

Today I encountered the problem that every time I started one of my Eclipse workspaces it always started to build the workplace and could not finish it. The progress monitor showed additional tasks waiting but I could not stop them. After killing the Java VM process several times and starting up again I searched for a solution and found this page.

I already heard about the clean command line argument and after adding it to the command line it resolved my problem. I will not add this permanently to my Eclipse links because it takes significantly longer to start up but I did a good job to fix the workspace.

Spring, AspectJ and Maven troubles

Eclipse, Java, Software No Comments »

In one of the applications I am currently working on I am using the following combination:

  • Eclipse IDE with AJDT
  • Spring
  • Maven

This week I upgraded Spring to version 2.5.5 and had some troubles with compiling my aspects in the maven build.I always encountered the following error message when trying to compile my project:

Unable to continue, this version of AspectJ supports classes built with weaver version 3.0 but the class org.springframework.beans.factory.aspectj.AbstractBeanConfigurerAspect is version 5.0

After doing some web search I found this JIRA entry for Spring about the changes in AspectJ dependencies. Then I found out that the aspectj-maven-plugin 1.0-beta-2 had dependencies to to AspectJ 1.5.2a in his pom file. To override this I did as described in this blog post and added the dependencies in my pom to AspectJ 1.6.0 - now I was able to do a build again.

Eclipse Ganymede release

Eclipse, Java, Uncategorized No Comments »

I am using Eclipse Ganymede for about three months now (since RC5 or RC6) and I am really excited about the new version. Here are my favorite improvements:

  1. Performance
    • Java compile on multi-CPU machines – the Eclipse Compiles now takes advantage of multi-threading capabilities of multi-CPU machines. Builds are a lot faster!
  2. UI improvements
    • I am a Firefox user so I am happy that it is now possible to close tabs by clicking on them with the middle mouse button
    • Focus on tooltips on mouse over – this means you do not have to press F2 to focus a tooltip. It allows selecting text inside a tooltip just by moving the mouse into it.
    • Quickfixes are focused on mouse over too. No double clicking on the small warning icon in front of the code line anymore – just moving the mouse over the wavy line below the bad code and click on the hyperlinked quickfix.
    • Debug tooltips show more detailed information – like in the variable view.
    • Values of constants are shown in tooltips too on mouseover
    • Rearranging code elements by drag and drop in the outline
  3. Coding
    • Code completion helps with casts – it reads the type of the instanceof condition and automatically offers more methods

      Afterwards it adds the necessary cast
    • Convert to StringBuffer quick assist – is useful sometimes when refactoring bad usage of String concatenation
  4. Formatting and cleanup
    • Format edited lines only – this setting allows you to format the code you added or changed and leaving the rest of the class untouched
    • The new cleanup settings allow to correct indentation and adding unimplemented methods automatically
    • Undo formatting for a set of Java elements – If you format your whole source or a package it can be undone again
    • Comments are formatted at the same time as code is formatted – happens in one pass and is a lot faster (for big classes)

See the New and Noteworthy for the whole list of new features.

There are a lot of plugins that are released simultaneous in new versions:

  • Web Tools Project version 3.0 – now includes a very nice JavaScript editor that allows to format JavaScript code in the same way as it is possible with Java code
  • Subversive version 1.0 – the official SVN plugin the Eclipse project chose
  • Mylyn 3.0 – no list of changes available until now

Thanks to the Eclipse team for bringing us this exciting new version of such a great tool!

Maven Eclipse plugin with better WTP support

Eclipse, Java, Software No Comments »

Seems like the new version 0.9.4.20080603-0114 of the Maven Eclipse plugin now provides better supports for WTP. In the last versions I had troubles when opening or closing depending Java projects. They were not added as jar files when the utility project was closed and the source project was not added to the maven dependency when opened again.

Check out the New and Noteworthy for more details about the new version.

RIM releases JDE plugin for Eclipse

Blackberry, Eclipse, Java, Mobile, RIM No Comments »

RIMFinally RIM released a a version of its BlackBerry Java development environment as a plugin for Eclipse. It is available under http://www.blackberry.com/go/eclipse as a free download.

My download is already 90% finished and I hope that this will ease development of BlackBerry apps. As an Eclipse fan I was really frustrated about the JDE releases of RIM and I put a lot of effort into getting things to work inside of Eclipse. I will post my experiences in a week or two so check back.

New FindBugs version available

Eclipse, Java No Comments »

java logoThe final version of FindBugs 1.3.2 was released. I add FindBugs to every Eclipse installation because it is a very useful tool for finding possible problems in my code. The new version 1.3.2 includes a new view listing all bugs in a project by priority. See this blog post for more details.

VIM screencasts

.NET, Eclipse, Java, Tools No Comments »

vilogoAaron postet two screencasts on his blog showing how to use VIM. I really love VIM - I thought about installing the viPlugin for my favorite IDE Eclipse some months ago. Now these videos made me think again - I think I will give it a try. Checkout the two casts:

  1. VIM Screencast 1 - basic usage (navigation, modes, …)
  2. VIM Screencast 2 - commands with motion (yank, change, …)

There is even a vi emulator for you Visual Studio users out there - it is called ViEmu.

@Override specification changes in Java 6

Eclipse, Java 1 Comment »

Between Java 5 and Java 6 changes to the specification of @Override have been made. In Java 6 it is possible to add the @Override annotation to methods that implement methods of an interface which is not allowed in Java 5.

I noticed the difference when a friend told me that he had to remove all the @Override annotations to make his Java 6 project compile with Java 5.

The interesting thing is that there is no documentation about this change. The API specification of @Override is exactly the same in both Java versions. I found out that this was forgotten by Sun developers. Peter Ahé, a former developer at Sun, calls it the @Override Snafu.

Spring with AspectJ in Eclipse

Eclipse, Java, Software, Tools 2 Comments »

SpringSome weeks ago I wrote a custom JSP tag for a Spring project I am currently working on. Inside the tag I wanted to use a Spring bean. Soon I realized that this case had to be handled a bit different because the tag is instantiated by the application server and not from the Spring context. Therefore the simple standard injection mechanism did not work.

Using the Spring documentation I found out that I had to use AspectJ for dependency injection in this case. I added the @Configurable annotation to my tag class. I added the required configurations to the XML files:

1
2
<context:spring-configured />
<bean class="net.einwaller.spring.Tag" lazy-init="true" />

To get the required classes in the classpath of my application I had to add the libraries aspectjrt.jar and spring-aspects.jar. The first approach I took for weaving the aspects into my classes was load time weaving. I achieved this by adding the following to the VM arguments of my Tomcat instance:

-noverify -javaagent:pathtojar\aspectjweaver.jar

The noverify option was needed because the version of log4j caused a problem when starting the server without the option. I configured the path to my aspectjweaver.jar as an absolut path.

Having done all these steps I got my application running again but the load time weaving was a bit annoying. I was not able to change the code of my application while the server was running. The Java VM hot code replace did not work anymore. Restarting the server for every change slows down development performance a lot. So I searched for a better solution.

First I installed the AspectJ Eclipse plugin. I wanted to use the AspectJ compiler for compile time weaving of the AnnotationBeanConfigurerAspect. To do so I had to convert the project into an AspectJ project which changes the compiler and adds some project preference pages (RMB -> AspectJ Tools -> Convert to AspectJ Project).

Afterwards I had tried to add the spring-aspects.jar to the Inpath of the AspectJ Build preferences but that did not work. I moved the JAR file out of the WEB-INF/lib folder and tried to add it again - and it worked! Seems like the AspectJ plugin has some problems withe the classpath of the WTP plugin.

Now I got the shiny AspectJ markers at the top of the classes I marked with the @Configurable annotation. The application runs inside the Tomcat after removing the VM arguments for load time weaving and hot code replace works again - perfect!

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in