IntelliJ PEBKAC

Posted on November 16th, 2008 by geardaddie under Java.

I’ve been trying out IntelliJ IDEA on my latest project and I ran into an issue that made IDEA unusable for me.

I’ve been bouncing between Eclipse and IntelliJ on my last two projects. I’ve been using Eclipse because that’s the “blessed” IDE by my client and used by my team. I’ve been using IntelliJ (or should I call it IDEA? I’m never quite sure…) because its the IDE I should like.

Right now, I think I’m in a unique position as I’m passionate about neither IDE and can hopefully form an objective opinion about them. I’ll post my thoughts as time permits.

But, first… my PBKAC issue (yes… that’s Problem Exists Between Keyboard And Chair ;-) ). My current project is using Maven as a build tool (which is working great for us so far). Although we’re only building a Web Application, since we’re using Websphere and it prefers to deploy EAR files over simple WAR files, I went ahead and setup our Maven project to have several subprojects (one for the WAR and one for the EAR) all under a master project. That said, for our day to day development we’ve been using Tomcat and as such, only interested in WAR deployments most of the time.

This is all working great with Eclipse (using the excellent MyEclipseIDE plugins) - hot deployment works very well. I have two projects setup in Eclipse for the WAR and the EAR packaging, but 99% of the time I ignore the EAR project.

When I imported the project into IntelliJ I used its Maven project import capability and it worked flawless. I thought I was all set. I did a build and configured my project to follow this guide (which is poorly documented in IntelliJ itself).

I fired up Tomcat in debug mode and started trying to work on a JSP and controller code. But, IntelliJ just ground to a halt everytime I toggled between the browser and it. I could see that it was copying tons of files around (JARs in particular) when I made a simple change and it took 10 ~ 15 seconds for simple JSP changes to show, even longer for code changes. To make matters worse, IDEA would lock up and not paint itself when I toggled back from the browser for tens of seconds. It just wasn’t acceptable - especially given how smooth it worked in Eclipse. I couldn’t figure it out… I mean if everybody loves this IDEA it should certainly be able to do hot deploy better than this.

I talked with my colleagues who use IntelliJ and they were perplexed as well.

Despite rechecking my settings several times, Googling and even downgrading to IDEA 7.0.4 (from the shinny new 8.0.0 release) I couldn’t get it to work. I was about to give up on IntelliJ and settle on Eclipse when I stumbled on the problem.

As I said earlier, I have two projects in Maven (modules in IntelliJ) for the WAR and EAR (the latter used only for Websphere) and I pretty much ignore the EAR project when doing interactive development. It turns out that although I was ignoring it, IntelliJ wasn’t!

By default, when IntelliJ imports a Maven project with EAR packaging it will build an EAR file. In my project, the EAR file contains everything. Everytime I made a change, IntelliJ was dutifully rebuilding that EAR file (a very expensive operation). That was making IDEA run so slow.

Most of this is truly a PEBKAC issue - I should’ve looked at the EAR module settings. Part of it is getting used to the nature if IDEA projects and modules. I was thinking of modules as being the equivalent of Eclipse projects, but… that’s not quite true. When you tell IntelliJ to build the project, it builds all the modules - duh! Part of the problem is the “model” IntelliJ uses in that I’m telling it to deploy, run, debug, hot swap, etc my Web Module so my focus is only on the Web Module. why should the EAR module be involved? And lastly… part of it is just that Java Web Development can be rather involved with a lot of (too many!!) moving parts.

Comments (0)

CarbonFive

Posted on November 11th, 2008 by geardaddie under Development, Java.

I’ve been reading up on Rails 2.1 recently (renewing my on-again-off-again efforts to learn Ruby and Rails) and came away impressed (again) with their “migrations” framework. Its a really slick way to automate changing/evolving your database throughout the development cycle.

I started googling around for a Java based implementation and stumbled upon this blog today by some guys who call themselves CarbonFive.

Not only do they have a slick migrations utility for Java, but they also have an annotation-based database testing framework built on top of DBUnit and Spring.

I haven’t tried either of these out yet, but they look very promising. I’ll post a follow-up if I get the chance to try them out.

Comments (0)

IntelliJ IDEA 8 is out!

Posted on November 8th, 2008 by geardaddie under Uncategorized.

In case you missed it, IntelliJ IDEA 8 was released yesterday.

I’ve been planning a big write-up on my experiences with IntelliJ versus Eclipse, but I haven’t had the time yet. It may end up as a bunch of little posts… we’ll see. I’ll cut to the chase though: So far I haven’t seen IDEA as significantly better than Eclipse. Somethings definitely are, but others aren’t. I’m not sure, but at this point it feels like a Coke versus Pepsi argument. I’ll give IDEA 8 a good try and see if it changes my opinion.

One of the nice things about IDEA 8 for us Mac folks is that the editor tabs finally work with the OS X look-and-feel. Though… they’re not OS X looking unfortunately, at least the rest of the app can mostly look like a Cocoa app.

Two other things of note

  • JetBrains also released a Ruby IDE called RubyMine. It looks fairly interesting, but I’m not sure it will replace TextMate for Ruby/Rails development for me.
  • Eclipse 3.5M3 has been released and it includes support for SWT under Cocoa making it a real Mac app (only 32-bit unfortunately, but… its a start!)

Comments (1)

WordPress Upgrade

Posted on November 7th, 2008 by geardaddie under Misc.

As I alluded to in my previous post, I had some issues upgrading WordPress.

I started by using an automatic upgrade plugin. I followed the steps exactly as outlined, but ran into problems. After I was done and supposed to be greeted by the “upgrade your database” page. Instead I got caught in a loop where I could log in, but it would return me to the login screen instead of taking me to the admin screen.

This was really frustrating and despite all the posts I found via Google, none of them worked. So… I gave up on my 1/2-hour-turned-into-3-hour project and called it a night.

Today I thought I’d give it one more try, otherwise I was going to have rebuild my blog from scratch (supposedly there was a backup created by the plugin, but… I think I accidentally deleted it - genius… I know :-/ )

Fortunately I found one other post that recommended renaming the WordPress plugin directory. Sure enough… that did the trick. Now TextMate works perfectly and I’ve got a bright and shiny new theme (which makes me think about racing down the open road in a 911 Turbo :-)).

Comments (0)

I’m back!

Posted on November 7th, 2008 by geardaddie under Misc.

Whew… I finally got Wordpress back. I’m hopeful that this will help fix the issues I’ve been having with TextMate posts. Now… I’ve got a bunch of plugins to install.. :-D

Oh… and special thanks to this person. That post is what finally got me past the WordPress login snafu.

Comments (0)

Upgrading WordPress - Cross your fingers..

Posted on November 2nd, 2008 by geardaddie under Misc.

This blog is currently served by a rather rusty version of WordPress (2.0.5). I don\’t know much about maintaining WordPress. It came pre-installed by the kind folks at Bluehost.com and I really haven\’t had to fiddle with it much at all. That said, I think its time to upgrade to the current version (2.6.1) Hopefully it\’ll take care of some of the issues I\’ve been having with Textmate posts and allow me access to more plugins and themes. Well… if you don\’t see this blog again… you\’ll know what happened. ;-)\n\nHere goes nothin\’….

Comments (0)

Didn\’t work

Posted on October 27th, 2008 by geardaddie under Uncategorized.

I\’m leaving my last post (and this one) the way TextMate is publishing it (or perhaps its Wordpress… but I didn\’t change anything there) so you can see how my posts are getting messed up. :-(

Comments (0)

TextMate Woes

Posted on October 27th, 2008 by geardaddie under Uncategorized.

I\’m back… well… sort of. I\’ve been having trouble with the posts I\’ve been making by TextMate. I like it so much for blogging that the annoyance of it messing up my posts has eroded any energy I\’ve had for blogging lately. Pretty lame I know…

\n

So I\’ve reinstalled TextMate in the hopes that this will fix my problems with TextMate munging all my HTML. If it works I\’ll probably try to upgrade my Wordpress installation too. Its getting pretty rusty

\n

Here goes nothin\’…

Comments (2)

97 things an architect should know

Posted on August 21st, 2008 by geardaddie under Development.

Check out this blog with a nice set of brief articles on architecture. I really like the first one in particular. :-)

Comments (0)

The two people I\’d like to pair program with

Posted on August 21st, 2008 by geardaddie under Development.

The two people I’d like to pair program with are Jessica Alba and Jessica Simpson - obviously! :-)

OK…ok… The two people I’d want to pair program with (when not using pair programming as an excuse to get close to someone) would be Robert C. Martin (aka: Uncle Bob) and Martin Fowler.

I’d pick Uncle Bob for his attention to detail when writing code. I’m in the middle of reading his book “Clean Code” which I highly, highly recommend. He does a fantastic job of making code readable and I’d like to learn that art from him. Furthermore, he’s very good at practicing TDD.

I’d want to partner with Martin Fowler because of his broad knowledge of patterns. I’d want to absorb his talent for abstractions and OOD design.

How about you? Who in our industry would you want to pair program with?

Comments (0)