- This topic has 13 replies, 5 voices, and was last updated 20 years, 8 months ago by Riyad Kalla.
-
AuthorPosts
-
sabithaMemberIts unable to me to debug the Jsp program.
Please tell me the procedure to Debug
Thanks in advance
srini
Riyad KallaMembersrini,
First you need to get version 5 of Tomcat, because debugging requires a application server supporting the JSR-045 spec. You can grab that here:
http://mirrors.xtria.com/apache/jakarta/tomcat-5/v5.0.18/bin/jakarta-tomcat-5.0.18.exe (note: I’m assuming you are on windows).
Also I suggest you install Tomcat into a directory that is fairly short, like C:\Tomcat or C:\Tomcat 5Now load MyEclipse, go to Window>Preferences>Java>Installed JREs
and select your JRE and click edit. You now need to change the “JRE home directory” to point to a JDK that is installed on your computer. You CANNOT develop with Tomcat if you are using just a JRE, you must install a JDK on your machine. Anyway once you point this “JRE” installation at your JDK, hit OK.Then you will need to download MyEclipse and install it (I’m assuming you’ve done this). Then you will need to setup your Tomcat application server in MyEclipse, you do that by going to:
Window>Preferences>MyEclipse>Application Servers>Tomcat 5In this page you will want to set the home directory of Tomcat, for example, to C:\Tomcat (or whereever you installed it to). Then you want to click the JDK node, and select the JRE you configured as JDK from the dropdown list (it is probably already selected for you). Then click the “Launch” node and make sure that “debug mode” is selected.
NOW, you need to setup a deployment for your project and deploy it. After you have done that, you can set breakpoints that your app will stop on and MyEclipse will take you to the source code.
hafeziMemberHi,
I am a new starter (concerning JSP and MyEclipse plagin) and am trying to set a breakpoint in a very simple JSP file, but if I try this (using mouse button right in JSP editor), I get only two choices: Add Bookmarks , Add Task (no set breakpoint or something like that). I guess that I have not the right setting for JSP editor or some other wrong configuration setting.
I am using:
Windows 2000,
eclipse 2.1.1,
MyEclipse_Enterprise_Workbench_v2.7-RC2 and tomcat 5.0 and
j2sdk1.4.2_02.Any helps or hints will be highly appreciated.
thanks,Ali
Scott AndersonParticipantAli,
First, make sure you’re opening the JSP file with our JSP editor. Once open, you should be able to double-click in the margin to set a breakpoint.
Riyad KallaMemberYes, Ali setting a breakpoint in a JSP page is just like using the Java Editor. You double click in the left margin on the left side of the editor window. You will then see a little blue dot with a check mark in it. That means “Breakpoint set OK”.
Alban MALABOUCHEMemberHello everybody.
I have the saime trouble, MyEclipse (3.6) do not stop on JSP breakpoints. But everything’s ok for the java breakpoints !!!!
Tomcat 5.0.18, under windows. Any other idea would really be appreciate ???
Thanks.
Riyad KallaMemberAlban,
Please reply to this post and hit the “Insert” button and fill out the system information. Based on what versions (exact) of software/jdk/etc. you are running, it could be different causes.A few quick things:
1) You need JDK 1.4 for full debugging support. Preferably 1.4.1 series
2) You need an app server that supports JSR 45, which you have (Tomcat 5)
3) Do you get a green check mark ontop fo the blue dot when you set breakpoints in your JSP pages?
Alban MALABOUCHEMember– System Setup ——————————-
Operating System and version: Windows 2000 Pro SP4
Eclipse version: 3.0M6
Eclipse build id: 200312182000
Fresh Eclipse install (y/n): y
If not, was it upgraded to its current version using the update manager?
Other installed external plugins: none
Number of plugins in the <eclipse>/plugins directory that begin with org.eclipse.pde.*: 8
MyEclipse version: 030700RC2
Eclipse JDK version: c:\j2sdk1.4.2_02
Application Server JDK version: c:\j2sdk1.4.2_02
Application Server : Tomcat 5.0.19 (Same as 5.0.18 which also don’t debug JSP)
Are there any exceptions in the Eclipse log file? No (looking for *log*.* in eclipse dir)
– Message Body ——————————-Riyad,
Answers to your questions :
=> 1 : Cf System Setup
=> 2 : Cf System Setup
=> 3 : When i set breakpoints, the only thing i can see is the blue dot in the margin. I can’t see any green checkmark anywhere.
Thanks for all,Alban
Alban MALABOUCHEMember—
Riyad KallaMemberAlba, if you right click on a JSP file and click on “Open With”, is the default editor MyEclipse JSP Editor?
Also, when you installed Eclipse, you installed the Eclipse SDK, not the JDT right? (just want to make sure)
Alban MALABOUCHEMemberYes for the two questions.
But i just created a new HelloWorld project, the same as this one provide with the tutorial.
And for this one it works well.
But for my big struts project none. I have sub-directories for putting jsp’s but this configuration works well too in the HelloWorld mini-project.
The arrow shows the breakpoint place.Here is one of my jsp.
Could it be a missing import ???
(But the jsp works well …..!!!????)<%@ page language=”java” %>
<%@ page errorPage=”error.jsp” %>
<%@ page import=”dori.jasper.engine.*” %>
<%@ page import=”dori.jasper.engine.util.*” %>
<%@ page import=”dori.jasper.engine.export.*” %>
<%@ page import=”java.util.*” %>
<%@ page import=”java.io.*” %>
<%@ page import=”javax.sql.DataSource” %>
<%@ page import=”java.sql.Connection” %>
<%@ page import=”java.sql.SQLException” %>
<%@ page import=”org.apache.struts.Globals” %><% Connection conn = null;
➡ DataSource dataSource = (DataSource) getServletContext().getAttribute(Globals.DATA_SOURCE_KEY);
conn = dataSource.getConnection();
(…)
Riyad KallaMemberAlban,
Does your jsp page have an underscore in the name, OR is it located in a directory with an underscore in the name OR is the page located under the WEB-INF directory? We have had reports of problems with these situations, but fixed them all for 2.7 GA.
Alban MALABOUCHEMemberCongratulation !!!!!!!
It Works !!!!
Indeed, it simply was the name of the JSP’s => genere_html, genere_pdf, …… which contains all an underscore !!!!!!
But in the path of the files i didn’t have any underscore (WebRoot/forms/genere_html.jsp)
Really thanks a lot !!!
😀 😀
Alban, Paris
Riyad KallaMemberHey that’s great, I’m glad it worked! The new GA release of MyEclipse (comming out Friday) will fix this problem, so you don’t need to rename every file in your project. Sorry for the trouble, but thank you for your patience!
-
AuthorPosts