开发者

How to change to a different port for Java server in Netbeans to listen?

I use Netbeans 6.7 to develop Java servlet. It defaults to port 8080. How do I change the port number to 8083 fo开发者_StackOverflowr example?


You can change the port, using the property editors available on the Servers dialog.

Select the Servers item from the Tools menu.alt text http://www.freeimagehosting.net/uploads/e8ed5c303e.png

This image was captured from 6.8... but the dialog has been available (pretty much unchanged) since NetBeans 4.1.


This depends on the servlet container or application server you are using.

In tomcat, for example, this is done by changing the port attribute of the Connector for HTTP/1.1 in tomcat/conf/server.xml. In other containers it would be similar to this - somewhere in the configurations.


1.Just search server.xml file in the conf directory [within tomcat installation folder]

2.Search for content like following:

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
  1. change the port attribute to any other port number.

source: http://ohmjavaclasses.blogspot.com/2012/01/how-to-change-port-number-of-tomcat.html


  1. GO to Tools > Servers.
  2. Dialog box opens up
  3. Change the port under "server port:" Try with increamenting or decreamenting the portnumber if it still takes time to run the jsp page
  4. Uninstall netbeans, glassfishserver, Tomcat open source code. then reinstall latest JAVA SE from the mother website www.netbeans.org.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜