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..



Posted By sawes On 27-Feb-12 10:04:18 PM

thanks a lot



Posted By Mary On 15-Mar-12 02:56:08 PM

code given in this pages is very useful to me



Posted By Sarnendu Mukherjee On 19-Mar-12 08:20:54 PM

Awesome.. Thank you so very much.. Thanks a lot..
I was searching just this proper ans for a long time.. Thanks again.. :) :D



Posted By Amit Chauhan On 08-Apr-12 11:18:38 AM

i m really very very thankful to you. Thanks for provide such a great help.



Posted By herambha kumar On 14-Apr-12 04:39:37 PM

Thanks



Posted By Aster On 06-May-12 08:11:59 PM

Thanks! This "how to" helped me a lot. :)



Posted By veer On 25-May-12 10:24:07 AM

thanks... it was very useful :)



Posted By Aarti On 29-May-12 09:59:53 AM

Thanks a lot. I was struggling with Glassfish for more than 1 week and you made it in less than 5 mins. :)
Thanks a lot.
Verrrry useful tutorial.



Posted By james On 23-Jun-12 03:37:15 PM

thank you so much



Posted By Bhagyesh Solanki On 23-Jun-12 08:37:57 PM

Thank you,Sir
Very nice blogs.
that realy helpful to us for connection of jdbc.



Posted By ayerer On 06-Jul-12 01:54:37 AM

Thank you so much - so many people seem to have had this problem, as I did, but I only found a solution on your post!



Posted By vinod On 22-Jul-12 09:38:42 PM

bang on target. does what it claims and precise without too much hype

thanks



Posted By Vijay On 11-Aug-12 01:16:31 AM

Thanks a lot



Posted By Praveen On 18-Aug-12 03:25:37 PM

Thanks A lot Sir...!!
It really works.



Posted By kumar On 20-Aug-12 07:42:29 PM

thanks for giving more important information and another techniques about java,.net,android thanks once again;



Posted By Ashish On 18-Oct-12 03:19:19 PM

Thanks a Lot :-)



Posted By mss On 29-Nov-12 03:01:22 PM

thank you for ur post



Posted By londonbridgebox On 30-Dec-12 10:27:37 AM

Thank you :)



Posted By nalu On 03-Jan-13 05:26:47 AM

Thanks Heaps!



Posted By Lahiru On 18-Jan-13 06:04:17 AM

Thank you for your co-operation, I fixed my issue in glass fish 3.1.2 port error due this post............. Thank you once again



Posted By Ali On 19-Jan-13 12:37:55 PM

THANKS



Posted By satya On 01-Feb-13 01:24:03 AM

Thanks a lot my friend.
It was really useful.

Satya



Posted By Subrata On 22-Mar-13 01:56:58 PM

It worked thank you sir...



Posted By Serg On 17-Jun-13 11:41:50 PM

That's what we've all been wainitg for! Great posting!



Posted By naseer khan On 20-Aug-13 05:25:35 PM

Thank you very much for providing us with such a fantastic solution.
i was also getting the same problem



Posted By CC On 28-Aug-13 07:33:56 AM

Thanks a lot!
I had been struggling for hours until I saw your solution.



Posted By Raj Arvind On 23-Oct-13 10:11:06 PM

what is the installation location to be given while reinstalling glass fish.. pls tell.



Posted By zia khalid On 04-Nov-13 01:12:19 PM

Thanks a lot ,i changed the port number and glassfish is running



Posted By Hemanth Malla On 06-Nov-13 11:52:00 PM

Thanku for the info sir...



Posted By Hemanth Malla On 06-Nov-13 11:54:15 PM

but sir.. may i know the reason behind why both the glassfish and oracle tries to run on same port number 8080 ?



Posted By Damian On 20-Nov-13 04:32:16 PM

Thanks a lot. This helped with my class project



Posted By sachin On 07-Dec-13 08:59:18 PM

thanks a lot to you sir you are really genious..



Posted By nagarjun On 12-Dec-13 04:22:38 PM

hi
i successfully changed and removed the server from the net beans. and i try to add glassfish server it is asking target,username and password. i enterd username as "admin" and password is i before changed "123" but in the target field what i have to give.
Thank you



Posted By naoufal On 26-Feb-14 11:39:41 PM

this helped me , thanks a lot !



Posted By Prabhu Nandan Kumar On 05-Mar-14 08:17:02 PM

This work for me :) Thanks ....!!!



Posted By DM On 13-Mar-14 11:27:32 AM

Thank u very much.Your information was useful to me.



Posted By Nagaraju On 23-Mar-14 12:01:58 AM

thank you. it helps me a lot.



Posted By santha kumar On 26-Mar-14 06:38:29 PM

i installed mysql,oracle xe,tomcat and glassfish4. i have also server starting problem in glassfish. then i changed my glassfish port no from 8080 to 8090 but it is not working.please help me



Posted By Prashant On 12-May-14 12:15:12 PM

Thanks it very useful.....



Posted By Jaskirat Singh On 21-May-14 10:46:12 AM

simple , true and great ....all the steps are necessary and even work for glassfish version 4



Posted By sharma On 06-Jun-14 01:34:01 AM

thank u so much



Posted By Rajitha On 23-Jul-14 10:33:09 PM

Thanks.....it 's working both servers are running now in same time...this was really helpful to me.



Posted By sachin On 16-Aug-14 10:01:25 AM

thanks a lot sir..

Copyright © Srikanth Technologies. All rights reserved.