To enable remote debugging both server and client needs to be configured. The server should be enabled to listen to debug connections and client should open a connection and interact with server for debug information.
On the Server:
Below are the jvm parameters which have to be passed to any server to enable debugging.
-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7010
Below are the meaning of each parameter
Xdebug- Enables debugging (start the jvm and listen to debug connections)
Xnoagent- Disables VM support for old jdb. Basically it disables the old way of communicating with the debugee. It is optional.
Xrunjdwp-Makes use of transport and the JDWP protocol to communicate with a separate debugger application. The sub-options specify the details required like
transport=dt_socket specifies to use socket connection on the port specified by the address.
transport=dt_shmem uses available shared memory transport address.
On the Client: (Here it is eclipse)
Follow the steps below:
1. Open java perspective
2. Open the java class where you want to place breakpoint
3. Add breakpoint
4. Now Go to menu bar Run->Debug Configurations (In older versions I think it is Run->Open Debug Dialog).
5. Right click on the 'Remote Java Application' in the left section of popup window. select New.
6. The class and package would be automatically selected for you as you had opened the java file just before you opened debug configurations.
7. Give proper host and port as mentioned in the server above, Apply and click debug.
8. Once you click debug eclipse will try to connect to server on the port.
Now run the application and you will see that the the program control would stop at the breakpoint you just added when your breakpoint is reached in the program flow.
Showing posts with label Eclipse. Show all posts
Showing posts with label Eclipse. Show all posts
Thursday, January 29, 2009
Sunday, October 19, 2008
More Eclipse!!
1. Update the file <eclipse>\configuration\.settings\org.eclipse.ui.ide.prefs to edit or remove RECENT workspaces popup.
2. Useful short cut keys
<ctrl> + <space> = on the editor this does smart insert
<ctrl> + <shift> + r = open resource (can be any file java, xml etc)
<ctrl> + <shift> + t = open type (java/class file, even searches inside the library jars.
<ctrl> + w = close currently open editor window in workspace
<ctrl> + <shift> + w = close all open editor windows in workspace
2. Useful short cut keys
<ctrl> + <space> = on the editor this does smart insert
<ctrl> + <shift> + r = open resource (can be any file java, xml etc)
<ctrl> + <shift> + t = open type (java/class file, even searches inside the library jars.
<ctrl> + w = close currently open editor window in workspace
<ctrl> + <shift> + w = close all open editor windows in workspace
Wednesday, April 23, 2008
eclipse.ini
Troubleshooting steps when eclipse is not running.... (Learnings from web)
I.
1.) Go to where ever you extracted Eclipse
2.) Do you see any folders with the name of ".metadata"?
3.) If so, delete the following files:
\.metadata\.plugins\org.eclipse.core.resources\.sn ap
\.metadata\.plugins\org.eclipse.core.resources\.ro ot\.markers.snap
II.
1.) Look for any .log files present in the root directory of wherever you installed Eclipse? These give better idea of the problem.
III.
1.) Go to the Eclipse directory of where you installed it.
2.) Double click the eclipse.ini file to edit it.
3.) Find the following code:Code: --launcher.XXMaxPermSize
4.) Change it to:Code: -launcher.XXMaxPermSize Or, just remove that extraneous dash there.
5.) Save the file, re-open Eclipse.
IV.
1.) Go to the Eclipse directory of where you installed it (like the last two), and make a copy of eclipse.ini and paste it OUTSIDE of the Eclipse directory.E.g., for me, I have Eclipse installed at: C:\projects\tools\eclipse; I copy eclipse.ini into C:\.
2.) With the eclipse.ini in the eclipse directory, double click it to edit it, select all, delete all contents, save, and then try opening Eclipse again.
V.
1.) Download an unaltered, unmodified, and latest version of Eclipse and extract it anywhere, apart from where you previously extracted the instance of Eclipse you are using now, and start it up.
2.) If it exhibits the same symptoms as before, i.e. it doesn't start and shows the same error message, then there's something wrong somewhere, log files may help.
VI.
1.) Although this is IBM's Rational Software Development Platform, at its core, it's still Eclipse: http://www-1.ibm.com/support/docview...04%204rational
2.) Follow the instructions, linked above, and see if it works out for you.
----------------------------------------------------------------------
Make sure no eclipse or Java™ process is running in Task Manager, and see if you can kill all processes before this test is run.
1. Manually delete the cache files at:
C:\Documents and Settings\\Local Settings\Application Data\javasharedresources
Now run .
2. If it does not work:
- set CLASSPATH to be empty by issuing a command line "set CLASSPATH=" and try starting using eclipse.exe/eclipse and delete cache again if it fails
- set PATH to "." by issuing command line "set PATH=." and try starting using eclipse.exe/eclipse and delete cache file if it fails
Increase the amount of virtual memory available on the system from the Windows settings (reboot machine to take effect) and also ensure the running the app has plenty of free space and their user profile is not size restricted. If a user's profile (C:\Documents and Settings\) has a space limitation set on it, the JVM may not be able to allocate space to cache.
***Save a copy of the "eclipse.ini" before making any changes ***
----------------------------------------
Final Try (for windows os)!!!
In the above method, it may help to set the environment variable 'Path' with the <jdk_install_path>\bin in the beginning of the path variable ("Note: we are NOT appending this value in the end").
The reason for doing this is because while installing few programs, the java executables (java.exe, javaw.exe...) gets installed under windows system folder. And as this occurs in the beginning of the 'Path' there can be jdk version mismatch, because of which eclipse doesn't startup.
This can be set in advanced tab of system properties dialog box.
eg., set path=c:\j2sdk1.4.2_05\bin;%path% and start eclipse.
----------------------------------------
Wiki: http://wiki.eclipse.org/Eclipse.ini
I.
1.) Go to where ever you extracted Eclipse
2.) Do you see any folders with the name of ".metadata"?
3.) If so, delete the following files:
\.metadata\.plugins\org.eclipse.core.resources\.sn ap
\.metadata\.plugins\org.eclipse.core.resources\.ro ot\.markers.snap
II.
1.) Look for any .log files present in the root directory of wherever you installed Eclipse? These give better idea of the problem.
III.
1.) Go to the Eclipse directory of where you installed it.
2.) Double click the eclipse.ini file to edit it.
3.) Find the following code:Code: --launcher.XXMaxPermSize
4.) Change it to:Code: -launcher.XXMaxPermSize Or, just remove that extraneous dash there.
5.) Save the file, re-open Eclipse.
IV.
1.) Go to the Eclipse directory of where you installed it (like the last two), and make a copy of eclipse.ini and paste it OUTSIDE of the Eclipse directory.E.g., for me, I have Eclipse installed at: C:\projects\tools\eclipse; I copy eclipse.ini into C:\.
2.) With the eclipse.ini in the eclipse directory, double click it to edit it, select all, delete all contents, save, and then try opening Eclipse again.
V.
1.) Download an unaltered, unmodified, and latest version of Eclipse and extract it anywhere, apart from where you previously extracted the instance of Eclipse you are using now, and start it up.
2.) If it exhibits the same symptoms as before, i.e. it doesn't start and shows the same error message, then there's something wrong somewhere, log files may help.
VI.
1.) Although this is IBM's Rational Software Development Platform, at its core, it's still Eclipse: http://www-1.ibm.com/support/docview...04%204rational
2.) Follow the instructions, linked above, and see if it works out for you.
----------------------------------------------------------------------
Make sure no eclipse or Java™ process is running in Task Manager, and see if you can kill all processes before this test is run.
1. Manually delete the cache files at:
C:\Documents and Settings\
Now run .
2. If it does not work:
- set CLASSPATH to be empty by issuing a command line "set CLASSPATH=" and try starting using eclipse.exe/eclipse and delete cache again if it fails
- set PATH to "." by issuing command line "set PATH=." and try starting using eclipse.exe/eclipse and delete cache file if it fails
Increase the amount of virtual memory available on the system from the Windows settings (reboot machine to take effect) and also ensure the running the app has plenty of free space and their user profile is not size restricted. If a user's profile (C:\Documents and Settings\
***Save a copy of the "eclipse.ini" before making any changes ***
----------------------------------------
Final Try (for windows os)!!!
In the above method, it may help to set the environment variable 'Path' with the <jdk_install_path>\bin in the beginning of the path variable ("Note: we are NOT appending this value in the end").
The reason for doing this is because while installing few programs, the java executables (java.exe, javaw.exe...) gets installed under windows system folder. And as this occurs in the beginning of the 'Path' there can be jdk version mismatch, because of which eclipse doesn't startup.
This can be set in advanced tab of system properties dialog box.
eg., set path=c:\j2sdk1.4.2_05\bin;%path% and start eclipse.
----------------------------------------
Wiki: http://wiki.eclipse.org/Eclipse.ini
Subscribe to:
Posts (Atom)
Learning programming
Programming is an interesting world where you apply your skills to build a software program that comes into life when it is run on a com...
-
While profiling one of my web services I was looking for an effective tool for load testing my web service. Initially thought of JMeter, bu...
-
In a multithreaded environment if the implementation is not perfect, then deadlocks are common scenarios. We can analyse the deadlocks by p...
-
Tomcat, a very familiar name in J2ee world. An excellent example of how open source is growing so powerful in the server domain. In Windows...