- This topic has 5 replies, 2 voices, and was last updated 21 years, 4 months ago by Bob Edmonston.
-
AuthorPosts
-
Bob EdmonstonMemberIs it possible to use MyEclipse to debug a Web App that wasn’t deployed with MyEclipse? Here is the situation – I have an existing app I am inheriting that does not conform to the directory structure required to use the MyEclipse deployment and synchronization features. I do have an Eclipse project and build using ANT/Eclipse and manually deploy the war to my WL 7 Server. My question is – since I am starting my WL domain with MyEclipse and the project and source are within an Eclipse project, is it possible to debug my JSP and Servlets using the debugging capabilities of MyEclipse? Thanks for any insights.
support-michaelKeymasterYes this should work. Remember to have Ant compile Java classes with debug enabled. Also instruct WLS to compile your JSP’s with debugging enabled, (i.e., in the weblogic.xml) for JSP debug support.
Michael
MyEclipse Support
Bob EdmonstonMemberA follow up question – this morning I tried setting some breakpoints in the code to see if I could debug the aforementioned project. I couldn’t set the breakpoints however. When I tried clicking in the margin or manually selecting the “Add Breakpoint” menu item, no breakpoint would appear. The project is a standard project – not a Java project. Could this be what is tripping me up?
Bob EdmonstonMemberOkay – I tried making a Java project and then importing all of the files from the old project and then I was able to set breakpoints. The execution of the app didn’t stop however when I expected. What I don’t understand is how will the debugger know to break? If the app is running and is just a war file out in my WL’s applications directory, how will MyEclipse recognize that connecction between my current java project and the war file that contains the classses that are being run if MyEclipse didn’t do the deployment? Hope that is clear because I am a little confused here about how MyEclipse is working.
support-michaelKeymasterThe execution of the app didn’t stop however when I expected. What I don’t understand is how will the debugger know to break? If the app is running and is just a war file out in my WL’s applications directory, how will MyEclipse recognize that connecction between my current java project and the war file that contains the classses that are being run if MyEclipse didn’t do the deployment?
Good question! During the appserver launch process MyEclipse uses the Eclipse debug infrastructure to set itself up as a remote debugging client of the appserver’s JVM. This is all handled under the covers by the Eclipse Java Debug Interface (JDI) which is a JDK 1.4 standard interface for debug clients to connect to a JVM’s JPDA. When the remote JVM loads a class it will send class-load events to Eclipse which in turn sends back to the JVM all of the breakpoints you have set on those classes (that is when the checkmark is added to the breakpoint decorator in the JDT or JSP editors). When the appserver JVM hits a breakpoint it notifies Eclipse. The Eclipse debug framework then opens the editor and positions the current line to the breakpoint. I simplified this discussion for brevity purposes.
The most likely explanation for your situation is that the source code is not compiled with debug information (assuming that your launching the appserver from within MyEclipse). Verify that you are doing this in your ant script, its easy to omit. Also inspect the breakpoint in the editor just after the code has been executed. If the breakpoint does not have a checkmark on it, assume it as not been loaded into the remove JVM because either debug info is not included in the compiled class or Eclipse and the JVM are not communicating.
I hope this gives you a little more background into how Eclipse debugging works and an action that I hope resolves you problem. Please keep us posted on your outcomes.
Michael
MyEclipse Support
Bob EdmonstonMemberThank you! I have it working now, all I did was import the files as a web module project and everything seemed to work – not sure why. Thanks also for the nice explanation of how debugging works with MyEclipse – very informative stuff.
-
AuthorPosts