Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Tools / May 2004

Tip: Looking for answers? Try searching our database.

Sysdeo/Eclipse Debugging

Thread view: 
Craig - 13 Apr 2004 18:04 GMT
For anyone using the Sysdeo Tomcat plugin with Eclipse 2.1:

I'm having 2 problems with debugging JSPs.  First, when the JSP source
file is in the root of the project, I can set break points in the
resulting .java file and have it break just fine, but the source file
seems to be disjointed from the break.  The .java file line isn't
hightlighted.  Pressing the "Step Over" button doesn't advance to the
next line in the editor, etc.

Second, when the JSP source file is not in the root of the project but
in a subfolder, again I can set the break just fine in the resulting
.java file, but I get a message that the source can't be found.  I've
applied the Tomcat Jasper patch on Sysdeo's web site.

Eclipse 2.1.3
Tomcat 4.0.6
Sysdeo 2.2.1
Jasper Debug Patch 4.0.4

-Craig
Craig - 14 Apr 2004 17:13 GMT
I've also updated my Tomcat 4.0.6 web.xml file with the following per
advice from other posts:

   <init-param>
     <param-name>classdebuginfo</param-name>
     <param-value>true</param-value>
   </init-param>

This had no effect though on the problems listed above.  However, I
think this did allow me to see the variables under Eclipse.

I should also state that in the Eclipse debugger under scenario one, I
see the line numbers incrementing in the thread window as I press the
Step Over button.  The .java file just doesn't keep synchronized.
Stian Bakken - 19 Apr 2004 14:06 GMT
Make sure that you have selected the correct project(s) under
Preferences->Tomcat and Preferences->Tomcat->Source Path. If you have more
than one implementation of the class on the classpath, you may run into
trouble like the one you described with the Sysdeo plugin.

Godspeed,
Stian

> I've also updated my Tomcat 4.0.6 web.xml file with the following per
> advice from other posts:
[quoted text clipped - 10 lines]
> see the line numbers incrementing in the thread window as I press the
> Step Over button.  The .java file just doesn't keep synchronized.
Craig - 20 Apr 2004 15:36 GMT
Stian,

I have only one project in Eclipse, which contains only one JSP file
(and no classes, etc.).  The project is checked in both of the places
you mentioned.

I've tried this with all combinations of Eclipse 2.1.2, 2.1.3, and JDK
1.4.2, 1.3.1, and Sysdeo Tomcat Plugin 2.2 and 2.2.1.

If I follow everything in the instructions to the letter, create a
launch config, start Tomcat with the Debug Config "Tomcat 4.0.x",
launch my JSP, refresh the work folder so I can see the .java file,
set a break point, and then rerun the JSP, I get a popup dialog box
asking where the source is for the class.  If I leave "Use default"
checked, I get an editor window displayed for "_jspService" which
contains in red text:  "Source not found for
test$jsp._jspService(HttpServletRequest, HttpServletResponse) line: 54

I can see that the break point was reached and the thread stopped at
line 54 where I set the breakpoint in the .java file, but the debugger
can't seem to locate the file.

If I launch Tomcat using the normal run button, I something a little
different -- I get an editor window displayed for "test$jsp.class"
which contains the text:

Class File Editor
Source not found
There is no source file attached to the class file test$jsp.class

Again, I see in the threads that the break point was reached and
stopped properly at the break point I set on line 54 of the .java
file.

Also, I'm using Tomcat 4.0.6 -- should this be a problem?

-Craig
Craig - 04 May 2004 20:17 GMT
Aha - some progress...

I read in a posting in an eclipse.org newsgroup that someone else had
this problem, and upgrading to Tomcat 4.1.x fixed it.

And it fixed it for me too.

The Sysdeo plug-in has a problem debugging JSPs under Tomcat 4.0.x (at
least 4.0.6).

I wonder if this has to do with the fact that the compiled .class and
.java file under 4.0.x has a "$" in the name (e.g. test$jsp.java),
whereas 4.1.x has "_" (e.g. test_jsp.java).

Unfortunately, we really need to use 4.0.6 since we're using a third
party tool which only supports 4.0.6.

Help!!

-Craig
Sebastian Millies - 06 May 2004 11:35 GMT
Maybe it's possible to use a later version of jasper with
Tomcat 4.0.6 and precompile your JSPs. Or precompile
them with the precompiler of Tomcat 4.0.6 and then rename
them. (Tomcat doesn't care what the classes are called, AFAIK)
The precompiling could be done in an Ant task.
-- Sebastian

> Aha - some progress...
>
[quoted text clipped - 16 lines]
>
> -Craig
Craig - 20 May 2004 23:05 GMT
All,

Just to end this -- its looks like I had installed the Tomcat "patch"
classes in the wrong directory structure.  I wasn't paying too much
attention to this since the doc indicated this is really just for JSPs
not in the root of your web app, but in fact its needed any time to
debug JSPs.  Once I fixed the patch install problem, everything
started working.

Another thing -- I assume its normal for the debugger to not highlight
the line being executed in the .java file.  The thread indicates what
line is being executed, so its not that big of a deal to follow along,
but I expected the debugger to keep in sync.  It did under WSAD 5.0
when debugging .java and .jsp files.

Thanks for the help,
-Craig


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.