Tomcat hangs and prevents Eclipse from shutting down after running some time - eclipse

I'm running Eclipse 4.6.1 with in-IDE Tomcat 8.5.6 on Windows 10 Professional 64-bit Anniversary Edition.
After Tomcat is left running in Eclipse after some time, the Tomcat embedded in Eclipse can no longer be stopped. I press the red "Stop" button in the "Servers" tab, but nothing happens. Eventually Eclipse will ask me if I want to terminate Tomcat:
Server Tomcat v8.5 Server at localhost is not responding. Do you want to terminate this server? Click OK to terminate the server or click Cancel to continue waiting.
I click "OK to terminate the server... but Tomcat keeps running.
Unfortunately when I then try to close Eclipse, it hangs on "Saving workbench state." Finally I have to kill Eclipse, thereby losing my workbench state. Even worse, if I then start Eclipse back up and try to restart the embedded Tomcat, I get the following error:
'Starting Tomcat v8.5 Server at localhost' has encountered a problem.
Several ports (8005, 8080, 8009) required by Tomcat v8.5 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).
How can I surgically go in and really kill Tomcat so that it doesn't hang Eclipse and keep ports open? (Unfortunately the only thing that shows up in the task manager is Eclipse.exe. There is no Tomcat to be seen. I've tried killing the javaw.exe subprocess, but that doesn't help.)
(At one point I thought this was related to a VPN connection going down, but today this happened with no VPN connection at all.)
I've filed Eclipse Bug 511342. We'll see if anything comes of it.

i've tried locally but i couldn't recreate the bug .
im not sure that this answers your question but it is for sure something worth trying , in any case this might show some features to other users....
in the window menu you have the SHOW VIEW , there you can choose other
this open the future window with search bar and all the available views for the ide .
in the debug view , you can do actions not only on applications , but on servers also . the menu here is different from the view you see in the server, and you can do advanced termination other things.
welp , hope that helps .
*note , you don't need the server to run in debug mode .

Find your Tomcat installation directory, navigate to bin folder, open a command window there and execute an .bat file named shutdown.bat, this way you can kill tomcat directly, make sure to locate the appropiate Tomcat installation directory which Eclipse is using.
UPDATE - Expected output:

I have not used it in the same way you have, but this may help.
On a command prompt (Cmd.exe) execute:
netstat -a -o | find "8080"
That will list all IP/PORT in use alongside the PID (process id) filtering by port # 8080 (change it to meet your needs or remove the find if you want to list all)
Open Task Manager, and using the PID you should be able to find the particular
process that is using the ports you need to release.
updated:
Once you find the port (8080) you can try using the command
taskkill /f /pid [port number]
Found a related issue with this command: Stack overflow - Tomcat not shutting down eclipse
Again, I use this when I need to find a rogue thing that I need to kill, and I don't know if the embedded environment will show it separate but its worth a try.

In tomcat's console inside Eclipse, there's a red button that can stop it. Albert also stated that in task manager it appears as javaw.exe, however Eclipse itself also appears as javaw.exe, so be careful when killing each one. Eclipse should be the one that takes more memory.

Related

When hot code replace fails, the Jboss restarts the server by default

I have configured the Eclipse to Restart automatically the Jboss server on hot code replace failed by default.
With this configuration, the server is restarting continuously when I code, and my Eclipse loses performance.
I have clicked on Do not show error when hot code replace fails after set it to Restart, and consequently the following window in the image does not appear anymore.
I would like to change it in Terminate instead of Restart. But I do not find the option to do that.
I have configured the option in the application Reload menu of Jboss, it works.

jEdit 5.4 Windows 7 Install error: Thinks a jEdit session is open when it is not

I have been running jEdit 5.3 for about 1.5 years with no significant problem. On 2017-07-03 I used it and it worked fine. On 2017-07-04, it would not start. jedit and javaw exe's were created, but the jEdit window did not display. I uninstalled version 5.3 and tried to install version 5.4 and got this error:
"The installer will now try to quit a running instance of jEdit.
Please save your work and exit jEdit for the installation to continue."
When I continue, the installer freezes. The same happens if I try to install version 5.3. I did not have a running instance, but the installer thought that I had one. I am guessing that something went wrong with jEdit when I shutdown on the 3rd. (I always intend to close all apps before I shut down, it is possible that I forgot to shutdown jEdit.)
Does anyone know how to tell windows 7 to get rid of this phantom instance of jEdit. I am using a backup version of jEdit 4.5.2 for the time being. So, I can continue with my work. I am guessing that this phantom instance also caused the jEdit 5.3 startup problem that I had before the uninstall.
2017-07-15 Update: I tried installing jEdit 5.4 on Saturday and it worked! On my previous try, when I got the 'running instance' warning I stopped, because every other time I continued at the point the installation froze. On Saturday, I tried continuing after the warning, and it worked! My thanks to Ross Rogers and Mr. Vampire for taking the time to give me expert advice. Renaming the roaming jedit file apparently was effective. I am guessing that deleting the server file would have helped also.
The most likely cause is a stale server file that points to some other process. jEdit and the installer talks to running instances via the network (TCP) on a port that is opened randomly and written to the server file in your settings directory. If you do not quit jEdit cleanly (e. g. only close the window without using the file menu or the shortcut to completely quit jEdit when the jEdit server is running), then jEdit on next start (or the installer) finds the server file and tried to talk to the process listening on the port written in the file. If there is no process listening, it is assumed that the server file is stale and a new instance of jEdit is started. Unfortunately jEdit is not as grateful if there is some process listening on that port but is not answering, jEdit just waits forever currently. This definitely needs to be improved and I think there is also a ticket for this. Try to delete the server file in your settings directory, by default it is %APPDATA%/jEdit/server on Windows and then try to start jEdit or the installer again.
I had to add /SUPPRESSMSGBOXES. /VERYSILENT wasn't silent enough. /? doesn't tell you what the options are.
https://www.itninja.com/software/contributors/jedit-1/4-2570

"Terminate" in eclipse's console view leaves node.exe running

I recently started developing for Node.js/Express with Nodeclipse. I added a run configuration for package.json with goal start. This works as expected, the start command from package.json is executed (node ./bin/www). I can see this command in Eclipse's console view and I can see two node.exe processes appear in Windows Task-Manager. HTTP requests to http://localhost:3000/ are logged in the console.
However, klicking the red "Terminate"-Button in Eclipse's console view leaves the node.exe processes running. Subsequent attempts to start the app fail because the port is already in use.
I do not have this problem when I start the app with npm start in Windows cmd. Stopping the execution with Ctrl+C will also exit the node.exe processes.
This is my IDE-Setup:
Eclipse Luna SR2 (4.4.2) under Windows 7 x64 with jre1.8.0_45
Eclipse was setup this way: extracted eclipse-platform-4.4.2-win32-x86_64.zip (from here), installed Eclipse Marketplace Client, then installed Nodeclipse via Drag&Drop from nodeclipse.org
Node.js version v0.12.2 (for Windows x64)
express-generator (version 4.12.1) is installed globally
How can I make the Terminate button in the console view actually terminating the node.exe processes?
It seems that Eclipse only kills the npm script that is used to start up node. The thing is that Eclipse forcibly kills that script, giving it no chance to send any signals to the node.exe process.
This bug explains why this works this way.
Step 1:
Run command-line as an Administrator. Then run the below mention command. type your port number in yourPortNumber
netstat -ano | findstr :yourPortNumber
Red coloured circled area shows the PID (process identifier)
Step 2 :
Then you execute this command after identify the PID.
taskkill /PID typeyourPIDhere /F
P.S. Run the first command again to check if process is still available or not. You'll get empty line if process is successfully ended.

Run Tomcat within Eclipse as a different user

I am running Eclipse Indigo EE on Windows 7, logged in as me.. I have Tomcat running within eclipse right now (under Servers view) but it's running under my user. I'd like to run it as a different user. How do I go about achieving that? I don't want to run it as a Windows service or outside of Eclipse, I want to continue to manage it through Eclipse which makes debugging, shutting down, starting up a lot simpler for me.
Any ideas how to go about setting that up or if it's even possible?
Thanks
I could not find a way to start the Tomcat server as a different user. Whereas you can achieve this by opening eclipse as a different user. Following are the steps for the same
Open command prompt.
Run following command with intended user name and eclipse exe's location
runas /user:domainName\userName C:\eclipse-jee-mars-R-win32-x86_64\eclipse\eclipse.exe
Thanks,
Sabeer

Debug remote PHP CLI scripts

Here is my situation:
I am developing PHP CLI scripts on a distant server using Eclipse IDE with the RSE plugin (allows to edit files directly on the server).
Now I need to debug these scripts in a similar fashion than in Java (break points, show the variables content, ...).
I found something that could do the job: XDebug and PDT (Eclipse plugin). The problem is that when I try to launch the debug mode Eclipse says that there is no PHP debugger on the local machine. I guess it should be installed on the server machine.
I would like to know if it's possible to use PDT and XDebug to debug remote scripts and, if it's the case, how to configure them to do so. If not, I'd like to know if other solutions exist. It seems like XDebug uses TCP so it should be possible to debug remotely. I can change my IDE if necessary.
The server runs Ubuntu 10.04 with php5-cli and the dev machine with eclipse runs Win7 32bit.
Thanks
Yes this is possible, you need to enable xdebug in the remote server's PHP.ini file and make sure that the xdebug port (default 9000) is not blocked by any firewalls.
xdebug's page on setting up remote debugging.
Here is the complete procedure for the people who have the same problem:
First, install RSE by following the instructions on this website: http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.rse.doc.user/gettingstarted/g1installing.html
Follow the instructions on this HowTo to install XDebug on the server:
http://ubuntuforums.org/showthread.php?t=525257
Install PDT on Eclipse and do the following changes:
- under Windows/Preferences, go under PHP/Debug and change PHP Debugger to XDebug
- under Windows/Preferences, go under PHP/Debug/Installed Debuggers and configure XDebug. Change the field "Accept remote session (JIT)" to "any".
Open the Remote System Explorer perspective, select your scripts directories and create a project from them (Right Click, Create Remote Project). It will now appear in the PHP perspective.
Let Eclipse run and go to the server (e.g. via SSH). Run the script you want to debug. A Window will then appear on Eclipse proposing you to choose with which "local" (remote via RSE in our case) file you want to link the running script to. Normally, the default script proposed should be the correct one, because it is the one running on the server.
You should now have visual debugging with Eclipse for your PHP-CLI scripts!
Do you want to debug while being able to interact with the script on CLI or do you just want to start it and then step through the code? I guess your question is referring to the problem that you can't access the script directly through a URL. If that's your problem, then I guess the easiest solution would be to debug a usual PHP-web-site which requires your script. Then you can launch XDebug with that web-site initially and step into the script through the require/include-statement.
index.php:
<?php require_once("../../../../../dir1/[...]/cliscript.php");
Best regards
Raffael