Jsp debugging

I'm using build 680 and Tomcat 4.0.6. I can debugg classes, EJB, but I can't debugg JSP. Debugger starts fine, my application is working but debugger does not stop at breakpoint in my JSP. I can debugg classes normaly. There is debugg information in my compiled JSP file.
Any ideas?

0
33 comments
Avatar
Permanently deleted user

JSP debugging works if Tomcat is started through WebApp run configuration.
Are you using this type of invocation or you debug by attaching to already
running Tomcat?

--

Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"


"dule" <dkrovinovic@volja.net> wrote in message
news:2346559.1037364136035.JavaMail.jrun@is.intellij.net...

I'm using build 680 and Tomcat 4.0.6. I can debugg classes, EJB, but I

can't debugg JSP. Debugger starts fine, my application is working but
debugger does not stop at breakpoint in my JSP. I can debugg classes
normaly. There is debugg information in my compiled JSP file.

Any ideas?



0
Avatar
Permanently deleted user

I'm using WebApp configuration and I'm starting Tomcat 4.0.6 in Idea.

0
Avatar
Permanently deleted user

What's the breakpoint icon?
If it is crossed, then it means there's no executable code at the
breakpoint's line.

--

Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"


"dule" <dkrovinovic@volja.net> wrote in message
news:4390896.1037430165150.JavaMail.jrun@is.intellij.net...

I'm using WebApp configuration and I'm starting Tomcat 4.0.6 in Idea.



0
Avatar
Permanently deleted user

Breakpoint is not crossed. I can put breakpoint on every line of my jsp file, but debugger won't stop.

0

I am having this same problem using Tomcat 4.0.6. The breakpoint icon may be a good indicator because while the server is running it will let me set a breakpoint on a non-executable line and doesn't display a crossed icon. I don't think there's a connection between the jsp file in the editor window and the jsp page running in tomcat.

Breakpoints set in any java code (jsp custom tags, struts action classes, etc) work fabulously, but I can't successfully get it to stop at a breakpoint in a jsp.

The other code is more important to me anyway, but jsp debugging would be nice.

---

Jeff Whitmire

0
Avatar
Permanently deleted user

Unfortunately we cannot guess what's wrong having the description that "it
doesn't work". Could you please create a "HelloWorld" project that
illustrates the problem and send the whole project to me for investigation?

--

Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"


"Jeff Whitmire" <jwhitmir@rochester.rr.com> wrote in message
news:2849263.1037687500421.JavaMail.jrun@is.intellij.net...

I am having this same problem using Tomcat 4.0.6. The breakpoint icon may

be a good indicator because while the server is running it will let me set a
breakpoint on a non-executable line and doesn't display a crossed icon. I
don't think there's a connection between the jsp file in the editor window
and the jsp page running in tomcat.
>

Breakpoints set in any java code (jsp custom tags, struts action classes,

etc) work fabulously, but I can't successfully get it to stop at a
breakpoint in a jsp.
>

The other code is more important to me anyway, but jsp debugging would be

nice.
>

---

>

Jeff Whitmire



0

I have tried creating simple projects for examples, but jsp debugging works fine when I do that. I'm wondering if there is something that could have evolved over a period of time in a fairly large project that could break jsp debugging.

Could it be that the jasper compiler is not generating debug info for some reason? Possibly using a different compiler?

I checked all the logs and could find no errors, and the application runs perfectly well, it just does not stop at any breakpoint in a jsp. I'm not able to duplicate it with a smaller application, but I will play with trying to ferret out a subset of my app that can reproduce the problem. If you have any suggestions, I'd be happy for any pointers.

Jeff.

0
Avatar
Permanently deleted user

I have the same problem as Jeff. For simple project jsp debugging works fine, but for a large project jsp debugging stop's working. I've looked into project properties
of both project (example and real app) and I think there is no difference.
debugging.

What could break jsp debugging? I'm using the same Tomcat configuration for my example as for my real app, so I think Tomcat works fine.There is also a debugg information in compiled jsp file.

0
Avatar
Permanently deleted user

Do all jsp breakpoints stop working or only some of them?

--

Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"


"dule" <dkrovinovic@volja.net> wrote in message
news:4188233.1037792468426.JavaMail.jrun@is.intellij.net...

I have the same problem as Jeff. For simple project jsp debugging works

fine, but for a large project jsp debugging stop's working. I've looked into
project properties

of both project (example and real app) and I think there is no difference.
debugging.

>

What could break jsp debugging? I'm using the same Tomcat configuration

for my example as for my real app, so I think Tomcat works fine.There is
also a debugg information in compiled jsp file.


0
Avatar
Permanently deleted user

All breakpints stop working. Here is my sample project.
Create context path /workers and run http://xxxx/workers/jsp/index.jsp.

I'm using build 681.



Attachment(s):
Sce-workers-managment.zip
0
Avatar
Permanently deleted user

Ok, I tried the attached project and set breakpoints in index.jsp.
They work ok for me. (using Tomcat 4.0.6)
Are you using the same Tomcat version?


Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"

"dule" <dkrovinovic@volja.net> wrote in message
news:7214617.1037803395373.JavaMail.jrun@is.intellij.net...

All breakpints stop working. Here is my sample project.
Create context path /workers and run http://xxxx/workers/jsp/index.jsp.

>

I'm using build 681.

>


0

I just tried the attached project in my environment, running 681 under Tomcat 4.0.6 and none of the breakpoints worked for me. It exhibited the same behavior as my app. I'm out of ideas as to what could be causing this, but happy to help in any way I can to fix it.

Jeff.

0
Avatar
Permanently deleted user

Yes I'm using Tomcat 4.0.6. I reinstall Idea and Tomcat 4.0.6 but jsp debugging still won't work.

I define new project from the begining, but nothing.

I'm using windows 2000 advanced server (is there a problem?).

On the same project jsp debugging was working somewhere between versions 650 and 660, but with the old 4.0 Tomcat. Now it's not working even with 4.0 Tomcat.

I've create my own jre folder for Idea (maybe I did something wrong?!). But I can't understand that when I create a very simple project with ony one jsp file debuging works fine, but with this project (which is very very small, only a few files) jsp debugging stop's working.
So I think that I didn't do something wrong with my installation or with windows or Tomcat.
I try to install Tomcat in directory Apache and then debuger can't find main class (bootstrap.jar) to run Tomcat. My current directory is now Apache Tomcat.

So these are the facts.
I will try and install exe version of idea in some differnt directory and we will see.

Thank's for your help.

0
Avatar
Permanently deleted user

I've noticed in your project paths to weblogic jars. Please remove them when
running project with Tomcat.
Could you pelease give more detail on the issue that debugger cannot find
the bootstrap.jar?

--

Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"


"dule" <dkrovinovic@volja.net> wrote in message
news:614552.1037862638460.JavaMail.jrun@is.intellij.net...

Yes I'm using Tomcat 4.0.6. I reinstall Idea and Tomcat 4.0.6 but jsp

debugging still won't work.
>

I define new project from the begining, but nothing.

>

I'm using windows 2000 advanced server (is there a problem?).

>

On the same project jsp debugging was working somewhere between versions

650 and 660, but with the old 4.0 Tomcat. Now it's not working even with 4.0
Tomcat.
>

I've create my own jre folder for Idea (maybe I did something wrong?!).

But I can't understand that when I create a very simple project with ony one
jsp file debuging works fine, but with this project (which is very very
small, only a few files) jsp debugging stop's working.

So I think that I didn't do something wrong with my installation or with

windows or Tomcat.

I try to install Tomcat in directory Apache and then debuger can't find

main class (bootstrap.jar) to run Tomcat. My current directory is now Apache
Tomcat.
>

So these are the facts.
I will try and install exe version of idea in some differnt directory and

we will see.
>

Thank's for your help.



0
Avatar
Permanently deleted user

I've removed all paths to weblogic.jar, but jsp debugging still won't work. But I need patht to weblogic.jar because of initial context factory, to call EJB from Tomcat. This is project for weblogic, but there is no plugging for weblogic or any other app server, so I'm trying to run web part of application on Tomcat and from Tomcat I'd like to call EJB's running on weblogic app server. I can remote debugg everything on weblogic execpt jsp. With web part of app running on Tomcat and bussines part of apllication running on weblogic I would have complete debuuging support for all parts of my application, even jsp.


Regarding bootstrap.jar. If I have Tomcat in folder Apache, debbuger can't start Tomcat, because it can't find main class org.apache.catalina.startup.Bootstrap with parameter start. I've tried with VM parameter classpath and with project classpath, but Tomcat did not start in any of this cases.

0
Avatar
Permanently deleted user

The bootstrap.jar is located by the tomcat integration plugin in the
CatalinaHome/bin directory. The only thing I guess why it is not found is
that CatalinaHome is specified incorrectly (or the jar is really missing
from the specified path :)

--

Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"


0
Avatar
Permanently deleted user

The CatalinaHome was specifed correct and there was a bootstrap.jar in that folder. I've checked twice.

So what about jsp debugging? I work for a company with 100 developers and I want to recommend my IT executive to buy Idea, but with no full debugging support I think that he'll not support my idea.

0
Avatar
Permanently deleted user

Eugene, if you remember last week or so I was wondering if Tomcat debugging with Tomcat 4.0.6 worked or not. There IS something very funky going on. I am experiencing this all the time. The symptom is that when you clik in the column the marker is just red dot. Nothing inside. It doesn't matter if I try to compile the JSP nothing changes, if I run the code it flies right past all the break points.

It's like the editor is not aware of the line numbers in the jsp file, and can therefore not put the break points in the proper spots.

What I think is happening is that the _scratch dir is not getting checked for the file.

I can get this to happen more consistently if I don't check off the box which says validate JSP before running. It seems to happen less then.

There seems to be no way to make a hello world example and duplicate consistently.

Also it doesn't matter which app server I debug with, it happens with either Tomcat or JBoss debugging.

Hope this helps.

0
Avatar
Permanently deleted user

Oh yeah I should also add that when things DO work right, my red dot in the editor turns into a dot with a check mark in it just as soon as I hit the jsp file.

0
Avatar
Permanently deleted user

Unfortunately I was not able to reproduce the bug in both Win XP and Win2000
environments.
What I did:
Unpacked build 681 as it is available in EAP in a clean directory. Unpacked
the bundled JRE to IDEA installation directory. Nothing was changed in the
idea.bat file.
Tomcat 4.0.6 was installed in "D:\apps\Apache Tomcat" directory.
In order to start the project you sent I have added the corresponding
context in Tomcat's server.xml:
Opened the project in IDEA and added a breakpoint at line 41 in the file index.jsp. Also added j2ee.jar (version 1.3.1) to the project's classpath. Adjusted CatalineHome in the "sce-webapp" WebApp run configuration to point on my Tomcat installation. No other modifications were made to a project. Pressed "Debug" button and started Tomcat. In a browser invoked the url: http://localhost:8080/workers/jsp/index.jsp This launched the application, breakpoint's icon was changed to a checkmark and debugger stopped at the breakpoint I added. Could you please check that in the "C:\Documents and Settings\%USERNAME%\.IntelliJIdea\system\" a directory with the name like this is created: "tomcat_Sce-webapp_34e28f07\work\_scratchdir\" while Tomcat is running? In this scratch dir the JSP pages you access should compiled. The generated java code should have line-mapping comments like these: // HTML // begin [file="/jsp/index.jsp";from=(0,57);to=(1,0)] out.write("\r\n"); out.write(""); // end // HTML // begin [file="/jsp/index.jsp";from=(1,26);to=(2,0)] out.write("\r\n"); out.write(""); // end -- Best regards, Eugene Zhuravlev JetBrains, Inc, http://www.intellij.com "Develop with pleasure!" "dule" ]]> wrote in message
news:5025220.1037873478514.JavaMail.jrun@is.intellij.net...

The CatalinaHome was specifed correct and there was a bootstrap.jar in

that folder. I've checked twice.
>

So what about jsp debugging? I work for a company with 100 developers and

I want to recommend my IT executive to buy Idea, but with no full debugging
support I think that he'll not support my idea.


0
Avatar
Permanently deleted user

I followed your instructions from the begining and I have line-mappings comments in compiled index.jsp file in _scratchdir/jsp.

But jsp debbuging won't work.

I will be watching this topic, maybe will someone find the solution.

Thank's for your help.

0
Avatar
Permanently deleted user

Eugene, yes the directory is there. Every time. I actually HAVE to sometimes look in the directory to see what the heck JSP:319 line error might mean in a compiled JSP. So it's there for sure, even when the debugging doesn't work right, the file is there, and the line numbers are in the JSP file too. I don't think it's a java/class compile issue.

I am taking a shot in the dark here, but it MAY be an issue with Tomcat's class loader/reloader. I reported last week that I was getting an error on the command line after compiling a class which said that the FooClass was missing. I was told it was the Tomcat class loader.

Is it at all possible that Tomcat is not properly reloading the JSP class file after compile? I can tell you with 100% certainty that the jsp file is in fact compiled and reupdated since I have it open in text pad to look at the line, and textpad tells me that it needs to reload it.

It's a very bizarre issue for sure, but it DOES happen.
R

0
Avatar
Permanently deleted user

I've never used JSP debugging before and decided to help Eugene to reproduce
the issue. I've configured everything without his help and all breakpoints
work! Please look at my steps & try to find any difference.

My steps (Windows XP):

0. Made a clean installation of build #676 (wiped all configs)
1. I extracted zip file from this thread into "C:\Documents and
Settings\mike\.IntelliJIdea\myprojects\Sce-workers-managment"
2. Downloaded jakarta-tomcat-4.0.6-LE-jdk14.zip and extracted it to
"C:\Documents and
Settings\mike\.IntelliJIdea\myprojects\Sce-workers-managment\jakarta-tomcat-
4.0.6-LE-jdk14"
3. Added set JAVA_HOME=c:\jdk1.4.1_01 to tomcat's setclasspath.bat file &
made test tomcat start.
4. Added ]]>
to server.xml
5. Started IDEA & opened the project
6. Removed j2ee.jar reference from project properties and pointed it to
local j2ee jar with the following manifest:

Manifest-Version: 1.0
Specification-Title: J2EE Specification
Specification-Vendor: Sun Microsystems, Inc.
Created-By: 1.3.0 (Sun Microsystems Inc.)
Implementation-Vendor: Sun Microsystems, Inc.
Specification-Version: 1.3
Implementation-Version: 1.3.1



7. Toggled breakpoint at index.jsp:13 (Object value =
req.getAttribute("index");)
8. Set catalina home to C:\Documents and
Settings\mike\.IntelliJIdea\myprojects\Sce-workers-managment\jakarta-tomcat-
4.0.6-LE-jdk14 in run configuration. Catalina configs were altered
automatically.
9. Pressed Debug
10. Opened http://localhost:8080/workers/jsp/index.jsp in IE.

Voi la. Breakpoint works.

--
Best regards,
Mike Aizatsky.
-


JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"


"dule" <dkrovinovic@volja.net> wrote in message
news:4077888.1037961486610.JavaMail.jrun@is.intellij.net...

I followed your instructions from the begining and I have line-mappings

comments in compiled index.jsp file in _scratchdir/jsp.
>

But jsp debbuging won't work.

>

I will be watching this topic, maybe will someone find the solution.

>

Thank's for your help.



0
Avatar
Permanently deleted user

Mike is there a reason why you put the tomcat install under the .IntelliJ directory? That seems a bit odd. Is that some kind of documented thing we're supposed to do?

Also just because 1 jsp works it doesn't reflect a real development environment. As you can see from my notes that some times I CAN debug and get stops on break points and sometimes I can't. it's not consistent. I know there is a user on here who can't debug at all, but that's not my and other's case. We CAN debug, but sometimes we don't get stops on break points and the break point icon is just a red circle with nothing in it.

0
Avatar
Permanently deleted user

Well I know now why debugger did't stop at breakpoint in jsp. My compiled jsp has a name 0002fjsp002f_index_jsp.java(class). I think correct name is index$jsp.java(class). I've changed Tomcat intergation pluggin and my debugger now stops at breakpoint.

But now I have another problem. My debugger stops, but there is no debugg info. It's unavailable.

Can anyone tell me why?

Best regards by Dule

0
Avatar
Permanently deleted user

Could you please describe the changes you made to TomcatIntegration plugin?

Concerning the second problem: please check that in temporary directory
where your web app is running (it is created in IDEA's system directory)
there are jsp-generation related settings like these:

jsp org.apache.jasper.servlet.JspServlet ............................ classdebuginfo true ................... Notice the "classdebuginfo" parameter. It should be set to "true". -- Best regards, Eugene Zhuravlev JetBrains, Inc, http://www.intellij.com "Develop with pleasure!" "dule" ]]> wrote in message
news:4386852.1038045032605.JavaMail.jrun@is.intellij.net...

Well I know now why debugger did't stop at breakpoint in jsp. My compiled

jsp has a name 0002fjsp002f_index_jsp.java(class). I think correct name is
index$jsp.java(class). I've changed Tomcat intergation pluggin and my
debugger now stops at breakpoint.
>

But now I have another problem. My debugger stops, but there is no debugg

info. It's unavailable.
>

Can anyone tell me why?

>

Best regards by Dule



0
Avatar
Permanently deleted user

Classdebuginfo parameter is set to true. I don't think that's a problem.

My compiled index.jsp file is compiled into 0002fjsp002f_index_jsp.java(class) under Tomcat running through Idea. Normaly it's compiled into index$jsp.java.

So I just changed TomcatJspDebugSupport.java, because it uses just files with xx$_jsp (indexOf), so I add that this class now recognize my file(_0002fjsp_002f_index_jsp.java) too. If I have only one jsp file in a project it is compiled into xx$jsp.java(class) file and debug info is available. I think it's available because the file name is xxxx$jsp.class and not 0002fjsp002f_xxxx_jsp.class).

0
Avatar
Permanently deleted user

Hi,

Same phenomena ..., though things never DO work right.
Impossible to set a valid breakpoint (only red dot),
- btw, in my case mouse-click doesn't work, only Ctr-F8 perhaps another problem -
Every breakpoint so set is skipped on debug !
System :
Windows NT 4
IDEA build 686
Tomcat 4.0.6
I'm looking for some help

Ivan

0
Avatar
Permanently deleted user

Tomcat running through Idea have to compile your jsp file into xxx$jsp.java(class) file. Look under .InetelliJIdea folder. TomcatIntegration plugin only recognize xxx$jsp.java files. If your Tomcat compiles jsp files with different names you have to change your TomcatIntegration plugin.

Well I did this and breakpoints work, but there is no debugg info available.

0
Avatar
Permanently deleted user

It is very strange that Tomcat generates files with different names. And I really have no clue how to force it to do this...The
project you sent to this thread compiles withthe "normal" names here on different machines and OSes.
Do you remember if you changed some options in Tomcat configuration that control this behaviour?

--

Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"

"dule" <dkrovinovic@volja.net> wrote in message news:5686900.1039164875571.JavaMail.jrun@is.intellij.net...

Tomcat running through Idea have to compile your jsp file into xxx$jsp.java(class) file. Look under .InetelliJIdea folder.

TomcatIntegration plugin only recognize xxx$jsp.java files. If your Tomcat compiles jsp files with different names you have to
change your TomcatIntegration plugin.
>

Well I did this and breakpoints work, but there is no debugg info available.



0

Please sign in to leave a comment.