I have Netbeans IDE version 6.8, and Glassfish version 3. My glassfish listener is set to port 81, but when I try to run the simplest web application via 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.
相关问题
- how to deploy wab files in glassfish
- Reducing line width of glassfish log
- Use ContainerRequestFilter in Jersey without web.x
- EclipseLink 2: ANT Task Error
- JSF 2 OpenJPA 2 Glassfish 3.1 WEB9031 Error
相关文章
- how to Change glassfish application url
- GlassFish (real) hot deployment of JSF pages and r
- JavaEE + Glassfishv3.0.1: Losing session attribute
- JSF 2: h:link and getrowdata
- what is difference between glassfish configuration
- Hello World! with Remote Stateless Session Bean
- EJB 3.1. Is @Local annotation needed?
- Where does glassfish save your class/project after
A bit late, but this should work...
I don't have 6.8 anymore, but the following is true for 6.9 and 6.10m1 - in the directory <home dir>/.netbeans/<version>/config, there is a file called .nbattrs - edit it, and look for something like:
<attr name="GlassFishEE6\Instances\glassfish_autoregistered_instance\httpportnumber" stringvalue="8082"/>
Change the value to whatever you've set in the appropriate Glassfish domain. If, like me, you have more than one version of Glassfish installed, or perhaps multiple domains, just look out for the ....displayName keys and follow your nose - it should be obvious which one you're altering.
HTH,
John
NB: you can, of course, delete the server and add it in again using the wizard to select the right ports - but I think editing .nbattrs is far easier
NB2: there is another .nbattrs file further down the directory chain that also contains glassfish config (can't remember the exact location - sorry!) and this looks like the right place to change the port - but editing this file appears to have no effect as, for me, it gets overridden with whatever is in config/.nbattrs file whenever I start up Netbeans
I'm a bit late, too, but I'll add my comments just-the-same in case anyone runs across this issue in the future. I'm running Windows 7 with NetBeans 6.9.1 and GlassFish 3 locally on a different port (2118) as not to conflict with my Tomcat server on default (8080). If you navigate to
<home_dir>/.netbeans/<version>/config/GlassFishEE6/Instances
, you'll find your .nbattrs file.Edit
<attr name="httpportnumber" stringvalue="8080"/>
to reflect the desired port. Save the file. Restart your server and you should be able to deploy/test your web apps, as desired, using NetBeans.Incidentally, poking around under
<home_dir>/.netbeans/<version>/config/J2EE/InstalledServers
, you'll see another .nbattrs file and because I have two app servers installed locally, I see<fileobject name="instance">
for Tomcat and<fileobject name="instance_1">
for GlassFish. XML entries<attr name="port" stringvalue="8080"/>
and<attr name="port" stringvalue="2118"/>
reflect the respective assigned ports for each server and the change made in the previous .nbattrs file.Hope this helps.
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.
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.
Go to the folder where Glassfish in installed.
Go into config folder which is as follows: c:\netbeans6.8\glassfish-3\glassfish\domains\domain1\config
Open domain.xml using any text editor.
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.
Save domain.xml.
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
Restart GlassFish, if it was already running.
Locate config folder which may be as follows:
Open domain.xml using any text editor.
Look for 8080 and change it to some other port number that doesn’t conflict with other port numbers.
source: http://ohmjavaclasses.blogspot.com/2012/01/how-to-change-port-number-for-glassfish.html
if you are using Glassfish 3.1.1 it may in /home/user/.netbeans/7.1.2/config/GF3_1/domain1/config/domain.xml,Find the 8080 port and replace it with alternate port number.