title: JavaEE project fail to deploy
body: <p>I am beginner in Java EE. Today I tried to learn Java EE by following this tutorial: 
  <a href="http://netbeans.org/kb/docs/javaee/javaee-gettingstarted.html" rel="noreferrer">http://netbeans.org/kb/docs/javaee/javaee-gettingstarted.html</a></p>
  
  <p>It basically teaches how to create a Web Application from Java Web categories using Netbeans.</p>
  
  <p>When I run the application, I got the Build Failed error message like this:</p>
  
  <pre><code>  WebApplication1/build/web&amp;name=WebApplication1&amp;contextroot=/WebApplication1&amp;force=true failed on GlassFish Server 3+ 
  
       Error occurred during deployment: Exception while preparing the app : Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseException
  
      Internal Exception: java.sql.SQLException: Error in allocating a connection. 
  Cause: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused.
  
      Error Code: 0. Please see server.log for more details.
     WebApplication1/nbproject/build-impl.xml:721: The module has not been deployed.
      See the server log for details.
      BUILD FAILED (total time: 2 seconds)
  </code></pre>
  
  <p>I already turn glassfish server on and choose glassfish as the server when creating this project but it looks like the server denies connection. </p>