1. Close Netbeans ID and all running servers.
2. Run Derby Database manually as
$ asadmin --host 193.10.66.200 --port 1527 start-database
(You should be in glassfish->bin directory)
3. Run glassfish server a
$ asadmin --host 193.10.66.200 --port 4848 start-domain domain1
(Here 193.10.66.200 can be replaced with any hostname or IP address)
4. Now, open Netbeans. Open services tab on left. Right click on server and click Add Server. Add and Remote Server with above IP address and port.
5. Try to start this new added server. You cannot do so as the start button is disabled. Now right click on it and click Refresh. You will see that the Server node is now expandable and it may contain some object.
6. Clean, Build, and Run you project. The server is running and your project is deployed.
7. If you later want to stop the database or glassfish server, use following commands respectively.
$ asadmin --host 193.10.66.200 --port 1527 stop-database
$ asadmin --host Azan --port 4848 stop-domain
8. Enjoy
[Message sent by forum member 'shahid_raza']
http://forums.java.net/jive/thread.jspa?messageID=478019