Glassfish server starting problem java

Hi,
I am trying to get my hands on a web application with java.
I have installed Netbeans IDE for java EE with Glassfish server bundled.
Unfortunately, when I create a new Webapp from template and run it, it waits for a few minutes then gives the message, "Glassfish server failed to start”.
I don’t know what is wrong.
I reinstalled Glassfish and Netbeans again but the problem persists.
