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.

Iwan

2 comments:

Anonymous said...

I also have some problems with NB6M10+GlassfishV2. Everything worked fine with NB6M9+GlassfishV2. After update to M10 my application doesn't deploy anymore. It always says that the connection pool isn't registred with the environment or something like that. I tried to create a completely new EJB-Module with the same results. The funny thing is, that it deploys fine on Glassfish v1 it even deploys on JBoss 5 without changes but not on Glassfish v2.

Anyway, I'll stay with NB6M10 because I can't live without the new features anymore.

Unknown said...

Hmmm, maybe I should try the M9 build again. What you can do to get it to work is create a new EJB project, deploy it and then copy your project over the new project and it works in about 99% of the cases. At least that is my experience. The problem is that you need to do this every time something is wrong in your app and you get the pool problem again.

Iwan