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

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.

Related

Run a local command before starting eclipse debugging

I want to run a terminal command just before a debug configuration starts on Eclipse.
I heard about CDT launch Groups, but couldnt get around it fully. I need to just run a normal terminal command, nothing fancy.
The aim is to copy some stuff over to the execution path before actually starting the debugging.
I managed to do this via "Launch Groups" in the CDT. Creating 2 groups, one as a c/C++ Application which calls a shell script that includes the command I want to run. And then the normal debug configuration I wanted to execute.

Running PHPUnit in debug mode gives 'Unable to open 'BaseTestRunner.php': File not found' error

I am running Homestead on Windows 10 machine with Virtual Box. I have VSCode running on the Windows machine and I want to be able to debug code in the VM.
I have followed this setup:
https://tighten.co/blog/debugging-configure-xdebug-and-laravel-homestead-and-vs-code-and-phpunit
Once I am listening for Xdebug I run my code in the VM using phpunit test/Feature/AdminTest.php and this fails with
Unable to open 'BaseTestRunner.php': File not found
(file:///c:/g/Sites/Laravel/everyone-in-mind/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php).
Which is obviously showing me the Windows path.
If I stop the debugger and run again the test runs fine.
Do I need to install something extra to get BaseTestRunner?
When you are debuging a PHPUnittest with xDebug in VSCode with the PHPUnit plugin from Elon Mallin, check that you have disable the option Breakpoints/Everything.
It seems as if PHPUnittest, running from the PHPUnit-plugin, could not find the BaseTestRunner.php file and raised an exection. When you ignore this exception, you can run and debug your test.
see the same question PHpUnit with xdebug Breaks at BaseTestRunner instead of the actual test
It works for me and can now debug the Unittest.

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

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.

Digi Chat (V4.1) crashes when I close PuTTY

I am running a VPS, CentOS 6 with a copy of digi chat 4.1 on it. The chat runs fine, if I open putty and run the usual start up code:
# java -cp Server.zip com.diginet.digichat.server.ChatServer
The second I close PuTTY, the chat turns off. Or after the initialization sequence Digi Chat runs after that command, if it gives me a new prompt line (usually it doesn't, but for example copying a piece of code cause it to), the chat turned off.
How can I resolve this issue?
As root run:
java -cp Server.zip com.diginet.digichat.server.ChatServer &
If you installed using the InstallAnywhere launcher, there is also a system service you can start in /etc/init.d/.

How do I run a windows installer via telnet using the trial version?

I'm evaluating install4j in our company.
We build a win32 installer and we are trying to set up a continuous integration environment to test it.
The CI server is able to upload the installer to the windows target machine (which is a virtualized environment) using FTP, and run batch script that looks like
cd c:\tmp\upload\
my_installer.exe -q -varfile response.varfile -console
Currently we're using the trial version of install4j 5.
When the installer is ran from the command line (cmd.exe over remote desktop) I get a popup window that warns about the trial version.
Installation is frozen until I click ok.
When the installer is ran from telnet the command just hangs and never returns. I believe the reason is that popup window.
To fully evaluate install4j we need to be able see how it fits our CI process.
Is there any workaround for this?
This is a restriction of the evaluation version, with a permanent license key the evaluation dialog will not be shown and the problem will go away.