How to solve port conflict of glassfish Server in Netbeans 8.0.2

The  web developers or software developers might have faced issue of port conflicting.

When we installed the IDE(Integrated Development Environment) for the development of software , some of the IDE also installed the required applications required to run or test the program written. The one of the IDE required applications are local Server.

Some of the popular IDE Netbeans also allow the developer and engineers to install local Server like Glassfish, Tomcat , JBoss etc.By default while installing them certain Ports are assigned to them. In the same system , Developer may require the Database Server.

If we install them one after another ,Ports conflict can be resulted.Port conflicts are occurred when the one of the recently installed server may take the Port of another.

If we install the  GlassFish and Oracle Database  in the same system, it results in Port conflict. Because by default GlassFish and Oracle Server use same Port  8080.

Here we have the smart solution to resolve this conflict by changing the port number of Glass Fish Server at different port number to avoid Port Conflict.

  • Go to the folder where GlassFish is installed.Mostly we installed GlassFish along with NetBeans, we can find out the folder where GlassFish is installed by using the following Steps.
    • Select Services window by using Window -> Services in NetBeans IDE
    • Expand Servers node and select Glass Fish Domain
    • Right click and select Properties option from popup menu.
    • On the right of Domains Folder you can see the folder where Glass Fish is installed. You can also see the as port number assigned in the same window.

12-5-2014 7-50-45 PM

  • Go to the folder where Glass fish in installed.
  • Go into config folder which is as follows: c:\Users\YOUR_USERNAME\glassfish\domains\domain1\config
  • Open domain.xml using any text editor prefer(notepad++).
  • Search for 8080 and change it to some other port number that doesn’t conflict with other port numbers. I generally change it to 9090.
  • Save the domain.xml.
  • Now we need to remove Glass Fish from NetBeans and add it again so that NetBeans IDE accept the new port number. For this do the following:
    1. In Servers window of NetBeans, remove GlassFish by using RemoveServer button after selecting GlassFish server.
    2. Click on AddServer and select GlassFish V.x and click on Next.(where x depends upon the version)
    3. Select the Installation Location of GlassFish and click on Next.
    4. Accept defaults and click on Finish.
  • Please Restart Glass Fish, if it was already running.

Hope this will be helpful.

Leave a Reply

Your email address will not be published. Required fields are marked *