remote debugging with tomcat/eclipse, while others are sharing system - eclipse

I have setup tomcat for remote debugging through eclipse, I have added following configuration in tomcat startup script
export JPDA_ADDRESS=9999
export JPDA_TRANSPORT=dt_socket
echo $JPDA_ADDRESS
…….
exec "$PRGDIR"/"$EXECUTABLE" jpda start "$#"
However, there are multiple developers working on this server and when my debugger stops at breakpoint I added, other developers get stuck, is there anyway in tomcat which will allow other developers to continue running application seamlessly while I am debugging?

As you made me realise, you really need a second independent tomcat instance. As underlined in the comment below, the debug breakpoint mechanism in the JVM would stop all webapps reaching the breakpoint even if you duplicate them (said otherwise regardless of the number of working threads, each thread would freeze and wait or resume signal).

Related

How to delete the local processes - maven[id]?

I am using JBoss Developer studio 10.1.0.GA.
I have a fuse integration project. In my JMX Navigator there are so many unused maven[id] formed. How can they be removed/deleted?
Please refer the image.
Wow, how did that happen? I guess you ran a Camel context locally several times? Did you stop the process in DevStudio console view? That should usually make those processes disappear. In your case there might be several running processes in the console view so stop and close one by one.
Alternatively you could terminate them manually either via the Task Manager (Windows) or by invoking "kill " (Linux).
I would really love to hear what you did to get into that state.

Using breakpoint in eclipse for servlet program

I got a problem using beakpoint. there are many discussed topic regarding my question. but all of them are about java program( where main() is declared) but for servlet program how to use breakpoint? i am using elcipse IDE galileo version.
Either you let Eclipse start the web container in debug mode, and you use the breakpoint exactly like you would do on a standalone application, or you start the container in debug mode from outside of eclipse, and define (and start) a debug configuration in eclipse which connects to the remote debugging session of the container.
The way to start the container in debug mode, and the port to use to connect the debugger to the server, depends on the container. Read its documentation.
Whatever the way you choose, you'll have to use your webapp (using your browser, for example), until a request is sent to your servlet and the line with the breakpoint is executed. At this point, the way to debug is exactly the same way as if you debugged a standalone application.

Need help setting up a (Tomcat) web app in Eclipse for debugging

I've been using both eclipse and tomcat for years but have always deployed my web apps externally and never had a problem. Now I'd like to use eclipse to debug my web app and I can't figure out how to make it work. I started by trying to get my existing web app to deploy through eclipse but after hours of trying different things I decided to start fresh. Unfortunately, I didn't get much further. I'm hoping if I can figure out how things work with a fresh webapp I can get things to work on my existing. Sorry, this will be long, but here are the steps I tried on the latest eclipse (Juno):
Installed new version of tomcat 7.0.34 at /usr/java.
In eclipse, used "servers" view to add server, pointing to the new install (I didn't add any resources because there weren't any available yet). Starting the server worked and got a 404 as expected at http://localhost:8080/ ... then I stopped it.
Created a new "dynamic web project", named it TomcatDebug, set the location to ~/tomcat-debug, chose the server just created above (the only one), chose default config, tomcat-debug is empty so chose defaults for build paths, defaults for module settings and had it generate web.xml.
In the "tomcat-debug" folder it creates WebContent, build, and src. I throw a sample "hello, world" index.html into WebContent.
Now the project TomcatDebug is created so I try to run it, tell it to "run on server", and it goes to http://localhost:8080/TomcatDebug/ but gives a 404. I even try to add index.html but it still gives a 404.
This is about as basic as it can possibly get so what did I do wrong?
Continuing to try and figure this out I stop the server, change the server setting to "use tomcat installation", but still get a 404 in the same way when I restart. I tried changing my module context path and still 404.
I'm completely stumped. I believe I followed all the wizards as basically as possible. Where did I go wrong?
Thanks for taking a look.
I haven't run tomcat through eclipse in a while, so can't answer that aspect of the question. But, to get at the heart of what you're trying to do (debug a webapp in eclipse through tomcat), you shouldn't necessarily need to. This may serve you instead:
EDIT: Eh, look here for instructions ("Debugging" section). The below is how I did it (JUNO and TC 7) and has an annoying quirk in point #1.
edit the startup.sh (assuming *NIX/OS X) - the last line will probably be
exec "$PRGDIR"/"$EXECUTABLE" start "$#"
change this to
exec "$PRGDIR"/"$EXECUTABLE" jpda start "$#"
to activate debugging. (there are other ways to do this that may be better - i think tomcat/the VM may pause for listeners before proceeding, so when you aren't debugging this is not ideal)
Create a Debug Configuration in eclipse, under the "Remote Java Application" set. Default port should be fine, and presumably host. Choose your project.
Add sources of relevance to your debugging in the Source tab.
Start server and run your new debug configuration. App should stop at breakpoints you've set.
Right Click your index.html Run As -> Run On Server you will see Tomcat will automatically run the page.

How to run the Google App Engine server without restart?

I am using Google App Engine plugin with eclipse to create some web application, every time after I modify the program and run it, the modification does not take effect instantly. I have to kill the one (sometime mistakenly will kill the eclipse program) of the javaw.exe process and re-run again. Sometime it will hang at the "datanucleus enhancer".
I know it happen because the new javaw.exe run on the same port as the previous instance. But no point to kill the previous javaw.exe instance manually everytime, it is very annoying.
I thought I can save the source file and it will be automatically deploy to the development server, but it does not. What can I do so I do not have to manually kill the process?
If you run your app in debug mode-- that is, via Debug As > Web Application (rather than Run As > Web Application)-- it should reflect your changes to source. (For some changes it may need to terminate and restart the server, in which case it will notify you).

Unleash Process in Eclipse

Is is possible to 'unleash', or whatever, a process in Eclipse that you've been debugging, or simply started with 'run'? Would be nice. After such an 'unleash-ment', the unleashed process should not die when Eclipse is shut down, and should be removed from the debug view, to avoid accidentally killing it. Essentially, become a regular application process.
thanks, -j
There is no such command/option in Eclipse and it might not even possible depending on the OS. If you want a Java process to survive the end of Eclipse, you must start it outside.
It's sad that, after more than a decade, creating standalone processes in Java is still so painful. There is the -jar option but there is no way to have more than a single main() method this way, few people know how to build a working classpath when starting your app this way.