1

I'm trying to use a new installation of TomEE as a local server in Netbeans but i'm facing a weird issue. Everytime I try a port, it is in used. I tried many many ports but it is always in used. So I ran this command in command prompt:

netstat -aon

It listed all the listening ports with the PID. So I opened task manager and I found out that Java (TM) Platform SE Binary. I ended the process. Restarted Netbeans and everytime I end the java process, it seems it creates a new one not allowing me to use any port... Say I change it for another port, Java (TM) creates a new instance and uses the port I want to use throwing me a used port error in the IDE.

How am I supposed to fix this if each single time I change port, Java creates a process and use the exact same port?

Bic Mitchun
  • 478
  • 2
  • 9
  • 21

3 Answers3

0

Change the port number by editing the server.xml file in TomEE installation directory.

for example:

<Connector port="18080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" />
Sagar Pudi
  • 4,634
  • 3
  • 32
  • 51
  • Server.xml changes port automatically when I change port by doing right click (on server) > Properties > change port. So your solution does not work since it will change by itself. – Bic Mitchun Jun 15 '15 at 18:54
0

Yo have to chnage the port number. Follow these steps.

1) Go to conf folder in tomcat installation directory e.g. C:\Tomcat 6.0\conf\

2) Edit following tag in server.xml file

3) Change the port=8080 value to your desired value for ex- 8085

4) Save file.

RajSharma
  • 1,941
  • 3
  • 21
  • 34
  • Server.xml changes port automatically when I change port by doing right click (on server) > Properties > change port. So your solution does not work since it will change by itself. – Bic Mitchun Jun 15 '15 at 18:55
0

As per your description it looks like net beans is using your tomcat so when you restart after changing the port your netbeans starts the tomcat server internally then when you're trying to start another tomcat instance you'e getting the error.Your can check you netbeans setting to disable tomcat. Better to get a binary distribution of tomcat and run it with different port and try if its working.

Sarfaraz Khan
  • 2,166
  • 2
  • 14
  • 29