Run Tomcat within Eclipse as a different user - eclipse

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

Related

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.

Can't find pydev console prompt in eclipse

So I'm working on two machines and they both have Eclipse and Pydev on them. The first machine has a console that has a prompt where I can type in and execute commands when I run on:
The second machine doesn't have the same prompt and I can't figure out how to get it:
I've been looking around online and the closest piece of advice I found is that I need to find the console button on the menu bar next to the tabs and select to show/hide the prompt, but as you can see it's doesn't show up on the second machine. Does anyone know how to I can get the console prompt on the second machine?
Found the issue. I was using PyDev 2.8.2 which didn't support the prompt, I updated to 4.5.4 (higher versions don't show up in my eclipse) and now I'm able to see it.

VSCode ran once on install, won't run or install again

I'm running this on Windows 7 SP1 with most (if not all) current patches. I have administrative permissions on this machine.
The first time I ran VSCodeSetup.exe, it ran the installer for several minutes then launched the actual application.
I got called into a surprise meeting, so I closed it thinking I'd look at it again later.
However, when I returned to my computer and tried to launch it, I found no evidence that it was actually installed... no desktop icon, no entry in the start menu, no Explorer integration...
I tried running VSCodeSetup.exe again, but all it does it show the installer screen for a split second, which then vanishes.
Since then, I've tried the suggestions outlined in VSCode Installation Failed - Failed to extract installer to install the application, even going so far as to run Update.exe --uninstall followed by running VSCodeSetup.exe again, but nothing has worked.
I even tried disabling my antivirus software and running the installer again, to no avail.
Does anyone know what I can do to get VSCode working again?
According to the comments and answers to Install VSCode in a specific folder, Visual Studio Code installs itself to %LOCALAPPDATA%\Code on Windows.
While I'm not sure why it didn't register itself with Explorer, I can at least create a shortcut to %LOCALAPPDATA%\Code\bin\code.cmd (with icon %LOCALAPPDATA%\Code\app.ico) to get it working again.
Or remove the directory entirely and run VSCodeSetup.exe to install it again, which still doesn't add Explorer integration... but this time at least the PATH now has code in it.
On windows VSCode is installed as Code.exe and its located in your
C:\Users\<windows-user>\AppData\Local\Code\app-<version-number>\Code.exe
or
C:\Users\John\AppData\Local\Code\app-0.5.0\Code.exe

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

Can't run eclipse on netbook MSi wind! HELP

I just got this MSI wind netbook and tried to run eclipse on it. I installed JDK6 on the netbook already. Whenever I open eclipse there is nothing show up on the screen except a "warning sound" that alerts. What is the problem here?
ps.I just started learning java.
Most likely the Eclipse starter program can't find where you installed Java. Since Eclipse is a Java program, it needs a JRE installed (comes with the JDK typically) to run. Assuming you're running Windows on your MSI Wind, check to make sure the java executable is on your path in your computer environment settings (windows key + printscreen button, or windows key + pause button are the shortcuts to open the computer properties dialog if I remember correctly. Then go to advanced).
You can test if java is on the path by opening a cmd.exe shell window and typing 'java'. If it says it cannot find java, then you need to fix the path.
See this link for additional troubleshooting details: http://www.eclipsezone.com/eclipse/forums/t99010.html
You could try reinstalling the JDK. Perhaps having it on a different disk than the default (D: versus C:) is causing some trouble? It certainly isn't a problem with the hardware, I'm running Eclipse on Windows on an MSI Wind.
Use "Add/Remove programs" in the control panel to remove the java versions you have installed.
Then visit "java.com" and use it to install Java, and verify that it is working. You do not need more than that to use Eclipse.