You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Leszek Gawron <ou...@vip.net.pl> on 2003/03/09 15:33:39 UTC

Some results on cocoon debug attempt

I tried to debug some cocoon parts. Here is what I achieved. I would be
grateful for any feedback. The attempt were made on WinXP

The easiest way to run cocoon set up with remote debugging is to run
"cocoon.bat servlet-debug"

and now: 
1. JSwat 2.3:
	a) attach to cocoon 
	b) set source path to :
		- {cocoon-cvs-home}\src\java
		- {your-win-profile}\Local Settings\Temp\Jetty__8888__\cocoon-files
	c) if you want to debug cocoon core:
		- set breakpoint providing:
			- class name
			- line number/method name
	d) if you want to debug xsp:
		- run it at least once to have .java file generated
		- browse class hierarchy (there is a special view for that in jSwat),
		  select the appropriate class and place a breakpoint
	e) hit the page you want to debug in a browser - the execution will stop at
		breakpoint
	f) now you can run your code by steps. source browser will show you the
	current position

	Everything works quite fine but jSwat functionality is not enough for us.
	So lets switch to:
2. Eclipse
	a) do "build eclipse-project"
	b) edit {cocoon-cvs-home}\build\webapp\WEB-INF\web.xml to change the
		location of cocon temporary files. All you have to do is to uncomments
		this section:
		<init-param>
	    	  <param-name>work-directory</param-name>
			  <param-value>WEB-INF/work</param-value>
		</init-param>
		You have to have all source files to be placed relatively from your
		project home.
	c) Run eclipse
	d) do File -> Import and point to your cocoon directory
	e) be patient ... :)
	f) add additional source path: {cocoon-cvs-home}\build\webapp\WEB-INF\work
	g) prepare new remote debug configuration (choose your current project so
		eclipse will be able to resolve sources)
	h) attach to cocoon VM
	i) browse your project for appropriate class, open the source file and set
		a breakpoint in a place you want to.
	j) hit the page - wait for breakpoint to be triggered
	k) eclipse will open a source file and from now on you can step through
	the code.

Everything would be fine but Eclipse does not want to work with XSP generated
java files properly. When first run the .java file is being generated from xsp
so from now on it is visible from eclipse IDE. You can compile it (if you add
all cocoon libraries to your project), you can also set a breakpoint. The
execution will be stopped at breakpoint but you will get a message that
eclipse cannot find source for this class. I've tried any combination and
still eclipse is not aware of the source. It works for any other classes
though (not generated).

Does anyone have some experience with eclipse?
	ouzo
-- 
            __
         | /  \ |        Leszek Gawron            //  \\
        \_\\  //_/      ouzo@vip.net.pl          _\\()//_
         .'/()\'.     Phone: +48(600)341118     / //  \\ \
          \\  //  recursive: adj; see recursive  | \__/ |


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org