4 Replies Latest reply on Apr 23, 2014 2:40 AM by nye'e

    Firstcup-war tutorial

    nye'e

      Hi:

      I'm new to Java ee. I got a tutorial firstcup from oracle java ee page. I followed the tutorial for dukes-age and it works fine.

      The tutorial for firstcup-war don't seem to run on my system.

       

      I am using Netbeans 8.0,  GlassFish 4.0,  jdk1.8 and windows 7 operating system.

       

      (1) : I followed the instructions provided and when i run the project the first message I got was to add a server I did not see on the tutorial (firstcup-war).

      (2): After adding a glassfish server the project still wasn't deployed on server and i got this warnings and exceptions form the glassfish server:

                         

      (2.1):

      Warning:   RAR5038:Unexpected exception while creating resource for pool DerbyPool. Exception : javax.resource.spi.ResourceAllocationException: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.

      Warning:   RAR5117 : Failed to obtain/create connection from connection pool [ DerbyPool ]. Reason : com.sun.appserv.connectors.internal.api.PoolingException: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.

      Warning:   RAR5114 : Error allocating connection : [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: connect.]

      Severe:   Local Exception Stack:

      Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): 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: connect.

      Error Code: 0

        at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:316)

        at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:135)

      .....

       

      and chain of other exception that caused the above execption.

      (2.2):

      Severe:   Exception while deploying the app [firstcup-war]

      Severe:   Exception during lifecycle processing

      org.glassfish.deployment.common.DeploymentException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): 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: connect.

      .....

      (3): On the run(firstcup-war) output page I got this message after the log that says build success:

      ------------------------------------------------------------------------

      Total time: 7.949s

      Finished at: Mon Apr 21 17:05:54 WAT 2014

      Final Memory: 9M/111M

      ------------------------------------------------------------------------

      NetBeans: Deploying on GlassFish Server

          profile mode: false

          debug mode: false

          force redeploy: true

      In-place deployment at C:\Users\NYE\Documents\NetBeansProjects\java ee\firstcup-war\target\firstcup-war-1.0-SNAPSHOT

      GlassFish Server, deploy, null, false

       

       

      Please help me fix this.

        • 1. Re: Firstcup-war tutorial
          gimbal2

          It looks like the application is expecting a derby database server to be listening on port 1527 running on the localhost, but nothing is willing to respond there. Might be a firewall blocking stuff, might be that nothing is running there at all. Recheck all the setup instructions to see if you missed something and check your firewall settings to make sure it allows connections to be made on port 1527 from the localhost.

          1 person found this helpful
          • 2. Re: Firstcup-war tutorial
            nye'e

            thanks !

            I get these error ont Java DB Datebase Process (output)

             

            Tue Apr 22 10:31:46 WAT 2014 : Security manager installed using the Basic server security policy.

            Tue Apr 22 10:31:54 WAT 2014 : access denied ("java.net.SocketPermission" "localhost:1527" "listen,resolve")

            java.security.AccessControlException: access denied ("java.net.SocketPermission" "localhost:1527" "listen,resolve")

              at java.security.AccessControlContext.checkPermission(AccessControlContext.java:457)

              at java.security.AccessController.checkPermission(AccessController.java:884)

              at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)

              at java.lang.SecurityManager.checkListen(SecurityManager.java:1131)

              at java.net.ServerSocket.bind(ServerSocket.java:374)

              at java.net.ServerSocket.<init>(ServerSocket.java:237)

              at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:231)

              at org.apache.derby.impl.drda.NetworkServerControlImpl.createServerSocket(Unknown Source)

              at org.apache.derby.impl.drda.NetworkServerControlImpl.access$000(Unknown Source)

              at org.apache.derby.impl.drda.NetworkServerControlImpl$1.run(Unknown Source)

              at org.apache.derby.impl.drda.NetworkServerControlImpl$1.run(Unknown Source)

              at java.security.AccessController.doPrivileged(Native Method)

              at org.apache.derby.impl.drda.NetworkServerControlImpl.blockingStart(Unknown Source)

              at org.apache.derby.impl.drda.NetworkServerControlImpl.executeWork(Unknown Source)

              at org.apache.derby.drda.NetworkServerControl.main(Unknown Source)

             

            does it affect the program?

            Please walk me through on how to start the Java DB database.

            Thanks agian.

            • 3. Re: Firstcup-war tutorial
              gimbal2

              There is nothing to step through, you have to fix your networking problems. If you don't know how, you'll have to learn. You can't get into Java / web / enterprise development without having a firm understanding of basic computer science.

              • 4. Re: Firstcup-war tutorial
                nye'e

                Thanks!  I have fixed it. I change the location of the java db server on my netbeans from JAVA_HOME\db (jdk1.8.0) to JAVA_HOME\db (jdk1.8.0_05) I have both jdk installed on my system.