How To Change Port Number For GlassFish

If GlassFish and Oracle Database are installed in the same system, it results in port conflict as both of them use port 8080.

Here is the procedure to change port number of GlassFish so that you can run GlassFish at a different port number from Oracle to avoid the port conflict.

  1. Find out the folder where GlassFish is installed.

    If you installed GlassFish along with NetBeans, you can find out the folder where GlassFish is installed by using the following procedure.

    • Select Services window by using Window -> Services in NetBeans IDE
    • Expand Servers node and select GlassFish Domain
    • Right click and select Properties option from popup menu.
    • On the right of Domains Folder you can see the folder where GlassFish is installed. For example : C:\netbeans6.8\glassfish-v3\glassfish\domains. You can also see the other details regarding Glassfish such as port number, in the same window.
  2. Go to the folder where Glassfish in installed.
  3. Go into config folder which is as follows: c:\netbeans6.8\glassfish-3\glassfish\domains\domain1\config
  4. Open domain.xml using any text editor.
  5. Look for 8080 and change it to some other port number that doesn’t conflict with other port numbers. I generally change it to 9999.
  6. Save domain.xml.
  7. Now you need to remove GlassFish from NetBeans and add it again so that NetBeans IDE understands the new port number. For this do the following
  8. :
  9. Restart GlassFish, if it was already running.

Home    Blogs

Post Your Comment

Image

Enter the code given in the above image :
Your Name :
Your Email Address :
Comment :

Comments


Posted By chandan On 19-Oct-10 11:18:14 AM

Actually to work with JAVA EE6.0, i stopped my oracle and then used the port no(8080) for Glass fish, but now i came to know how to change the port no. of glassfish. I will be no more use the same port no. for both.
Thank you Sir



Posted By renu On 11-Nov-10 12:44:50 AM

thanks a lot to u........I was really tensed for these three days because of the error caused by this reason.Your blog really helped me out for this, now i m able to run my glassfish server without any error and can complete my project on time. really thanks to u.



Posted By sunil On 30-Jun-11 03:55:37 PM

thanks



Posted By dewakar On 23-Oct-11 07:05:28 PM

thanks i changed the port number in that domain.xml



Posted By appu On 23-Oct-11 10:32:51 PM

super



Posted By nithin On 09-Dec-11 09:07:13 PM

Thank U...
I searched almost a week 4 solution 2 this problem..
Thank U so much..:)



Posted By M Shankar Rao On 24-Dec-11 04:17:20 PM

Thanks for the steps regarding changing the port number of GlassFish Server.



Posted By Rohit On 23-Jan-12 09:25:15 AM

This worked. Thanks a lot.



Posted By Hemavathy On 04-Feb-12 11:20:39 AM

This helped me..Thank u very much..

Copyright © Srikanth Technologies. All rights reserved.