...
creating a new project with cvs co of module 'sakai' from cvs.sakaiproject.org works well for getting the whole project to compile, but it does not do well for debugging,editing, and deploying using J2EE plugins (nor JSF plugins). Ideally, each submodule of the sakai module would be a seperate eclipse project. Ultimately, I want to be able to modify, and deploy changes on a submodule (tool) level.
You can check out each submodule as a seperate project by selecting the whole list (28 folders, or so) in the cvs browser and selecting the radio button to make indiv projects. But, eclipse uses the module name for the projects and not the project's .project file.
...
Code Block | ||
---|---|---|
| ||
#!/bin/tcsh
foreach file ( `find . -name .tomcatplugin -exec dirname {} \; | awk -F'/' '{print $NF}'` )
sed -i.bak -r "{s/<warLocation>.*<\/warLocation>/<warLocation>\/usr\/local\/tomcat\/webapps\/sakai-$file.war<\/warLocation>/}" \
./$file/.tomcatplugin
sed -i.bak2 -r "{s/<webPath>.*<\/webPath>/<webPath>\/sakai-$file.war<\/webPath>/}" \
./$file/.tomcatplugin
end
foreach file ( `find . -name .project -print` )
sed -i.bak3 -r \
"{s/(\s+)(<nature>org.eclipse.jdt.core.javanature<\/nature>)/\1\2\n\1<nature>com.sysdeo.eclipse.tomcat.tomcatnature<\/nature>/}" $file
end
|
... be sure to change the \/usr\/local\/tomcat (the '/' chars are necessary additions) reference to match your tomcat install.
Debugging with Remote Tomcat
- Start tomcat using
Code Block catalina.sh jpda start
- Inside eclipse select Run->debug....select Remote Java Application and click 'New...'
- Give the new debug config a name like 'Testing'
- Set the host and port (default on tomcat is 8000), choose an eclipse project by using the browse button
- source locations should be already be set to project source locations, so shouldn't need to change anything
- Checkmark the 'Allow temination of remote VM'
- click close and save changes
Test it out
- Open the VarunaServlet.java file and scroll to the doGet() method
- double-click in the left margin (or use another method) to set a break-point near the beginning of the method
- select Run->Debug... and select the newly created debug config.
- change to the debug perspective if it does not happen automagically.
- switch to a browser and login into to the sakai instance
.... since basically all requests are being sent throught the portal webapp, the login should freeze.
- switch back to eclipse. The breakpoint line should be highlighted.