Further info needed - how do I debug JSPs with Tomcat and IDEA v3?

Having had guidance from the assembled brains here I can now get IDEA to
debug with Tomcat via a remote connection - though still have not found
any way to do it locally - but it does not work with JSPs.

IDEA allows me to set breakpoints in JSPs, but does anyone have any idea
how to get the debugger to work with Tomcat? Loca or remote - I can live
with either.

JDL

5 comments
Comment actions Permalink

It seems that the only way to debug JSP is through local debugging.
You have to create a "WebApp" configuration and debug that one. I
just copied the main Tomcat config file, server.xml, to the
'config\tomcat' subfolder under IDEA's root folder.

JSP debugging is working fine in scriplet blocks and to some
extent even in HTML blocks. While debugging HTML blocks every
now and then it will just jump out from the JSP page and back
to the controller that invoked it.

Marius


John Lagrue wrote:

Having had guidance from the assembled brains here I can now get IDEA to
debug with Tomcat via a remote connection - though still have not found
any way to do it locally - but it does not work with JSPs.

IDEA allows me to set breakpoints in JSPs, but does anyone have any idea
how to get the debugger to work with Tomcat? Loca or remote - I can live
with either.

JDL



0
Comment actions Permalink

Marius Scurtescu wrote:

It seems that the only way to debug JSP is through local debugging.
You have to create a "WebApp" configuration and debug that one. I
just copied the main Tomcat config file, server.xml, to the
'config\tomcat' subfolder under IDEA's root folder.

JSP debugging is working fine in scriplet blocks and to some
extent even in HTML blocks. While debugging HTML blocks every
now and then it will just jump out from the JSP page and back
to the controller that invoked it.

Marius


So what incantations are required to get a local tomcat working?

When I attempt to debug locally I get an error from the VM:

"VM initialization failed for C:/Java/j2sdk1.4.0_01\bin\javaw.exe
-classpath ........."

The console shows:

java.lang.NoClassDefFoundError: Tomcat
Exception in thread "main"

In short: tomcat refuses to start via IDEA. I have no problems at all
starting it myself.

Interestingly, I try to "Run" rather than "Debug" then absolutely
nothing happens at all! No errors, but no webserver either.

I am increasingly frustrated by this. The must be someone out there
who's got TC running under IDEA!

JDL

0
Comment actions Permalink

I'm with you John.

I have 'sort of' got the Tomact engine to work by replacing IntelliJ's
server.xml file with the one from from my local 4.0.4 installation .
However, I have not yet succeeded in getting it recognise an application
context and if I specify a direct url to a jsp I get compile errors saying
it can't find the classes specified in the jsp's import statements. This is
all using code that has successfully been deployed to Tomact servers both
locallly and remote. However, I did get a very simple web app to work okay -
which is strange. I may be wrong but one of the problems seems to be that it
seems to be relying on the output classe path to be the same as the source
path definition which is maybe why it worked with the simple test and not my
real app.

I too have been very frustrated trying to get this to work.

- Arif


"John Lagrue" <jlagrue@checkfree.com> wrote in message
news:3D578A75.2050108@checkfree.com...

Marius Scurtescu wrote:

It seems that the only way to debug JSP is through local debugging.
You have to create a "WebApp" configuration and debug that one. I
just copied the main Tomcat config file, server.xml, to the
'config\tomcat' subfolder under IDEA's root folder.

>

JSP debugging is working fine in scriplet blocks and to some
extent even in HTML blocks. While debugging HTML blocks every
now and then it will just jump out from the JSP page and back
to the controller that invoked it.

>

Marius

>

So what incantations are required to get a local tomcat working?

>

When I attempt to debug locally I get an error from the VM:

>

"VM initialization failed for C:/Java/j2sdk1.4.0_01\bin\javaw.exe
-classpath ........."

>

The console shows:

>

java.lang.NoClassDefFoundError: Tomcat
Exception in thread "main"

>

In short: tomcat refuses to start via IDEA. I have no problems at all
starting it myself.

>

Interestingly, I try to "Run" rather than "Debug" then absolutely
nothing happens at all! No errors, but no webserver either.

>

I am increasingly frustrated by this. The must be someone out there
who's got TC running under IDEA!

>

JDL

>


0
Comment actions Permalink


WEll, I finally managed to get Tomcat 4.0.4 running through IDEA. It turned
out that I needed to take the spaces out of the directory path to the
installation of Tomcat 4.

This is somewhat unfortunate as the default directory as defined by
Apache is "Apache Tomcat 4.0.4" and Tomcat itself works fine with this.
So what's IDEA doing wrong?

Anyway: having got it running, I still can't use it :( How does IDEA
propose to set the project's CLASSPATH into Tomcat? As far as I can see,
it doesn't. All my JSPs fail to compile.

Any ideas?

JDL

0
Comment actions Permalink

Further to my last note: I also need to add -Dfoo=bar switches to the
JVM for Tomcat. Is this possible with IDEA ?

JDL




0

Please sign in to leave a comment.