How do I debug JSP pages with Aurora 963 and Tomcat 5.0?

I'm using the Linux .tar.gz version of 963 with the JRE from 944.

I'm new to JSP debugging in IDEA so it's entirely possible
I'm missing something obvious...

<http://www.intellij.net/tracker/idea/viewSCR?publicId=17821>
says that build 963 has plugins for Tomcat 5.0 and JSR45.

I see the Tomcat one in the Plugin Manager but don't see
the JSR45 one. idea.jar does contain various JSR45JspDebugSupport
classes though.

IDEA launches Tomcat 5.0.12 OK and I can debug servlets, but
support for debugging JSP pages isn't there for me.

Thanks for any help.

16 comments

Mark,

The TOmcat 5 Plugin itself makes a call to the JSR45JspDebugSupport. As
a matter of fact from what I see the Tomcat 5 plugin is like 10 lines of
code, and it reuses the Tomcat 4 parameters etc... So when you start up
Tomcat 5 in debug mode there should be debugging for Tomcat 5 using
JSR45, and that looks like it's the only difference between the Tomcat 4
and Tomcat 5 plugins.

You say that you get servlet debugging, but you say not JSP debugging,
can you describe what you did? Did you setup your project as a webapp,
and define the webapp directory properly?

R

Mark Scott wrote:

I'm using the Linux .tar.gz version of 963 with the JRE from 944.

I'm new to JSP debugging in IDEA so it's entirely possible
I'm missing something obvious...

<http://www.intellij.net/tracker/idea/viewSCR?publicId=17821>
says that build 963 has plugins for Tomcat 5.0 and JSR45.

I see the Tomcat one in the Plugin Manager but don't see
the JSR45 one. idea.jar does contain various JSR45JspDebugSupport
classes though.

IDEA launches Tomcat 5.0.12 OK and I can debug servlets, but
support for debugging JSP pages isn't there for me.

Thanks for any help.


0

On Tue, 04 Nov 2003 07:57:05 -0500, Robert S. Sfeir wrote:

Thanks for the reply, Robert.

The TOmcat 5 Plugin itself makes a call to the JSR45JspDebugSupport. As
a matter of fact from what I see the Tomcat 5 plugin is like 10 lines of
code, and it reuses the Tomcat 4 parameters etc... So when you start up
Tomcat 5 in debug mode there should be debugging for Tomcat 5 using
JSR45, and that looks like it's the only difference between the Tomcat 4
and Tomcat 5 plugins.


From that last sentence it seems I may not have understood that Tomcat had
to be started in debug mode - but see comments later.

You say that you get servlet debugging, but you say not JSP debugging,
can you describe what you did? Did you setup your project as a webapp,
and define the webapp directory properly?


Well, I did nothing any differently than with Tomcat 4.0.6 (maybe that's
the problem, of course).

With 4.0.6, I added a new context to server.xml with path=/idea-test and a
docBase pointing to the test document root (i.e. to the dir containing
WEB-INF).

I set up webapp support for a new test project, configured like this :

Application server: Tomcat 4.0.x Server
Debuggee host: localhost
Debuggee port: 5050
Launch server before debugger attaches: yes

Catalina home: /jakarta-tomcat-4.0.6 Catalina conf: /jakarta-tomcat-4.0.6/conf App context path: /idea-test (it appeared in the list) (all the context paths defined in server.xml appeared in the listboxes). Debugging the webapp allowed me to set breakpoints in a JSP source file and they worked as expected. On switching to 963 I reconfigured the webapp and changed these three parameters : Application server: Tomcat 5.0 Server Catalina home: /jakarta-tomcat-5.0.12 Catalina conf: ]]>/jakarta-tomcat-5.0.12/conf

I removed all libraries referring to 4.0.6 and replaced them with 5.0.12.
Now debugging a servlet works as before, but debugging a JSP does nothing
at all - any breakpoints that are set are ignored. The JSP breakpoints
don't show a tick (in the red circle icon) like the servlet ones do.

I've since tried 5.0.14 and seen no difference. I've also tried launching
Tomcat manually under JPDA (i.e. `catalina.sh jpda start`) and making a
socket connection from IDEA - again, no difference.

One unexpected thing with 5.0 - the first request for the JSP gave a 500
internal error about no compiler being present and suggesting that I copy
/lib/tools.jar from the j2sdk to $CATALINA_HOME/common/lib. This fixed
that particular problem. Running Tomcat standalone didn't require this.

I admit more or less complete ignorance of the Java debugger. I don't
know if this is down to configuration ignorance on my part or perhaps a
Linux problem. Any further help gratefully received.

0

I did mainly the same as you (converting a 4.0.6 application to 5.0) - and I can't debug JSPs either.

Beside of that I do have another problem: If I start Tomcat in the debugger everything works fine (apart from debugging JSPs). But when I run Tomcat without the debugger I get this message:

SEVERE: The scratchDir you specified: C:\java\aurora\system\tomcat_xxx\work\_scratchdir is unusable.

As a consequence Tomcat fails to load the compiled JSP class, but compilation works correctly. Does anybody have an idea what's going wrong?

Sorry for being slightly off topic, but maybe my problem is related to yours.

0

Yep, I see the same thing, but I haven't dug into why that is. We need
to open an SCR for this, Mark you want to do that since you started the
thread?

R

Martin Fuhrer wrote:

I did mainly the same as you (converting a 4.0.6 application to 5.0) - and I can't debug JSPs either.

Beside of that I do have another problem: If I start Tomcat in the debugger everything works fine (apart from debugging JSPs). But when I run Tomcat without the debugger I get this message:

SEVERE: The scratchDir you specified: C:\java\aurora\system\tomcat_xxx\work\_scratchdir is unusable.

As a consequence Tomcat fails to load the compiled JSP class, but compilation works correctly. Does anybody have an idea what's going wrong?

Sorry for being slightly off topic, but maybe my problem is related to yours.


0

On Tue, 04 Nov 2003 11:57:15 -0500, Robert S. Sfeir wrote:

Yep, I see the same thing, but I haven't dug into why that is. We need
to open an SCR for this, Mark you want to do that since you started the
thread?


Done (assuming SCR means a bug in the IDEA Bugs Tracker...) :

"#20400- Cannot debug JSP pages running in Tomcat 5.0"

<http://www.intellij.net/forums/thread.jsp?forum=13&thread=52012&tstart=0&trange=15#615878>

(It's a little confusing that I don't see the build/platform info that I
entered.)

--
Mark Scott

0

I found the problem about the unusable scratchdir: the Tomcat plugin removes and re-creates the Tomcat base directory to make sure it is empty. Therefore the scratchdir doesn't exist (and isn't usable...). Later when Tomcat compiles JSPs the scratchdir gets created, but apparently that's too late for the class loader.

I'm not sure if that's a bug of Tomcat or of the Tomcat plugin (JetBrains: please investigate), but at least I get it working by modifying the Tomcat plugin such that it creates the scratchdir before launching Tomcat. I attach the modified plugin if anybody is interrested (but I don't take any responsibility for it...).

Astonishingly when starting Tomcat in debug mode the Tomcat plugin creates the scratchdir after connecting the debugger.



Attachment(s):
tomcatIntegration.jar
0

Unfortunately this doesn't seem to help with your original problem, Mark. Debugging still doesn't work. So apparently the two problems aren't related. Therefore I opened a new bug (http://www.intellij.net/tracker/idea/viewSCR?publicId=20487) for my problem.

0

On 2003/11/04 18:42, Mark Scott wrote:

<http://www.intellij.net/forums/thread.jsp?forum=13&thread=52012&tstart=0&trange=15#615878>

(It's a little confusing that I don't see the build/platform info that I
entered.)


To see the build and platform info look in the tracker. Your link
pointed to the forum mirroring messages entered in the tracker.
http://www.intellij.net/tracker/idea/viewSCR?publicId=20400

Bas

0

Add Tools.jar to your JDK setup and try again.

R

Martin Fuhrer wrote:

Unfortunately this doesn't seem to help with your original problem, Mark. Debugging still doesn't work. So apparently the two problems aren't related. Therefore I opened a new bug (http://www.intellij.net/tracker/idea/viewSCR?publicId=20487) for my problem.


0

Add Tools.jar to your JDK setup and try again.


That's not the point. My JSPs are compiled correctly. But Tomcat fails to load the compiled classes because the _scratchdir directory is missing on startup. In debug mode (where the _scratchdir directory gets created by the Tomcat plugin) everything works (except setting breakpoints in JSPs).

0

On Wed, 05 Nov 2003 13:07:58 +0000, Martin Fuhrer wrote:

Unfortunately this doesn't seem to help with your original problem,
Mark.


Never mind. BTW, I don't see (on Linux) the problem you describe.

--
Mark Scott

0

On Wed, 05 Nov 2003 14:11:14 +0100, Bas Leijdekkers wrote:

To see the build and platform info look in the tracker. Your link
pointed to the forum mirroring messages entered in the tracker.
http://www.intellij.net/tracker/idea/viewSCR?publicId=20400


Aha! Thanks for that. I'd mistakenly come to the conclusion that new
bugs were posted to the forum and only made it onto the tracker if they
were somehow considered worthy.

--
Mark Scott

0

Am i right, none of you succeded to stop at breakpoint while debugginng JSPs?

0

On Thu, 06 Nov 2003 12:13:30 +0000, Alexei Nikitin wrote:

Am i right, none of you succeded to stop at breakpoint while debugginng JSPs?


Speaking for myself, yes, you're right. I understand that's also true for
Martin & Robert.

--
Mark Scott

0

Am i right, none of you succeded to stop at
breakpoint while debugginng JSPs?


Yep, for me that's true. When clicking on the gutter to set a breakpoint I see some CPU activity for about one or two seconds, but nothing happens, i.e. the breakpoint remains unchecked (and the debugger doesn't stop there). I can debug servlets and custom tags, but not JSPs.

0

Doesn't work with Tomcat 4 either (4.0.6), and I've filed an SCR with
the problems with Tomcat 4, it seems to now require that we have the
docBase pointing to our actual project directory! That's bad, it didn't
used to be like that.

R

Alexei Nikitin wrote:

Am i right, none of you succeded to stop at breakpoint while debugginng JSPs?


0

Please sign in to leave a comment.