Header Ads

How change the default port of Netbeans and Glassfish ?

How change the default port of Netbeans and Glassfish ?
Glassfish and Oracle XE uses the same port 8080, and thus, if installed in the same system, results in the port conflict.
Now, locate
glassfish-3.0.1\glassfish\domains\domain1\config and inside it, there is a file domain.xml. In the file, change the port number to 8081 from 8080. Now in the directory,  <home dir>/.netbeans/<version>/config, there is a file called .nbattrs - edit it 8080 to 8081:

<attr name="GlassFishEE6\Instances\glassfish_autoregistered_instance\httpportnumber" stringvalue="8081"/>

Finally, a last and a small thing needs to be done. Netbeans need to recognize the new port number and so, we need to do the following steps:


  • Select Services window by using Window -> Services in NetBeans IDE.
  • In Servers window of NetBeans, remove GlassFish by using RemoveServer button after selecting GlassFish server.
  • Click on AddServer and select GlassFish and click on Next.
  • Select the Installation Location of GlassFish and click on Next.
  • Accept defaults and click on Finish.
  • Restart GlassFish, if it was already running.


Powered by Blogger.