Could not start GlassFish Server4.1 HTTP or HTTPS Listener port is occupied while server is not running ON A MAC - netbeans

Could anyone shed some light on this? I have watched a few YouTube videos with the same problem but all solutions are based on Windows. How could I fix this on a Mac? I'm pretty sure I have no other servers running.
Thanks
see error image from netbeans

This means that there is another application using the ports the Glassfish requires. Use the command
lsof -nP -iTCP:$PORT | grep LISTEN
to list the what ports are in use along with the process ID of the process using the port. Glassfish requires ports 4848, 8080 and 8081 to be free. One app that sometimes causes port issues is vnc, so check if you have screen sharing turned on and try disable it if that is the case.

Related

client is waiting forever for remote server to return a webpage

I have an application with a server written in F# and serve web files using suave. I remote login using powershell into another machine in the network to run the application (The application is also in one of the network drives). I do that because that machine have access to third party APIs needed for the server. Now when I do [IPAddress_Of_Remote_Machine]/[html_file] or [name_of_pc]/[html_file] then chrome is waiting forever and doesn't ever return the webpage. This wasn't happening before and I ran into this problem recently. I opened a different port and used it instead of the default one 80. This made things work but the problem keeps showing up after a couple of days. I don't think it's a firewall issue but I'm clueless to why this is happening.
When running netstat -an, this is what I get (I hid the IP address):
As you can see all of the connections are either in CLOSE_WAIT or ESTABLISHED but not LISTENING. All of these TCP connections is probably because I have PhantomJS and two other APIs running in the application as well. However the loop back address is also open on the same port 5959:
I'm not sure what is difference between these two but when using PortQryUI to query the remote server it returns a success!
I have already made an inbound rule for port 5959 on the server so it should be allowed. The web page is stuck at Waiting for [name_of_pc]. Also, sometimes this problem disappears and everything works fine.
What is the potential problem behind this? Why would this happen all of a sudden?
UPDATE:
I re-ran the application today and it's working correctly. It could be that something is dynamically set within the firewall? Not really sure what is going on. The machine I'm running the server on has a bunch of applications running on it as well so maybe there is an external process that is affecting it?
I made a hello world app with Suave and deployed it on the network drive to test if it's going to work. I opened inbound rule for port 6001
Then I ran the app:
However, it's still not working and this time it says the site cannot be reached when I do: http://[name_of_pc]:6001.
Moving this to an answer so that it can be closed:
Could you post the bindings section of your suave cfg? I'm guessing you know where that is since you are using a non-standard port but if you need don't, search for HttpBinding. I suspect you will find it pointing to 127.0.0.1 which is not good enough for remote access. You could try changing it to 0.0.0.0 or to the server's actual IP address. I would try 0.0.0.0 first for the flexibility it provides

Find out the port a specific service is using

Can anybody help me with using nmap? I don't quite get it when it comes to find out which port a specific server is running on.
To exemplify my issue, I have to install the apache2 web server on an Ubuntu OS. Then, I have to start its daemon (no problem, I simply ran "service apache2 start", which, I think, really did the job for me). Now, I just have to figure out on which port this service is running. I read about netstat and nmap, but I don't really know which parameters I should use in order to find out the port. So, my question is : Is there any way to find out the port this service is using? If yes, how could I do that?
Furthermore, if I wanna find out which ports are opened (in "established" or "listening" state) on a specific server, how should I proceed to find out?
Thanks very much in advance.
netstat -tlp does what you ask for. nmap would work (e.g. nmap -n localhost), but why scanning ports if you just can ask the system?

Play 1.2.4.3: How to find currently used port for debugger?

I have several Play applications running parallel. One of them is running in Eclipse. I want to connect the Eclipse debugger (launcher "Connect JPDA to myapplication.launch"), but the port changes every time (probably due to one of the other applications blocking the default port). I would edit the launcher and enter the current port manually*, but: How would I know which port to use?
PS: As my app runs for quite a while I do not see the port initially displayed in the console anymore.
*PPS: Is there a more elegant way to handle this?
The more elegant way of handling this is to just define the jpda port it should use yourself, so you always know behind which jpda port an application is running and you don't have to look it up all the time. Its documented in the configuration manual and it comes down to adding jpda.port=???? in your application.conf (changing the question marks into a port number, ofcourse).
The reason they change is indeed because they are running in parallel. Java automatically switches to the next available port if the default is in use.
There should be a line in the output log that looks like the following:
Listening for transport dt_socket at address: <some port number>
That's the debug port number you need to configure in Eclipse for JPDA.
OK, in OS X you'll find the port in the activity monitor: Double click each "java" process until you find the one belonging to Eclipse. The requested port is the one mapped to "*".
Click here for details (in German) and screenshots (I need 10 reputation to post images or more than two links)

Netbeans & Eclipse hang when I attempt remote EC2 debugging via Xdebug

Already, I've checked at least 20 resources and am out of ideas:
I have a clean, remote Ubuntu EC2 instance, fresh from the AMI, having stopped only to install LAMP, phpmyadmin, and xdebug on it. Yes, I have configured my remote EC2 instance's php.ini file as follows:
Meanwhile, back on my laptop I have Netbeans & Eclipse installed. While I can get either to seamlessly upload and Run my php web app on my EC2 site (via SSH/SFTP) as soon as I hit "Debug" from either, index.php gets uploaded, a browser window opens, and then NOTHING HAPPENS. The page doesn't load, the Debug perspective doesn't open, breakpoints don't get triggered, nothing. Netbeans just hangs out saying "waiting for connection" whereas Eclipse just sits at the notorious 57% level (& yes, I toggled the xdebug.idekey before testing with Eclipse)).
So I tested xdebug's functionality on my server according to the instructions found here and here (both passed). I tried changing to port 9001 (in remote php.ini as well as in local Netbeans/Eclipse), I even tried launching this brand spanking-new EC2 instance with pretty much open Security group settings (SSH=0.0.0.0/0), but nothing seems to be working. I am out & out flummoxed, a self-confessed noob, and appreciative of any insight seasoned professionals in the community may have to offer.
Thanks,
Debbie
This feels like a networking issue to me. Port 9000 may not be accessible. The quickest way to test is to telnet to port 9000 on the remote system (if you have a telnet client installed that allows you to specify which port to telnet to). If the telnet attempt times out or is closed by the remote system you will see the error and this verifies that there is a networking issue.
I would check /etc/services to make sure that port 9000 is not reserved for use of something else. If port 9000 exists and is uncommented then something else is using the port and that services does not know how to respond to your request so it hangs.
I would do a netstat (lookup params to see "all" listening ports) and make sure the remote system is listening on port 9000. If you don't see port 9000 then the remote system is not configured to establish the connection.
If you are on a WIFI network then port 9000 may need to be port forwarded to the remote system using the internal cable modem configuration menu/utility. This is the scenerio I favor because I've wasted so much time solving this kind of problem with different software.
Good luck, you have more troubleshooting ahead of you and different questions to ask to resolve your problem.

Is there a way to make it look like two programs are listening to port 80

I do know that I can't have two programs listening to the same port, but I am wondering if it is possible to fake it somehow, for an example:
My machine has two applications, one listening to port 80 and the other to port 6653.
If I get an incoming connection, let's say mysite.com:80/chat then it would be forwarded internally to the application listening on port 6653 and the data returned from that server would be forwarded back to port 80 somehow.
The reason I want to accomplish this is because there are many firewalls that seem to block connections to ports other than 80.
I have a chat server that I want to run on port 80, perhaps I could get another IP and machine for that, but it feels like too much trouble for a single chat server.
Any helpful feedback would be appreciated. Thanks!
You can probably do this with mod_rewrite if you're running Apache. That link has plenty of examples, including what you want (I think).
EDIT: I see you've updated the tags to say "asp.net". I'm guessing that you're not running Apache, then. I'm sure there is a similar tool for IIS, or you can use a proxy server that does the same thing.
There is a module called URL Rewrite that you can install on Windows Server 2008 (and R2) that is functionally the same as Mod_Rewrite. Download it here: http://www.iis.net/download/URLRewrite