The server may already be running in another process - eclipse

Several ports (8005, 8080) 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).
Can you please tell me what is the problem with Tomcat. I am running it on my Ubuntu machine.

Are you using tomcat with apache or other engine? If so you would have to change apache or tomcat ports so they do not overlap.
Maybe you start tomcat on system start and then you try to run it from eclipse? Before starting eclipse try to shutdown tomcat server.

Related

Confused about "Remote Debugging" Wildfly 20 from Eclipse 2020-06

I need to be able to "remotely debug" a Java/Jakarta EE servlet running under Wildfly 20 under Ubuntu 20 from Eclipse 2020-06 running on Windows 10 at a different IP.
My research has discovered what appears to be two different approaches: one is what I want and the other is a simpler "subset".
*** First the "simple" approach. This approach is supposed to let me debug from Eclipse an app that is already deployed and running on Wildfly. To do this I uncomment this line in standalone.conf:
JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"
Then I start Wildfly and ensure the app also starts.
In Eclipse I create in Debug Configuration a new Remote Java Application and ensure I use the same port 8787 as above. Then I just push "Debug".
I get this error:
Failed to connect to remote VM. Connection refused. Connection refused: connect
If I return to the Wildfly system and run the following I see that port 8787 is not being monitored so that sure looks like a problem:
ss -tp | grep 8787
(nothing is found)
*** The other approach appears to be what I want to do which is to have Eclipse deploy changed files to Wildfly and also allow me to debug remotely. That is how I worked with Eclipse Oxygen and Wildfly 10 when both were installed on the same Windows machine.
In this case I set up a new Remote Connection in Eclipse and then a new Server (and attach my Project to the Server) using that Connection. I then start the Server in Debug mode. In the Progress View I can see files being copied to a Path on the Wildfly server so that seems like progress but after 20 seconds I see the same error I got in the "simple" approach above.
Failed to connect to remote VM. Connection refused.
What's interesting is that if, in the Remote Systems View I open the Remote Connection I created, I am able to use the sftp item to see files on the remote Wildfly system. So it seems that I am able to connect to Wildfly.
I need help fixing both of these problems but especially the last one since I need to have Eclipse deploy changes to Wildfly as it did when Wildfly was local.
Thank you in advance.

jconsole cannot connect to local processes on my new Mac Air

I'm stumped. On my old Mac, Jconsole couldn't connect to local JVMs. I thought I had done something to mess up system configuration. Then I got a new Mac. The first thing I did was download a jdk, install it and check to see if jconsole could connect. It could.
Then I pulled over users and applications from my old mac using my Time Machine backup drive except my system files. Still worked.
But I found that odd things were happening with my development environment. In eclipse, I could start my Jboss server, but eclipse never recognised that the Jboss server had started. So, I could never add or delete war files to it through eclipse.
Also, the jboss instance could not connect to my localhost PostGres database even though the ds file clearly gave localhost as the host to connect to.
I fixed these problems by giving my new Mac the hostname the old Mac had had.
But now I am back to not being able to connect to my local JVMs through jconsole.
This affects not just jconsole, but jprof as well so I'd like to get it fixed.
jconsole can see the JVM processes. It just times out when I try to connect.
I also tried connecting to localhost: by writing a java class that slept for five minutes and running it with the following command line:
java -Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false
but I cannot connect to localhost:9010 or :9010 either.
My guess would be this is some network configuration problem, but any help would be really really appreciated.
Thanks,
George
I had similar issues with timeouts. Looking at the packets being sent, it seems that jconsole was trying to connect via an external interface and being blocked by the firewall.
I added
JAVA_TOOL_OPTIONS=-Djava.rmi.server.hostname=localhost
to my environment to ensure all java processes used localhost instead of an external interface for RMI (which is what jconsole is using for connections)

How do I access an Eclipse Tomcat server externally?

I am trying to access an Apache Tomcat v6.0 server running inside Eclipse (OsX) on port 8090 on a machine that is on a different network. I have tried http://my_public_ip:8090/ and it is not working and googling hasn't turned up anything that worked.
Any ideas?
Is it a Windows machine? If so, is Windows Firewall turned on? If so, have you added an exception for port 8090 and/or java.exe (maybe javaw.exe)?
In what way is it not working?

Tomcat port in use in NetBeans

I tried searching for this problem here and in other forums but could not resolve this issue.
I have downloaded NetBeansBeans 7.0 Java EE pack which also installs Tomcat 7 which it did.
I created sample web application and when trying to deploy I get an error:
Starting of Tomcat failed, the server port 8080 is already in use.
I tried changing the ports but no success. However, when i try to run same Tomcat from Command prompt using "startup.bat" command, it runs successfully.
Operating system is Vista. I tried checking for open ports using "netstat -a" but no open port for 8080. also tried to see if any "java.exe" process is running but it was not.
Thanks in advance for the help.
Sometimes Vista, especially after hibernation, doesn't free a previously used port. Have you tried restarting the pc?

Several ports(8080,8009) required by tomcat v7.0 server at localhost are already in use [duplicate]

This question already has answers here:
Several ports (8005, 8080, 8009) required by Tomcat Server at localhost are already in use
(36 answers)
Closed 6 years ago.
I built a new web project and added a JSP file to test if it works with the tomcat service. The IDE is Eclipse 3.7 for Java EE, I ran the project, then it showed:
Several ports(8080,8009)required by tomcat v7.0 server at localhost are already in use...
So I changed the two ports and ran it again(I'v restarted the tomcat service),but it still didn't work,it showed:
Server tomcat v7.0 server at localhost failed to start.
So what's the problem?
hmm.. on which base OS you 're working . Windows or Linux
If it is Windows and you have installed tomcat as a service.. then go to run box in start and type services.msc and then in the opened window you will get to see many service running or stopped in the system. Find out the Tomcat Service and stop it. Then again just run your project again and it will automatically prompt you to start server.