Learning J2EE

I've been working on becoming a Java guy. Maybe not a 100% Pure Java guy, but a guy who's at least familiar with Java and all that means today.

J2EE is impressive in scope. I'm going through Sun's J2EE 1.4 Tutorial and learning a lot from it.

I had an unpleasant weekend trying to work through the JBoss-IDE Tutorial. I ran into a number of problems with Eclipse, and with the tutorial itself.

Basically it went something like this. Install JBoss. Run JBoss, verify that it works. It does.

Install Eclipse. Verify that it works. It does.

Install the JBoss-IDE for Eclipse. Attempt to start the tutorial by creating a new J2EE project.

This is where I ran into the first problem. The version of the JBoss-IDE that I had was incompatible with the version of Eclipse that I was using. Instead of an error explaining this when I installed the JBoss-IDE, I got a corrupted dialog and an error when I attempted to create the new project. I'm not sure how this happened, but it seems like an embarrasing sort of error.

Eventually I found a version of the JBoss-IDE that would work with Eclipse, and proceeded through the tutorial. What struck me about this is the amount of work the IDE was not doing for me. Take a look at this page, and the amount of manual work you have to do to for things that could have been created from defaults, for example.

It took me most of a day to get through the tutorial. When it was done, I had a project that didn't work.

The first problem I had was related to a J2EE verification error. Apparently the compute method must throw a RemoteException, and the Tutorial hadn't specified that. I added that, redeployed the application, and got the same error.

Hmm. Tried this a few times, kept getting the same error. It looked like my changes to the source files weren't being reflected in the .ear file that was created by the packaging step. Turns out they weren't - for some reason, when I wanted the .ear file to be really regenerated, I had to manually delete it.

I ran into this a couple of times with Eclipse - places where I'd update a Java file, and see that the class file wasn't being regenerated. I tried with automatic builds turned on and turned off. The only thing that seemed to fix it was deleting the class files, and closing and reopening the IDE. If you have any idea what's going on here, I'd love to hear it, as I never found out why this was (and probably still is) happening.

The next error I got was related to looking up the object. This line was failing:

Object ref = context.lookup("java:/comp/env/ejb/Fibo");

I spent a few hours trying to figure this out, and got nowhere. It looked like the Fibo object was deployed, but looking it up this way wasn't working.

Eventually, I gave up. I'm going to go through Sun's J2EE tutorial now and hopefully learn enough from it to figure out what's wrong with the JBoss-IDE tutorial.