GlassFish v3 Domain Server cannot start. Port is occupied

耗尽温柔 提交于 2019-12-04 10:40:25

问题


I imagine this is a pretty generic error. I cant seem to find any documentation on it.

I am simply attempting to run a java web project with jsp's and beans... using netbeans 6.8 on windows xp.

Thoughts? apologies for such a newb question.

-Kirb


回答1:


you need to know who occupied the port. run in cmd netstat -aon | find ":80" | find "LISTENING" you will see process id. go to Task Manager and drop it.




回答2:


In Linux you get this error if the servername is not in the hosts file

check /etc/hostname and make sure there is an entry in /etc/hosts with

127.0.0.1 [your_hostname]




回答3:


If you get errors from glassfish on startup complaining that ports are already in use, and you know they aren't, the problem is almost certainly that your hostname is set incorrectly. Glassfish seems to look up the hostname for the machine and then to bind to a port using that hostname - if your hostname resolves incorrectly then it won't be able to bind and will report that the port is in use.

at the command line try typing 'hostname' to see whether the hostname that's reported is correct. ping it and check that it resolves to the IP address of your machine.

Have a look at your /etc/hosts file (on linux) and check whether everything is ok in there.

Also check the /etc/sysconfig/network file and make sure your hostname is set correctly in there.

I've had the exact same problem as you twice - and both times it's turned out to be a hostname issue. Glassfish really should have better error reporting about this.




回答4:


I was just encountering this issue. What I did was open my browser, pointed to localhost:8080. It looked like I already had an instance of Glassfish running.

So I then went to localhost:4949 (Glassfish server administration page) clicked on 'server (Admin Server)' in the left pane, then pressed the 'Stop' button.

I tried to deploy the J2EE application once again, this time successfully.




回答5:


I have faced to this problem(Win Xp and netbeans 7.0) and solved it. It's a NOD32 3.0 antiviris issue which i'm using. To solve it open nod32 antivirus

settings > choose protection against viruses and spyware > choose internet access protection > choose HTTP > choose Web Browsers

Then mark your netbeans IDE in the list of programs with red cross(by double clicking)

P.S. the real path to above settings in nod32 may vary in your environment as I'm using not an English version of antivirus, I've just translated the above path.




回答6:


The answer is to kill the process java.exe just like Andy said with this : netstat -aon | find ":80" | find "LISTENING". The server confuses the localhost IP with the localhost port 8080 so you should make sure to delete any other server with the same domain name registered.




回答7:


If you are running already a tomcat or apache server you should stop them and running again your application , it works for me, service [servicename] stop !




回答8:


type localhost:8080 at browser and discover what is using the 8080




回答9:


I use NetBeans*+Glassfish 4 under Ubuntu 14.04 . I get the same error . The issue has been resolved when i stop running TOMCAT .

sudo service tomcat7 stop



回答10:


I face this problem. and i am very suffered to solve. the solution is only one command line ..... sudo service tomcat7 stop




回答11:


As Andrey said, first, in the command line type:

> netstat -aon | find ":80" | find "LISTENING"

Next, kill the task of the result

> taskkill /F /pid 4996

Where 4996 is the pid you get when you type the netstat command. I had the same problem, but the task did not appear in the task manager so I had to use the taskkill command.




回答12:


In netbeans, go to Tools/Servers and add the glassfish server. Specifically, find the folder of your glassfish installation.




回答13:


You have to start GlassFish manually. Go to the console and run this command:

c:\glassfishv3\bin>asadmin start-domain

and run your project in netbeans.



来源:https://stackoverflow.com/questions/2366043/glassfish-v3-domain-server-cannot-start-port-is-occupied

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!