What is happening: You are using the glassfish witch is embedded in Netbeans but you dont want to you use that glassfish;). If you read the manual closely it said this:
2.1.4.1 To Install NetBeans
IDE without GlassFish Server
When you install NetBeans IDE, do not install the version of GlassFish Server that comes with NetBeans IDE. To skip the installation of GlassFish Server, follow these steps.
On the first page of the NetBeans IDE Installer wizard, deselect the check box for GlassFish Server and click OK.
Accept both the License Agreement and the
Junit License Agreement.
A few of the tutorial examples use the Junit library, so
you should install it.
Continue with the installation of NetBeans IDE.
BUT dont panic you do not need to delete and reinstall netbeans do the following:
Download:
Java Platform, Enterprise Edition 7 SDK Update 1
unzip the contents(glassfish4) to the directory where you installed java(C:/program files/Java/
GO to Netbeans -->Tools -->Servers
Delete the current Glassfish server
add a new server --> GlassFish Server --> Next-->Accept license --> Next--> Finish
Now you can use the javatutorial examples from the new glassfish folder and everyhting should be allright. if not then you need to edit the pom.xml file which is in the root op your javatutorial file and search for:
<glassfish.home.prefix>C:\</glassfish.home.prefix>
and change it to:
<glassfish.home.prefix>C:\Program Files\Java</glassfish.home.prefix>(Where you unzipped GlassFish4)
Good luck my Young Padawan