30 March 2008

Can't publish web app to GlassFish


The easy fix for this is to add your Dynamic Web Project to an EAR project -
EDIT: you could also just update your eclipse, I just did this, and the patch is included in the WTP updates, after I found the solution with adding it to an EAR project, I installed the updates, and verified that it works with publishing a WAR file as well.

For me that works like a charm, I'm running eclipse 3.3.2 (j2ee distribution) and GlassFish v2ur1 and the GlassFish eclipse plugin on Ubuntu Linux 7.10. (eclipse and glassfish are totally fresh installs)

If you already have a Dynamic Web Projecct, then create a new EAR project (right click in project explorer and select "new -> project..." and under j2ee select "Enterprise Application Project" name it, and follow the wizard, then selecting your Dynamic Web Project.

Then under your server view, right click on your server and select "add and remove projects..." and add your EAR project."

I also found out that by removing the white spaces in between your workspace would solve the problem. I had a similar problem with Glassfish but in NetBeans. Maybe not a problem of eclipse/netbeans at all...(?!)