Debugging ArcObjects using Eclipse IDE


Summary
The state of ArcObjects when executing ArcGIS Engine Java applications can be traced in Eclipse's integrated development environment (IDE) debug mode. This topic discusses the steps to debug ArcObjects in the Eclipse IDE. Install Eclipse ArcGIS plug-ins to enable this feature in the Eclipse IDE.

In this topic


About debugging ArcObjects using Eclipse IDE

In the Eclipse debug perspective, the variables view represents the state of an object in the current stack frame of the program being debugged. In general, the ArcObject Java classes are only proxies to the underlying Component Object Model (COM) ArcObjects; therefore, in the variables view, the state representation of an ArcObject is only reflective of the details that make up the proxy object and not the actual state of the ArcObject beneath the proxy.
State representation of ArcObjects
The following screen shot shows the state representation of the point ArcObject p in the variables view:
Such state representation of ArcObjects fails to provide any valuable insight into the underlying ArcObject and is less helpful in reasoning through a workflow while debugging. To overcome this issue, the ArcGIS plug-in allows you to switch to the logical representation of the ArcObjects by enabling the Show Logical Structure icon in the variables view or expressions view. The logical representation presents more comprehensible information about the underlying ArcObject's current state to the developer.
Logical representation of ArcObjects
The following screen shot shows the logical representation of the point ArcObject p as seen in the variables view. The logical representation of the point object p exposes more reasonable details to the developer, such as its x,y,z coordinates. The developer can also switch to the raw representation of the ArcObjects by disabling the Show Logical Structure icon.
     
Exception messages
It is also common to notice in the logical representation of ArcObjects, some values of the variables are expressed as exception messages, such as "Exception Occurred: com.sun.jdi.InvocationException occurred invoking method."
These exception messages indicate the specific variables of ArcObjects are not initialized at the current context of the program being debugged. For example, in the following screen shot, the x,y,z variables of the ArcObject point p have not been initialized. Hence, the value of the variables is expressed as an exception in the variables view.
When values are initialized, as is the case in the next step of the program, the values of the x,y,z coordinates could be seen accordingly (instead of the exception messages).






Development licensingDeployment licensing
Engine Developer KitEngine
ArcGIS for Desktop BasicArcGIS for Desktop Basic
ArcGIS for Desktop StandardArcGIS for Desktop Standard
ArcGIS for Desktop AdvancedArcGIS for Desktop Advanced