Glassfish claims the port is occupied. Netsat disagree - windows

I have succesfully deployed application on port 8080.
After undeploy and killing all processes "java" and cleaning folders: "domains/domain1/osgi-cache/felix" and "domains/domain1/applications/" then
I tried to redeploy application.
It occured the port is occupied. I could not find that port using netstat (like it was suggested on many other posts) so I guess port should be available.
I managed to deploy on different port (9090). I did again undeploy and rest of actions like killing and stopping domain... it occured the port is still occupied as well and I could not deploy app on port 8080 and 9090 now.
I am using glassfish 4.1.2 and Windows. Anyone have ideas what can I do more?
I also added my hostname under etc/host.

From the description of your post, it sounds like you have tried to follow some instructions intended for Linux on your Windows system. Since you managed to start GlassFish on port 9090, that indicates that the hostname issue does not affect you. The fact that you could not start GlassFish on port 9090 afterwards suggests that you have not shutdown GlassFish properly.
On Windows, it is not always possible to view all Java processes if they were started by another user. So if you have GlassFish installed as a Windows service, then a Windows system user will start GlassFish and the Java process will not be visible to you.
A good way to verify whether or not GlassFish is still running is to visit the endpoint in a browser, in your case http://localhost:9090. If your application is there, then its homepage will show, otherwise GlassFish will serve a 404 which will look a lot like this:
If you manage to get a response in your browser, then you will be certain that GlassFish is still running.

Actually, I did not find answer why the port is occupied. But if someone else found similar issue, this procedure of redeploy works for me:
1: go to admin panel of glassfish (by default :4848). Select application and click undeploy
2: stop domain using console (asadmin stop-domain domain1)
3: start domain using console (asadmin start-domain domain1)
4: go to admin panel(by default :4848), deploy application.
This procedure worked for me, instead of clicking "redeploy" on admin panel.
Glassfish and Windows...

Related

Spring Boot Port Issues

I have created a single web page application using Spring boot and i have configured the port number in application.properties file.
server.port=9991
When I right click my project and click as Spring Boot App it runs fine and when i run it for the second time its throwing that port is already in use.
I am using Spring Tool Suite.
Please let me know why I am getting error.
Error Message:
Description:
The Tomcat connector configured to listen on port 9991 failed to start. The port may already be in use or the connector may be misconfigured.
Action:
Verify the connector's configuration, identify and stop any process that's listening on port 9991, or configure this application to listen on another port.
The first application you started was probably still running when you started oh the second time. Kill the process manually. Look for java processes and kill them.
If I am not mistaken, you can just configure port 0 for your application to let the OS pick a port for you. So you could have multiple instances running on the same box at the same time. Porbably you will encounter more conflicting ports for management etcetera.
I think you are using eclipse IDE. when you run first time your program it will take your current port number. I think you are running your application without stop your old process. simply way in eclipse, there is your application running log. there is cross btn or red square btn click that btn and re run that.

tomcat server does not start in eclipse

Whenever i try to run my servlet program on the server, it shows this error:
Several ports (8005, 8080, 8009) required by Tomcat v7.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).
I tried changing the port numbers but still there is issue with the port number. What should I do?
To resolve this issue,
Open tomcat bin
Execute shutdown batch file for windows
Refresh eclipse and it will solve the problem
Hope this answer is helpful
If nothing works, end all services which are active and using that port. Usualy port number 8080.
Also, you can do this:
right click proj-> properties-> Targeted Runtimes -> tick tomcat version on your pc or create new one

Apeche service of Xampp not install in win7 64 bit

While i am trying to install the Apache service then It shows Service not install. How can i solve this problem?
xampp version:3.2.2enter image description here
That means that apache cannot be currently installed as a service. It happens because the system failed to start apache.
Try to run it pressing the start button, to see if you can get more details about the error.
One of the most common thing is that the port 80 (or the port you have configured to serve web) is being used by another application such as Skype.
In order to solve this, you have to close that application and stop all services using that port and configure the application or service to run in another port.
To see what process is using your port: How can you find out which process is listening on a port on Windows?

Configure Eclipse to allow Tomcat connector under address other than localhost (issue with startup timeout)

I'm attempting to get Tomcat running in Eclipse with an IP address specified for the connector other than localhost. I'm running into an issue though with Eclipse hitting it's startup timeout. I get this error:
Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor.
However, I can see that Tomcat has started up successfully because I get this at the end of the console output:
INFO: Server startup in xxxx ms
Additionally, if I set the timeout value in Eclipse to a value high enough to give me time to bring up my webapp in a browser under the correct IP address, it works. But eventually Eclipse will shut Tomcat down because it hits the timeout.
What I'm thinking is happening is that Eclipse is looking to see if Tomcat has started under localhost:8080 but it's not getting a response so it thinks it hasn't started yet and it eventually times out.
Is there a configuration in Eclipse to either tell it what IP address to look for Tomcat under or to turn off the timeout feature all together?
Well, found a workaround by using Mongrel 1.0.0 plugin instead of the WST plugin that comes with Eclipse Java EE version. You can find it in the Eclipse Market place by searching for Mongrel or here is a direct link: http://marketplace.eclipse.org/content/mongrel#.Ur3MtfRDur8
They really should look at modifying WST to allow you to specify the address you're running the tomcat connector on or have it inspect the specified server.xml for the configuration setting. I can see how it might be useful to be able to run separate instances of Tomcat which WST allows you to do but this one thing prevents me from being able to use it. Mongrel appears to be much simpler which works just fine in my case.

Apache installation issue (in windows 7)

I want to install Apache Web server,for this I tried in the following way .
Step 1 :
I downloaded Apache Web server from the following link.
Step 2:
I installed in the following way.
click on Run-->next-->Accepted Terms-->next-->next
click on next-->next-->change..
click OK-->next-->install. here I am facing the problem I got two screens.
after completion of 23 seconds,It shows Finish button in main screen, I click on that.
to my conformation,whether it is working or not. I open following URL
http://localhost/
it's not working.
again for my conformation, I open the following window from my right hand side corner of my system.
How can I fix this.
can you suggest me ?
Your port 80 is already in use by another application, you have two options :
Find & Change the port or Deactivate the application that runs in port 80 (IIS, Skype...)
Changing the Apache port from 80 to another value.
There is "something" already listening on port 80 of your system, which will prevent Apache from starting. It could be Skype, or a web-server like IIS or Tomcat.
If you open the command-line (cmd.exe) and run netstat -ona, and look for the local lines that have port 80 in them (ex: 0.0.0.0:80, 127.0.0.1:80), you can then cross-reference the PID of that "something" with Task Manager's Process list (press Ctrl-Shift-Esc).
Then you can attempt to disable it (if it's a Service) or remove/uninstall it.
A couple of other issues -
You are downlading Apache 2.0, which is completly outdated. You should be at least using Apache 2.2.
Your Apache download will not come with PHP - you'll only be able to do HTML pages. Nor will it be configured for security, performance, multi-site, etc.
Unless you have a reason not to, try a WAMP (Windows, Apache, MySQL, PHP) distribution/package that has everything already set up for you. The popular free ones that come to mind are XAMPP and WampServer; and there are commercial ones like Wamp-Developer. Ans also a few others not mentioned, that you can find recommended here on StackOverflow.
use netstat -bano in an elevated command prompt to see what apps are listening on which ports.
But Usually following applications uses port 80 in windows.
IIS
World Wide Web Publishing service
IIS Admin Service
SQL Server Reporting services
Web Deployment Agent Service
Stop above applications if running and check!!!

Resources