Starting eclipse in Tomcat - Debug Mode - Timeout Error - eclipse

I get the following timeout error when trying to start tomcat in eclipse.
Timeout waiting for Tomcat v5.5 Server at localhost to start. Server did not start after 45s.
Does anyone know hot to set the tomcat timeout?

In server view, dbl-click on the server. The server configuration editor opens. There is a Timeouts section within.

You can go to "Windows"-->"Preferences"--> click on "Server" then you will see drop down "Server timeout delay". Select Longer.
It should work.

You can try remove all breakpoints unnecessary and run again.

Related

EDB Postgres server from local host Apache, Server is up and running The default Apache context is www in the Apache installation

I have been trying to get rid of postgresEDB apache HTTP server within my localhost and I am failing to do it. I have tried various options, including:
netstat -ano|findstr :8080
and
taskkill /pid number /F
but failed, as everytime I re-start system and type localhost, this pops up.
I've uninstalled EnterpriseDB and PostgreSQL, but still no luck.
I have the same issue, and stopping PEM HTTPD works form me.
go to "run" then "services.msc"
find a service called "PEM HTTPD", description Apache/2.4.39 (Win32)
right-click and select stop or disable the service.
Note: The process that runs on port 8080 was httpd. I used resmon.exe to find out about the process.
How can you find out which process is listening on a port on Windows?
I know this is old, but I neeeded help with the same issue and the answer didn't work for me. What worked was:
go to "run" then "services.msc"
find a service called "pgbouncer", the description says it is a "lightweight connection pooler for postgres"
right-click and select stop
if you needed the localhost:8080 all the time perhaps you could change the startup type to disabled too. but for a one time use, stopping it works.
I am running windows on bootcamp on a macbook, hope this helps.
I know this thread is old, but I thought I'd throw the answer out there in case this is the first page anyone hits (as was the case with me).
On Windows you can kill this task through the Services applet.
Go to "Run"
Type "services.msc"
In the Services app, look for the following lines:
EnterpriseDB ApacheHTTPD
EnterPriseDB ApachePHP
Double click on each service.
Change "Startup type:" to "Disabled"
Click "Stop"
Click "Apply"
Repeat for the other service
This will ensure that you won't have to contend with the service popping up every time you restart your PC.
This information is available on the EDBPostgres site as well https://www.enterprisedb.com/docs/en/6.0.2/peminstguide/installation_guide.1.30.html
Hope this helps someone!

Exception when I try to run a liferay portlet on my tomcat server

This is what I get:
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 8099; nested exception is: java.net.BindException: Address already in use: JVM_Bind.
I have to mention that I use liferay 7.0 ga3 and tomcat 8.0.32, my ide is eclipse luna.
I tried to run in command line start rmiregistry some_port, but it didn't do nothing, just popped up a window and did effectively nothing.
Thank you!
Tomcat uses port 8099 for JMX communication (which is crucial for debugging). There is already another process using this port. Here are some possibilities:
In general, it is more practical just to finish the other process. A LOT OF TIMES, the other process is Spotify. Are you using Spotify? If so, just finish it, start Liferay and then reopen Spotify. Annoying but straightforward.
You started another Tomcat bundle. In this case, you only have to shut it down.
A previous Liferay execution just crashed and let a rogue Java process listening on the port. In this case, go to the terminal and execute jps:
$ jps
28058 org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
1787 Bootstrap
14207 Jps
Kill the process that is labeled Bootstrap:
$ kill -9 1787
Technically, you could change the port on Tomcat. Open the server configuration, click on "Open Launch Configuration." Then, go to the "Arguments" tab and look for 8099. Basically, follow the GIF below:
However, I do not know all the consequences of it. I used to do it with Tomcat servers without LDS, not sure what problems it could bring with LDS.
Please check whether the shutdown port mentioned in the server.xml file under liferay-dxp-(version)-ga1\tomcat-(version)\conf folder.
Use the below command to find the ports running in your windows machine:
netstat /nao | findstr "80"
then change the shutdown port to any available ports, say 8010:
<Server port="8010" shutdown="SHUTDOWN">
restart the server.
Please try this step if the shutdown port is already in use.

FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)

Can you explain what this error is (and secondly why I am getting it)?
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
P.S. It may be related to Known Tomcat 6.0 and JDK 1.7.0_02 issues?, as I only started getting it after upgrading from JDK 1.7.0 to 1.7.0 update 2, with no other upgrades to other software.
I am running:
Eclipse Indigo 3.7
JDK 1.7.0_0u2 (JDK 7 update 2)
Tomcat 6.0
Windows 7
Apache HTTP Server (although not using it yet)
When I start Tomcat I started getting this error, but not all the time. Rebooting just now fixed it. Some mornings I come to work without a reboot and it fixes it even though it failed the day before. It's sporadic. To debug this I need to understand. Can you help explain it?
EDIT : I have two Tomcat servers, for two different projects, on the same port. The other (first) server is "stopped" but remains "synchronized", in case this matters. I've quickly tried changing all the ports up one (8080 to 8081) and the error reproduces. This may not be a proper test of changing ports, however.
EDIT 2: I just had this problem, and rebooting "fixed" the issue. The workstation was on all weekend and Tomcat worked on Friday and Eclipse was shutdown at the end of the day. I will keep taking notes like this as I run into it to remove guesswork.
EDIT 3: Today it gave me this error from an unrebooted system that worked yesterday, programs shut down yesterday and restarted today. I rebooted, and the error is gone. Most notably is that the error always occurs at 23% compilation. It hits 23%, waits a bit and this is when I know it won't succeed, and then popups a window. I'll capture what the window says next time. Then it gives the above error to the Console.
EDIT 4: I am running Windows 7 and Apache HTTP Server (although not using it yet). I'll add these to the list above.
EDIT 5: The popup window mentioned in edit #3 is (and note my Tomcat is named Server Tomcat v6.0 Server at localhost):
Problem Occurred
'Server Tomcat v6.0 Server at localhost' has encountered a problem.
Server Tomcat v6.0 Server at localhost failed to start.
OK << Details
Server Tomcat v6.0 Server at localhost failed to start.
EDIT 6: I just got a new problem, which is Cannot connect to VM com.sun.jdi.connect.TransportTimeoutException popup window error and the same main error that this question asks about in the Console window.
EDIT 7: Just restarting Eclipse, not rebooting the whole computer, solved the error this morning.
This error typically comes up when the necessary port is taken by another program.
You said that you have changed the HTTP connector port from 8080 to 8081 so the two Tomcats do not clash, but have you also changed the <Server port="..." in tomcat/conf/server.xml to be different between your Tomcats?
Are there any other connectors ports which may possibly clash?
Does your HOSTS file have an entry for localhost? Some other situations this error is seen in seem to have this as a problem resolution.
Make sure you have 127.0.0.1 localhost set in it...
(from this and this)
Encountered this. all I did was to kill all the java process(Task Manager) and run again. It worked!
Check whether your config string is okay:
Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999
I just had this issue today, and in my case it was because there was an invisible character in the jpda config parameter.
To be precise, I had dos line endings in my setenv.sh file on tomcat, causing a carriage-return character right after 'dt_socket'
EDIT these lines in host file and it should work.
Host file usually located in C:\Windows\System32\drivers\etc\hosts
::1 localhost.localdomain localhost
127.0.0.1 localhost
I had the same problem because I set the following in Catalina.sh of my tomcat:
JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999"
After removing it, my tomcat worked well.
Hope help you.
Encountered this issue and changing the debug port helped. For some reason, the debug port had to be greater than the app port.
Change control panel Java's option about proxy to "direct", change window's internet option to not use proxy and reboot. It worked for me.
This error mostly comes when we forcefully kill the weblogic server ("kill -9 process id"), so before restart kindly check all the ports status which weblogic using e.g. http port , DEBUG_PORT etc by using this command to see which whether this port is active or not.
netstat –an | grep
(Admin: 7001 or something, Managed server- 7002, 7003 etc)
eg: netstat –an | grep 7001
If it returns value then,
option 1: wait for some time, so that background process can release the port
option 2: execute stopweblogic.sh
Option 3: Bounce the server/host or restart the system.
My issue was resolved by option 2.
if your JVM Cli is: -agentlib:jdwp=transport=dt_socket,address=60000,server=n,suspend=n and JDK version is 7, change "server=n" to "server=y" will be OK.
In my project I had the same error, I restarted Tomcat and it worked, withtout killing the java process.
I set 127.0.0.1 localhost, and solve this problem.
I had the same problem in Catalina.sh of my tomcat for JPDA Options:
JPDA_OPTS="-agentlib:jdwp=transport=$JPDA_TRANSPORT,address=$JPDA_ADDRESS,server=y,suspend=$JPDA_SUSPEND"
After removing JPDA option from my command to start the Tomcat server, I was able to start the server on local environment.
I was getting the same error when i switched to STS version 3.8.3
And imported my entire workspace to the new STS.
Apparently the "Boot Spring App" instance was defective. (i run from STS)
If this is your problem,
Simply create the Boot run configuration again.
In case you are working with environments or docker images you can really change /etc/host I recommend just changing the binding from star to 0.0.0.0.
So (basing on my case for instance) instead of:
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
You would define it as:
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:5005"

How to kill Tomcat when running it from Eclipse?

I am running the Tomcat that gets delivered with your Eclipse download (no, I don't want to download and install the entire Tomcat), and sometimes it hangs when stopping or restarting, and the only way I can find to make it work is restarting all my Eclipse. I am using it under Windows.
Is there any way to kill the Tomcat process (which doesn't appear in the Task Manager)?
It appears as javaw.exe in task manager. An alternative is to execute Tomcat/bin/shutdown.bat.
As to the hang problem, are you sure that your webapp isn't spawning unmanaged threads which might be blocking Tomcat's shutdown?
On Windows, if you know the port Tomcat listens to (below, it is 8080), you can find the PID of the Tomcat process and then kill it from cmd:
> netstat -aon | find "8080"
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 2196
TCP [::]:8080 [::]:0 LISTENING 2196
> taskkill /pid 2196 /f
SUCCESS: The process with PID 2196 has been terminated.
I use better way to shutdown tomcat when it is not found in task manager.
1) Download TCPView(only 285kb) from following link.
http://technet.microsoft.com/en-in/sysinternals/bb897437.aspx
2) Extract folder and start TCPView application.
3) Right click on java.exe and select End Process option.
this would stop your tomcat easily.. This tool is very useful in monitoring port usage.
NOTE: Running TOMCATPATH/bin/shutdown.bat may not shutdown Tomcat when it contains some demon or unmanaged
threads. In such cases TCPView works fine without any issues.
You can set a timeout on startup and shutdown for your Tomcat server in Eclipse. If these timeouts are exceeded, Eclipse will pop up a message asking you if you want to kill it, or keep waiting.
To set these, double-click the name of the server in your Servers tab. It'll open a window like this:
There's a Timeouts section on the right hand side. I set startup to a day (so I can debug startup without it timing out), and shutdown to 30 seconds to be generous (usually this can be very short, since most apps can survive a forced shutdown with no issues).
If you use Linux, try the following steps.
List Tomcat processes (e.g., ps aux | grep catalina)
Locate the strings that look like this: myname 2244 5.5 0.3 57020937 2110741 ? Sl Oct03 5160:01 /usr/lib/jvm/java-1.8.0-<...>/bin/java <...> org.apache.catalina.startup.Bootstrap start
Copy-paste everything between /usr/lib/jvm/<...> and <...>.Bootstrap
Add stop at the end of your command and run it
Essentially, you would take the very same command that was used by Eclipse to start Tomcat and modify the last argument to stop Tomcat.

How can I disable the eclipse server startup timeout?

By default when using a webapp server in Eclipse Web Tools, the server startup will fail after a timeout of 45 seconds. I can increase this timeout in the server instance properties, but I don't see a way to disable the timeout entirely (useful when debugging application startup). Is there a way to do this?
In Eclipse Indigo, you can edit the default timeout by double-clicking on the server in the "servers" view and changing the timeout for start (see graphic). Save your changes, and you're good to go!
On the EclipseIDE, double click on the server
Admin panel opens up, click on the "Timeouts" tab
Put larger value in the "Start (in seconds)", may be 1800
Restart/Start the server
If everything is okay, the server should start.
Just another data point. If you see in your Console "Server startup in NNN ms", but the Server view still shows that it is trying to start, and then times out eventually killing the server, it might be that you have no plain HTTP connector configured. For example, if you have only a 2-way SSL connector configured in your Tomcat, it will start fine with the scripts in "TOMCAT_HOME/bin", but if you try to start it with the Eclipse Server view, it won't be able to open a connection to the HTTP port, and will terminate when it hits the timeout. (This was with a fairly old STS 2.1.0. Don't know if it's fixed in later versions)
Joe
Julie's answer gives you a long timeout, but not unlimited. You can move the server configuration file to the workspace, and then edit the xml file directly and set a limit greater than 1800. It's an ugly hack, but should work.
Goto Window > Preferences > Server
Set 'Server timeout delay' as Unlimited from drop-down menu.
or
Goto $WORKSPACE/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.server.core.prefs
Add/update line machine-speed= -1
here, -1 ~ Unlimited
If you still has issue after changing timeout settings, then it's best to remove the server configuration in Eclipse (in Server view tab) and re-create it again.
Server --> New Server.
It worked for me.
yes this works, but the maximum limit is 1800, which is 30mins.
Sometimes when rebuilding our entire database (on server initial start) this can go for longer than 30mins and causes problems.
In eclipse 2019-09 (4.13.0) there is no UI capability to set an unlimited value. It must be between 1 and 84600 seconds (a day).
But if you edit the .metadata/.plugins/org.eclipse.wst.server.core/servers.xml file in the workspace and set the server's start-timeout attribute to a large number of in my case -1 it will not abort the server startup until such time is reached. I had to restart eclipse for the change to be read.
NOTE: using the UI to edit other values will coalesce your value to a value within the allowable range.