Please see the steps I have followed below:
1) Start the Glassfish server in Netbeans:
2) Run the Netbeans project, which successfully browses to: http://localhost:8080/CRUDWebAppSQL/StudentServlet I am able to use the application.
3) Close Netbeans, which stops Glassfish (in preparation for the next step)
Then I try this:
1) Run the following DOS commands:
cd C:\Program Files\glassfish-4.0\bin
sadmin start-domain domain1
NetBeans is using a different mechanism to deploy your application to support hot deployment in comparison to a manual deployment.
To run the application without NetBeans first build the web application with e.g. with Maven
mvn clean install to get the *.war file.
Start the Glassfish application server and either deploy the war file through the web interface or with command line
asadmin deploy war-name
By the way I would suggest to update NetBeans to the current 8.2 release and have a look at Payara, which is a patched drop-in replacement for Glassfish: http://www.payara.fish/downloads