- This topic has 6 replies, 2 voices, and was last updated 19 years, 8 months ago by Riyad Kalla.
-
AuthorPosts
-
YellowDogMemberOS: WinXP Pro, Service Pack 2
IDE: Eclipse 3.0.1
MyEclipse: Version 3.8.3
Servlet Container: Tomcat 4.1.3When I set a breakpoint for my Struts web app, I can’t see all the data in the Variables view.
When execution reaches the breakpoint, the display switches to the Debug perspective as expected, with the breakpoint line selected in the editor view. As I step into / over succeeding statements, the variables in those statements don’t appear in the Variables view. There ~are~ variables there, and they’re related to app being executed, but I don’t need to see their values. Also, if I select a variable and “inspect” it via the context menu, I get a “cannot be resolved” message. I’ve double-checked and the correct thread is selected in the Debug view. This behavior is not what I’m used to, but I can’t think of any radical changes I’ve made to the environment to cause this. I’ve been away from Eclipse development for awhile. Am I missing something elementary?
Riyad KallaMemberYou need JSR 45 spec for full debugging support, so that means atleast Tomcat 5 in this case. With 4.1 I’m surprised the debugging is working, but it will be flaky.
YellowDogMemberOK, that makes sense. The last time I successfully used debugging I was working with Tomcat 5. Now I’m moving this app downlevel to eventually target an Oracle 9i app server. Thanks.
YellowDogMemberI’m still experiencing problems seeing variables in the Debug perspective.
Note: I’m debugging a class file, not a JSP.
This is a Struts app. All of my action classes descend from a common ancestor – BaseAction, where I define an execute method. All action classes run this method – none overrides it. I put a debug breakpoint at the first executable statement in BaseAction. When the code hits the breakpoint, I can see the method’s method parameters in the Variables view, but as I step through the code, none of the succeeding variables I encounter appears in the view. If I Inspect (from the context menu), I get “cannot be resolved”. This behavior is the same whether or not I run the code in Tomcat 4 or 5.
I have another workspace with a project that has a similar codebase, but not identical. If I debug from that workspace (using either Tomcat 4 or 5), I can succussfully use the debugging functions. Moreover, if I debug ~that~ project from the “faulty” workspace, I can succussfully debug. So I guess I’ve isolated the problem to the specific code build as opposed to any runtime workbench settings.
What I’ve done so far is examine the relevant settings between the two workspaces. These are Windows -> Preferences -> Java -> Compiler, Windows -> Preferences -> Java -> Debug, and Windows -> Preferences -> Run/Debug. I’e made sure that all settings on all tabs are identical.
What other settings that affect the debugging profile of a project can I look at? Are there other areas I should examine – libraries, build paths, etc?
Riyad KallaMemberVery strange… what JDK version are you using torun Eclipse and Tomcat with? The latest version of 1.4.2 will give you the best results. Also make sure you run both Eclipse and Tomcat with the same JDK for the most accurate debugging, that can also cause issues when two different VMs are trying to talk to eachother (technically it shouldn’t, but it does).
Also try rebuilding and redeploying your project, sometimes that helps.
YellowDogMemberBoth Eclipse and Tomcat are running 1.4.2. I re-built the project manually (within Eclipse) and re-deployed, but it didn’t make any difference with the debugging situation. Then I examined my build path and noticed that I had a user library higher up in the list than the Java internal libraries (Java Build Path -> Order and Export). I positioned my user libray last and waited for the automatic rebuild to finish. Then I re-deployed and tried it again. Success! – for the time being at least, because I notice that in the “good workspace” the the build order is not what it should be either. My next step is to build a .war file from a proper ant script. Can I do that – create a .war file built from an ant script, drop it in Tomcat, and expect to debug it from the Eclipse / MyEclipse environment?
Riyad KallaMemberI positioned my user libray last and waited for the automatic rebuild to finish. Then I re-deployed and tried it again. Success! – for the time being at least, because I notice that in the “good workspace” the the build order is not what it should be either.
Well this is the strangest thing I’ve heard all week, but I am sure glad you got it working. I suppose it depends on what was in the user library that was positioned above the JRE…
My next step is to build a .war file from a proper ant script. Can I do that – create a .war file built from an ant script, drop it in Tomcat, and expect to debug it from the Eclipse / MyEclipse environment?
Yes this is possible, but MyEclipse will make you a WAR file one of two ways. 1) Change your deployment to “packaged”, this will create a WAR file. 2) Use File > Export > WAR.
If you still want to use an Ant script be sure to compile the Java source files with debugging turned on, then after you run Tomcat you will need to connect to your Tomcat instance to debug it using remote debugging, see this guide: http://myeclipseide.com/enterpriseworkbench/help/index.jsp?topic=/com.genuitec.myeclipse.doc/html/quickstarts/remotedebugging/index.html
-
AuthorPosts