this functionality used to work and now it seems broken, I a do not know how to diagnose it.
I am developing a java Applet that runs in a browser. I used to set up the runtime parameters in the java console to (Windows platform):
-Djava.compiler=NONE -Xnoagent -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=n,suspend=n
This setting appears both in the User and System tabs in the Java console.
Then I would start a debug session in eclipse for my applet project and set it to listen on port 8000. When I launch the browser and the applet is loaded, it would attach to eclipse and I was able to debug and set breakpoints, etc.
Now, it seems that this is no longer happening. When I launch the debug session in Eclipse, I do see port in LISTENING mode and owned by javaw.exe, which is correct. The only problem is that when the browser loads the Java plugin, it does not honor the "Runtime Parameters" and does not connect to the listening debug session in eclipse.
I have the latest Java update installed.
What else should I be looking into?
I just resolved my issue.
I edited:
C:\users\\AppData\LocalLow\Sun\Java\Deployment\deployment.properties
and added the pararameters as follows:
deployment.javaws.jre.0.args=-Djava.compiler\=NONE -Xnoagent -Xdebug -Xrunjdwp\:transport\=dt_socket,address\=8000,server\=n,suspend\=n
When i added the runtime parameters through the UI, they went to
"deployment.javaws.jre.1.args" so I duplicated them into "deployment.javaws.jre.0.args"
Related
When running Groovy Grails Tool Suite (GGTS) version 3.6.4 (latest as of June 2015), on Windows 7 Home 64bit, I get a "Error occurred during initialization of VM Too small initial heap for new size specified". I have a JAVA_OPTS System Environment variable of "-Xms512m -Xmx512m" I also have that same value inside the GGTS Menu: Run => Debug Configurations... Arguments Tab, VM arguments. This error does not happen when I do a run-app inside GGTS, and the app successfully starts. But, when I do try to run using Debug, with the run-app Debug Configuration, I do get this error. Where else could I possibly set the heap values to make this work in Debug? Any ideas of what else to test, fix, or set to fix this issue?
Could not get GGTS to launch my app, no matter what changes I made to -Xms and -Xmx everywhere I could find to make the change. Kept getting the same error. Finally, I stumbled upon this method of setting up the debug. Step 1, start the app from the console (not within GGTS):
grails -debug run-app
Step 2, in GGTS follow these directions to hook-up to the "grails -debug run-app" you just started (use port 5005 - as displayed in the console window), and when done, click the Debug button at the bottom: Create a Remote Java Application launch
Now, debug launches and I can set and view breakpoints inside GGTS.
I have a remote server with Java running to which i have SSH access.
I am writing an app on the local machine, building it with maven.
Is it possible to set the IDE Itellij IDEA to run my project remotely? The idea is : to build the jar, copy it to the server, and debug the process ( or something like that).
It would be nice of you to share the settings i need to setup.
This is what I usually do to debug my remote app.
Run the server on debug mode
This can be adding this particular line when you run your application server
-Xdebug -Xrunjdwp:transport=dt_socket,server=n,suspend=n,address=9999
for JDK above 1.4, you can use this
-agentlib:jdwp=transport=dt_socket,server=n,suspend=n,address=9999
After that, run your application server
SSH Tunneling
I'm not 100% sure that you can access to your application's port directly if you're using ssh connection (well, maybe there is a way ;) ). So, first we need to expose the port for debugging that we set on first step by running this command.
ssh -f user#personal-server.com -L 9999:personal-server.com:9999 -N
Setting up the IDE
You can follow the step that #SSJVegito has said, which basically, is to point the debugger to the port 9999. Open the debug configuration in your Idea, then Change the circled value to 9999. Then, happy debugging :D
I think it's possible, I was able to do such a thing with a local server I was using to deploy my application. And since you have access to the server, it should work for you as well.
What you need to do in IntelliJ is create a Remote configuration. To do that, open IntelliJ and next to the run button (on the left), you should have your configurations, designated by a down arrow. Click that arrow and click Edit Configurations. A new window should open. Click the + sign in the upper left corner and the select Remote. A new window should appear. We now need to set the host and the port which the server uses for debugging (if you are using tomcat, it is usually 8000; in tomcat, you can locate it by opening the catalina.bat file with a text editor and looking for the JPDA_ADDRESS property, which allows you to change the port). Give your configuration a name and press Apply.
Afterwards, you need to run your configuration in Debug mode. You need to select it from the configuration list and press the Debug button located to the right of the Run button.
More details here:
http://blog.trifork.com/2014/07/14/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea/comment-page-1/
http://eclipse.org/jetty/documentation/current/debugging-with-intellij.html
http://www.javaranch.com/journal/200408/DebuggingServer-sideCode.html
I hope this helps.
Because my RCP eclipse application fails when run outside of eclipse, but works correctly when running inside of eclipse, I am attempting to use eclipse to remotely debug my application as it's running outside of the eclipse environment.
I am using 32 bit Eclipse 3.6.1 on a 64 bit Windows 7 machine. I am using 32 bit Java 1.6 update 37. I use the Eclipse Product export wizard to package the app, and I end up with an eclipse.exe. I have created a Remote Debug Configuration and set it to use port 8765 (random number). For debugging purposes, I start the app from the command line using this line:
eclipse.exe -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8765
Depending on whether I am attaching or listening via my Eclipse debugger, I will add the server=[y/n] option to this command line but it seems not to make any difference.
For the configuration Connection Type I have tried both Standard (Socket Listen) and Standard (Socket Attach). When I try Socket Listen, my debugger will start listening - "Waiting for vm to connect at port 8765", but when I start my app through the command line, the app starts fine but the debugger never attaches.
When I try Socket Attach, I start the app first using the command line, then when I attempt to attach using eclipse, I get the message "Failed to connect to remote VM. Connection refused"
I've tried all the various combinations of address: localhost, 127.0.0.1, and my local IP address. I get the same result each time.
Thanks for any help!
You are missing the -vmargs parameter. Try "eclipse.exe -vmargs -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8765"
I was searching for the same thing and found the answer in this helpful post http://blog.ankursharma.org/2010/05/remote-debugging-eclipse.html
this is better:
http://exploreeclipse.blogspot.com/2016/05/eclipse-rcp-remote-debugging.html
Defining the server and suspend arguments
$./TOS_BD-macosx-cocoa -vmargs -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8989
Another way of debugging your RCP application is to launch it with "-console" "-consolelog". This gives you the osgi console, where you can examine which bundles did (not) start, the services that are exported etc. Type help to get a list of commands available.
Can you attach to a running application using Eclipse, similar to how you attach using Visual Studio?
Yes.
If you start your server with the debug port open, by adding this into your java command:
-Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8888,server=y,suspend=n
And you have the source code in your project (technically this isn't required, but it's kind of useless unless you do), you can connect to the running server by setting up a "debug configuration"
with host = the machine the server is running on and port = 8888 (for example - see options above)
You can then set break points and the debug session will halt the server there and you can inspect variables/fields, and even set their values.
Update
The more modern command-line options for the JVM to do this are
-agentlib:jdwp=transport=dt_socket,address=127.0.0.1:8888,server=y,suspend=n
The Debug Configurations panel has a menu item Remote Java Application:
How about just do this:
"Open the DDMS perspective, select the device and attach to your app's process (you will see the package name listed)"
.. thanks to this post: https://stackoverflow.com/a/10074263/2162226
I would like to debug my separately running JSP/Struts/Tomcat/Hibernate application stack using the Eclipse IDE debugger. How do I setup the java JVM and eclipse so that I can set breakpoints, monitor variable values, and see the code that is currently executing?
I just Googled it. :)
http://bugs.sakaiproject.org/confluence/display/BOOT/Setting+Up+Tomcat+For+Remote+Debugging
Many more on google.
Effectively, set your JPDA settings:
set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket
bin/catalina.bat jpda start
Then, in Eclipse, Run->Debug Configurations...->Remote Applications.
Follow these steps:
Add the following arguments to the java command that is used to launch Tomcat (on Windows, I think this is in TOMCAT\bin\catalina.bat)
-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n
In Eclipse, create a 'Remote Java Application' debug configuration and set the port to 8787 and the host to the name (or IP address) of the machine where Tomcat is running. If Tomcat is running on the same machine as Eclipse, use 'localhost'.
In the 'source' tab of the debug configuration, add any projects that you want to debug into
Start Tomcat
Launch the debug configuration you created in step 2
Eclipse should now stop at any breakpoints that you've set in the projects you added in step 3.
Notes:
You can change the port to any other available port if for some reason you can't use 8787
If you want Tomcat to wait for the remote debugger to start, use 'suspend=n' in the command above to 'suspend=y'
You could do what they suggest, or use this Eclipse plugin, which makes it easier to configure Tomcat to begin with: Eclipse Tomcat Plugin
When launching tomcat via this plugin, it starts in debug mode by default, you must explicitly disable debugging mode if you want it to not allow Eclipse to connect a remote debugger.
For Tomcat 5.5 on Windows:
Edit bin/startup.bat
Find the line that reads:
call "%EXECUTABLE%" start %CMD_LINE_ARGS%
Replace it with these lines:
set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket
call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%