Friday, November 05, 2010

Glassfish : Moving a project from Glassfish 2 to 3

Migrated a web application project inside Netbeans from Glassfish 2 to Glassfish 3 and built it on another PC.

Obviously the paths had changed so I did a Search / Replace across all the Netbeans project files.

Then got an error:

... \nbproject\wsit-deploy.xml:12: Must set Sun app server root.


Clicking on that line showed:

unless="sjsas.root" Must set Sun app server root


For once, Mr. Google failed to come to the rescue.

Eventually, I brute force searched the actual Glassfish installation under:

\Program Files\glassfish-3.0.1

and found:

...\Program Files\glassfish-3.0.1\glassfish\domains\domain1\config\domain.xml

system-property name="sjsas.root" value="...\Program Files\glassfish-3.0.1"


Damn - wrong path.

Moral of the story. When you migrate projects across machines, you may need to update the Glassfish configuration files as well as the Netbeans project files.

Note: The ... above represents the actual directory which is different in each environment.

Aside: Because this was a Glassfish issue rather than a project issue, I got the same error when I tried using Tomcat instead of Glassfish. Maybe that should have been a hint!

Enjoy!

No comments: