Thursday, December 12, 2013

NB7.3.1 and GF4.0 --- How to Get JavaDB Work?

I installed NetBeans 7.3.1 with GlassFish 4.0 on Windows 7 platform. Wrote web Application and as I try deploying , it gave two problems.

1. I could not start Java DB(Derby Database). I had previous install at a different location, that was one reason. Java DB start option was disabled.
Fix :
  • In NetBeans IDE
    • Select the Services Window -> databse
    • Expand the Database Node
    • Select Java DB, click RMB (Right Mouse Button) and select Properties
    • Specify the folder where Java DB is installed (GlassFish install location\javadb) and Click OK
    • Java DB server will start now



2.  GlassFish Server did not start, error message "GlassFish Server 4.0 cannot start port is occupied" was displayed in error dialog box.

Fix:

  • To check for busy ports
    • Open Command window Start -> Run -> cmd
    • At the command prompt 
      • netstat -aon
      • it showed port 8080 busy


    • In NetBeans IDE Services Window
      • Expand Server Node
      • Select GlassFish Server, Click RMB and select Properties
      • Look for the Domain Folder











      •  Note down the path of Domain folder
      • In windows explorer fo to the folder specified in the Domains Folder
      • domains folder will have domains1\config which has domain.xml file
      • open C:\glassfish-4.0\glassfish\domains\domain1\config\domain.xml file in an editor
      • search for 8080 and replace it with desired port

      • Save the edited file
      •  Currently present GlassFish server in NetBeans is configured to listen on port 8080
      • Remove this server from NetBeans
        • Select the GlassFish Server in NetBeans Services window, click RMB and select Remove
      • To add newly configured Server
      • Select Servers node in Services window
      • Click RMB and select Add Server
      • In Choose Server Window, select GlassFish Server and click Next Button
      • In Server Location Window, click browse button and select GlassFish installation directory, in this case it is C:\glassfish-4.0 and click Next Button
      • In Domain Location Window, accept the default values and click Finish
      • GlassFish server has been added to netBeans with newly configured port to listen
      • Start the Server... Enjoy !!!
      • Its Up and Running :)
Posted @ 6:19 pm 12/12/2013

No comments:

Post a Comment