- This topic has 20 replies, 3 voices, and was last updated 18 years ago by
Riyad Kalla.
-
AuthorPosts
-
SydneyOsMemberI am wanting to debug my web application, and have got so far as:
1. WebTools installed
2. Tomcat installed
3. Launch configuration for Tomcat created (all defaults)However, according to some tutorials and demos I’ve seen, I think I’m supposed to have a Debug on Server option when I right click a JSP. I don’t. If I just do a straight Debug, Tomcat starts but no web page launches and no breakpoints are hit. I feel I must be missing a step.
Thanks for your help.
Loyal WaterMemberMake sure you are doing the following:
1) Running MyEclipse and Tomcat with atleast a JDK 1.4 or later.
2) The MyEclipse Tomcat connector is setup to launch Tomcat in debug mode, not Run mode.If you have done all of that and none of it has helped, try shutting down Tomcat, removing your deployment, cleaning/rebuilding your project, then going to your debug perspective, selecting the Breakpoints view, right clicking and selecting Remove All, then restarting MyEclipse using the -clean command line argument. Then recreate your project deployment, set a break point and run it, did it work?
SydneyOsMemberThanks. How do I “clean and rebuild” my project?
Loyal WaterMemberSelect your project and go to Project > Clean to clean the project and incase Build Automatically is not checked go to Project > Build Project to build the project.
SydneyOsMemberAfraid not. I have the Debug As:
1. Javascript Application
2. Debugoptions only if I right click the JSP. Under no Debug menu do I ever see Debug on Server.
Is a browser supposed to launch, or is there something I need to do to specify this?
Also, these might just be version issues, but I don’t have a “Project Explorer” as shown in some demos – I have a Package Explorer.
Also, the jre for MyEclipse is not the one in the JDK directory – not sure if that makes a difference.
I have a Global Forward configured for my login page.
Thanks for your help.
Riyad KallaMemberSydney,
I believe this is some confusion here between WTP and MyEclipse. Do you have both of them installed? If so, this is going to be a fairly confusing learning experience as both can provide overlapping menu items that look to be the same and you won’t be sure where which one is comming from.I would suggest settling on either WTP or MyEclipse. If you decide to stick with MyEclipse, definately go through our Web Project beginner guide here. It shouldn’t take more than 20mins (maybe 10?) and covers all the basics of how functionality works in MyEclipse:
http://www.myeclipseide.com/images/tutorials/quickstarts/webprojects/
SydneyOsMemberI’m sure you are right about that – I would like to go with MyEclipse – is there something I need to uninstall (e.g., the WebTools)? I do believe I have only been using the MyEclipse menus where possible.
Loyal WaterMemberI suggest for the cleanest experience, you should uninstall WebTools and MyEclipse and reinstall using the MyEclipse *All In One* installer to a new directory and reopen your workspace.
Please note that project types in MyEclipse are different, so you may need to re-create them.
SydneyOsMemberWill do – can I use JDK 6.0? I see the documentation says 1.4 or 1.5, but I’d like to have the latest version.
Loyal WaterMemberEclipse hasn’t been certified on JDK 6. There are some known issues with it and we are woking them in the 3.3 code stream. So, I would advise you to stick to 1.5 / 1.4 only for now.
Riyad KallaMemberNipun is correct. I’d also like to add that the version of Java you use to actually run MyEclipse, has no bearing on the version of Java you want to use to develop your project in. The 2nd (which I believe is what you are asking about?) is controlled in your project properties under the Java Compiler settings.
SydneyOsMemberOkay, I uninstalled MyEclipse and the JDK (just for kicks) and Tomcat.
Following the instructions in: http://myeclipseide.com/enterpriseworkbench/help/index.jsp?topic=/com.genuitec.myeclipse.doc/html/quickstarts/webprojects/index.html:
Installed JDK 1.5
Installed MyEclipse SDK 3.2.2
Installed Tomcat 6.0According to the documentation (http://myeclipseide.com/enterpriseworkbench/help/index.jsp?topic=/com.genuitec.myeclipse.doc/html/quickstarts/webprojects/index.html), I think my install was correct the first time – I had been creating MyEclipse Web Projects, but I never had a .myeclipse folder or .mymetadata file and I still don’t, even when creating a new Test project.
Is this a problem?
Riyad KallaMemberAny dot file is hidden in the package explorer view, you would have to switch to Navigator to see them.
SydneyOsMemberGreat. Thanks.
Now, I have JSP debugging working – here’s the step I was missing. In addition to having a breakpoint set in your JSP, you have to manually launch IE and run the page. I’m used to working in an environment where debugging launches the browswer for you. Simple.
However, I am not hitting breakpoints in my Action or ActionForms though they look good in the struts-config file. The last debug lines are:
16:04:21,328 DEBUG BeanUtils:792 – BeanUtils.populate(com.gensa.struts.form.LoginForm@18706f6, {password=[Ljava.lang.String;@10dd4c8, username=[Ljava.lang.String;@10cafa1})
16:04:21,328 DEBUG BeanUtils:873 – setProperty(com.gensa.struts.form.LoginForm@18706f6, password, [])
16:04:21,343 DEBUG ConvertUtils:369 – Convert string ” to class ‘java.lang.String’
16:04:21,343 DEBUG ConvertUtils:377 – Using converter org.apache.commons.beanutils.converters.StringConverter@1e8fa70
16:04:21,343 DEBUG BeanUtils:873 – setProperty(com.gensa.struts.form.LoginForm@18706f6, username, [])
16:04:21,343 DEBUG ConvertUtils:369 – Convert string ” to class ‘java.lang.String’
16:04:21,343 DEBUG ConvertUtils:377 – Using converter org.apache.commons.beanutils.converters.StringConverter@1e8fa70
16:04:21,343 DEBUG RequestProcessor:940 – Validating input form properties
16:04:21,359 DEBUG RequestProcessor:945 – No errors detected, accepting input
16:04:21,359 DEBUG RequestProcessor:305 – Looking for Action instance for class com.gensa.struts.action.LoginAction
16:04:21,359 DEBUG RequestProcessor:322 – Creating new Action instanceAt this point I have radio silence from the output.
This is odd for the following reasons:
1. I entered invalid data
2. My breakpoint in the setUsername is not being hit
3. My breakpoint in the ActionForm.validate function is not being hit nor is the log.debug… statement outputting anything
4. My breakpoint in the LoginAction.execute function is not being hit nor is the log.debug… statement outputting anythingAgain, I’m guessing this is something painfully simple to the experienced MyEclipse user and/or Struts programmer.
Any thoughts much appreciated.
Thanks
Riyad KallaMember1) Are you launching Tomcat from within MyEclipse? Did you double check that Window > Prefs > MyEclipse > App Servers > Tomcat 5 > Launch is set to launch in debug mode?
2) Are you building and deploying your app from inside MyEclipse or using ant?
3) If you go under Project Properties > Java Compiler, are the debugging symbols (all at the bottom) getting compiled into your source code?
-
AuthorPosts