Monday, July 09, 2007

I ditched NB6 M10 for NB5.5.1, because I'm developing some EE stuff on Glassfish.

Last Wednesday and Thursday I spend most of my time on rebuilding my NB5.5 project in NB6 M10. The reason for this was that I couldn't successfully open the 5.5 project in 6M10 and deploy it. Opening was possible, compiling was possible, but I couldn't deploy it. Note that I'm deploying to Glassfish v2b53 that comes with NB6M10 and is called in there Sun Application Server 9.

So what I did was creating a new Enterprise project in NB6, and create all SessionBeans, Entity classes, servlets and webservices with the exact same FQN's as I used in my original project. Then I built the application and deployed it, just to verify it was working. After that I copied over the sources from my original project and deployed that and that worked... well almost.
For one, the servlet I have used local interfaces and that resulted in a deployment error. Interestingly the error was also reported when deploying to other Glassfish based AppServers, although it worked in NB5.5.
So I replaced the local interfaces with the remote interfaces and that solved the issue. Then I ran into a WS issue, which I can't recall, but that was fixed after creating a new WS with an operation on it and build that version of the project.

The most annoying of this whole process is until now left unsaid. The most irritating of the whole exercise was that I created a brand new Enterprise project deployed it and than EJB by EJB, servlet by servlet, WS by WS . With every change I deployed the project again.
As long as this resulted in a deployed application, all was fine, but as soon as something went wrong I got either an error stating that the created archive was invalid, or that there were no EJB-refs in the project, or that a pool was not defined and therefore not available. This wasn't fixable, instead I had to stop the App Server, delete the projects from NetBeans, one by one because due to some issue, you can't delete the Enterprise project which consequently deletes the EJB- and WAR-projects.
And then it was a matter of recreating the initial empty project and start all over again. I found out that I could zip a working project, delete the project from NetBeans, delete the folder on my filesystem, recreate the empty project, deploy it and then unzip the zipped project and deploy that one. Mind that I had to deploy the empty project or else it wouldn't work.

So finally I had a completely working project containing all components of the original NB 5.5 project that deployed. But as soon as I would hit the servlet, it wouldn't work. The problem has something to do with WS calling EJB's. Perfect... NOT.

So Friday night I spend on doing this whole exercise in NB 5.5.1, adding the Glassfish v2b53 to the servers and recreate a new Enterprise project. And then I added the sources from the faulty NB 6 project. I was feeling brave and I just moved all files at once instead of going through this tedious exercise that kept me busy for two nights already.
And what do you know, it all works nicely. No errors and all deploys wonderfully on Glassfish v2b53. Best of all, the issues I blogged about previously on the subject of deploying and debugging are non-existing in this release of Glassfish.

The bad about this is that NB 6 is so much better with regard to the editor and everything that relates to it, that it is really unfortunate that I have to go back to NB 5.5.1. I will try to get a clear view on the whole issue and report the proper findings in Issuezilla sometime this week.
I don't have that much time the next few days, as I am helping out a friend of mine securing his laptop and tomorrow I'm going to see Transformers. So maybe Wednesday I get around to it.


Tuesday, July 03, 2007

Developing the JEE application, how tears disappeared from my eyes...


It has been a while since I blogged, and that is mainly due to the fact that I didn't work on my project for quite a while. Why? Because I was too busy with all kinds of other stuff, like auditing an architecture for a start-up here in the Netherlands, setting up and implementing a QA process for a customer of mine and spending time in the UK on a JCAPS training and visiting JavaOne 07.

Between my last blog and now, I discovered some interesting things about NetBeans. I was using NB5 for my development until I installed NB6 M9 (got it on NetBeans Day 07 on a memory stick) and since the editor in NB6 is soooo much better than in NB5 that became my preferred IDE. Note that before I used M8 which was fairly stable, but the Java EE 5 support in M8 was not that good. So I used NB5 for JavaEE 5 code generation etc and NB6 for editing.
What was interesting was that my projects would only build in the IDE I started last. NB ammends the build files as it seems to reflect the changes of the new release. This took about an hour to register.

Last week I downloaded Glassfish v2b51 and configured NetBeans to use it. And all issues I had with Sun AS and Glassfish that I blogged about previously about not being able to debug my enterprise app disappeared. I can now succesfully start and restart my app in debug mode. Not that I am able to debug my application, since for some reason the datasources I need to connect to are not defined in Glassfish. But that's probably a problem in the build files or something. I noticed after a file-compare that my build files originating from NB5 are fairly different from the files that NB6 would generate. So I think I'll just create a new project and put my sources there. I'll keep you posted.

So for now: Use the latest version of Glassfish, I'm using v2b51. That should help.