Web applications run on port 8080, where can I change it?
I have NetBeans IDE version 6.8 and Glassfish version 3. My listener in Glassfish is set to port 81, but when I try to run the simplest web application through the Netbenas IDE it tries to run it on port 8080. Where can I change it? Using port 8080 for my web application is out of the question for me.
source to share
A bit late, but it should work ...
I no longer have 6.8, but for 6.9 and 6.10m1 the following is true: in the <home dir> / directory. netbeans / <version> / config has a file called .nbattrs - edit this, and look for something like:
<attr name="GlassFishEE6\Instances\glassfish_autoregistered_instance\httpportnumber" stringvalue="8082"/>
Change the value to whatever you have set in the appropriate Glassfish domain. If, like me, you have multiple versions of Glassfish, or perhaps multiple domains, just look at the displayName keys and follow your nose - it should be obvious which one you are changing.
NTN,
John
NB: you can of course remove the server and add it again with the wizard to select the correct ports, but I think editing .nbattrs is much easier
NB2: there is another .nbattrs file further down the directory chain, which also contains the config from Glassfish (can't remember the exact location - sorry!) And this looks like a good place to change the port - but editing that file appears to have no effect. as for me it gets overridden with any config / .nbattrs file whenever I start Netbeans
source to share
Find the configuration folder, which may be the following:
C:\Program Files\glassfish-3.0.1\glassfish\domains\domain1\config
Open the domain.xml file using any text editor.
Look for 8080 and replace it with a different port number that does not conflict with other port numbers.
Source: http://ohmjavaclasses.blogspot.com/2012/01/how-to-change-port-number-for-glassfish.html
source to share
If GlassFish and Oracle Database are installed on the same system, there is a port conflict because both of them use port 8080.
Below is the procedure for changing the GlassFish port number so that you can run GlassFish with a different port number from Oracle to avoid port conflicts.
-
Find the folder where GlassFish is installed.
If you installed GlassFish along with NetBeans, you can find out the folder where GlassFish is installed 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.
-
Go to the folder where Glassfish is installed.
-
Go to the config folder , which looks like this: c: \ netbeans6.8 \ glassfish-3 \ glassfish \ domains \ domain1 \ config
-
Open domain.xml with any text editor.
-
Find 8080 and change it to a different port number that does not conflict with other port numbers. I usually change it to 9999.
-
Save domain.xml.
-
Now you need to remove GlassFish from NetBeans and add it again so that NetBeans understands the new port number. To do this, do the following
In **Servers** window of NetBeans, remove GlassFish by using **RemoveServer** button after selecting GlassFish server. Click on **AddServer** and select GlassFish V2 or GlassFish V3 and click on **Next**. Select the **Installation Location** of GlassFish and click on **Next**. Accept defaults and click on **Finish.**
-
Restart GlassFish if it is already running.
source to share
I am a little late too, but I will add my comments somehow the same in case someone runs into this problem in the future. I am running Windows 7 with NetBeans 6.9.1 and GlassFish 3 locally on a different port (2118) so as not to conflict with my default Tomcat server (8080). If you go to <home_dir>/.netbeans/<version>/config/GlassFishEE6/Instances
, you will find the .nbattrs file.
Modify <attr name="httpportnumber" stringvalue="8080"/>
to display the desired port. Save the file. Reboot the server and you may be able to deploy / test your web applications with NetBeans.
By the way, scrolling underneath <home_dir>/.netbeans/<version>/config/J2EE/InstalledServers
you will see another .nbattrs file, and since I have two application servers installed locally, I see one <fileobject name="instance">
for Tomcat and one <fileobject name="instance_1">
for GlassFish. The XML records <attr name="port" stringvalue="8080"/>
and <attr name="port" stringvalue="2118"/>
reflect the corresponding assigned ports for each server and the changes made to the previous .nbattrs file.
Hope it helps.
source to share