You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Upayavira <uv...@upaya.co.uk> on 2003/10/08 12:45:37 UTC

Eclipse debugging (was Re: [GT2003] Thank you)

Antonio Gallardo wrote:

>Sylvain Wallez dijo:
>  
>
>>Yep. I was amazed by the number of people coming to me after my Woody
>>presentation, asking questions, proposing enhancements, use cases, etc.
>>This is a real need, and we seem to have a real solution now.
>>    
>>
>
>Yep. We need boost the woody development. :)
>
>Many people is needed the woody implementation (we are in the row too!).
>Currently, we are having problems related to Flow+Woody+OJB it just stall.
>Today we will do a little research trying to find the error.
>
>We need to do a demo on friday morning and I don't know if this will work
>at all. :-0
>
>Desafortunately, we dont know how to start cocoon in debug mode under
>eclipse. If someone can write a doc about this, please do it. This will
>for sure help us in finding where the bug is.
>  
>
Start Cocoon with cocoon  servlet-debug (instead of just cocoon servlet)

Then, in eclipse, select run/debug...
Click remove java application, then new at the bottom.
Select your cocoon project. Click apply/debug.

Set a breakpoint in your code. Request a page with your browser from 
port 8888, and you should see eclipse catch the breakpoint.

Upayavira

>Also, I don't know if I can touch the woody code, I requested permision
>before, but nobody give us a green light for that. I promise not broke the
>current code :)
>
>We already developed a very simple squeleton (a dir structure) for the
>proposed "business objects". Inside every "business object" is a generic
>sitemap.xmap that handle the forms that manage the "business object". This
>generic sitemap then can be literaly copied to every new businnes object.
>
>The idea (as I posted before) is to allow a kind of plugin of the business
>objects inside cocoon. We are almost ending a usecase of that, but still
>there is the problem related to a stall while calling OJB inside flow. :(
>
>I know this is not to said: "Wow". But maybe it can show a usecase or best
>practices to use woody+flow+OJB.
>
>We need also integrate the authentication framework inside the squeleton.
>(To be done).
>
>Best Regards,
>
>Antonio Gallardo.
>
>
>
>
>  
>



Re: Eclipse debugging (was Re: [GT2003] Thank you)

Posted by Upayavira <uv...@upaya.co.uk>.
Steve K wrote:

> Upayavira wrote:
>
>> Start Cocoon with cocoon  servlet-debug (instead of just cocoon servlet)
>>
>> Then, in eclipse, select run/debug...
>> Click remove java application, then new at the bottom.
>> Select your cocoon project. Click apply/debug.
>
>
> The way I've been debugging cocoon is by extending the CocoonWrapper 
> class and adding a slightly different version of the processURI() 
> method that returns the status rather than throwing a 
> ProcessingException on failure.  Then I have a Main class (actually, 
> it is a ExcaliburTestCase class) that does the following:

One small point. The CocoonWrapper, while it does do what you need, is 
not intended to be a public interface, and, after discussions at the 
GetTogether, could change or be removed. I'd suggest you use (and extend 
if necessary) the CocoonBean, which after all has the same functionality.

> ----
>
> CocoonTester cocoon = new CocoonTester();
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
>
> cocoon.setContextDir("src/webapp");
> cocoon.setLogKit("src/webapp/WEB-INF/debug-logkit.xconf");
> cocoon.setLogger("stream");
> cocoon.initialize();
>
> cocoon.processURIStatus("test/", baos);
> System.out.println(baos.toString());

Looks simple enough. Have you tried requesting a view? E.g.:
cocoon.processURIStatus("test/?cocoon-view=links", baos);

Does that work? If it does, that means that you can access the XML as it 
passes through your pipeline by just requesting specific views. If it 
doesn't work, then it needs fixing.

> Note that CocoonTester is my subclass of CocoonWrapper, and 
> debug-logkit.xconf is a modified version of the regular cocoon 
> logkit.xconf that uses the stream target to log everything to System.out.

It all looks surprisingly neat and simple.

> This is the beginnings of my effort to come up with a way to start 
> unit testing cocoon pipelines.  It is easier than dealing with remote 
> debugging, and dumping all the logs to the console is helpful as well. 
> I'm looking into a way to send requests to cocoon using the 
> SitemapSource rather than cocoon.process() to request a page since I'd 
> like to get back SAX events rather than bytes.

Hmm. That would be a bit of a challenge. Why would sax events help you?

Regards, Upayavira


Re: Eclipse debugging (was Re: [GT2003] Thank you)

Posted by Steve K <sh...@mm.st>.
Upayavira wrote:
> Start Cocoon with cocoon  servlet-debug (instead of just cocoon servlet)
> 
> Then, in eclipse, select run/debug...
> Click remove java application, then new at the bottom.
> Select your cocoon project. Click apply/debug.

The way I've been debugging cocoon is by extending the CocoonWrapper 
class and adding a slightly different version of the processURI() method 
that returns the status rather than throwing a ProcessingException on 
failure.  Then I have a Main class (actually, it is a ExcaliburTestCase 
class) that does the following:

----

CocoonTester cocoon = new CocoonTester();
ByteArrayOutputStream baos = new ByteArrayOutputStream();

cocoon.setContextDir("src/webapp");
cocoon.setLogKit("src/webapp/WEB-INF/debug-logkit.xconf");
cocoon.setLogger("stream");
cocoon.initialize();

cocoon.processURIStatus("test/", baos);
System.out.println(baos.toString());

----

Note that CocoonTester is my subclass of CocoonWrapper, and 
debug-logkit.xconf is a modified version of the regular cocoon 
logkit.xconf that uses the stream target to log everything to System.out.

This is the beginnings of my effort to come up with a way to start unit 
testing cocoon pipelines.  It is easier than dealing with remote 
debugging, and dumping all the logs to the console is helpful as well. 
I'm looking into a way to send requests to cocoon using the 
SitemapSource rather than cocoon.process() to request a page since I'd 
like to get back SAX events rather than bytes.

cheers,
-steve


Re: [SUMMARY] How-to debug cocoon with eclipse

Posted by Upayavira <uv...@upaya.co.uk>.
Great.

Antonio Gallardo wrote:

>Thank you Upayavira. It works.
>
>Antonio Gallardo
>
>Upayavira dijo:
>  
>
>>Antonio Gallardo wrote:
>>    
>>
>>>Desafortunately, we dont know how to start cocoon in debug mode under
>>>eclipse. If someone can write a doc about this, please do it. This will
>>>for sure help us in finding where the bug is.
>>>      
>>>
>>Start Cocoon with cocoon  servlet-debug (instead of just cocoon servlet)
>>
>>Then, in eclipse, select run/debug...
>>Click remove java application, then new at the bottom.
>>Select your cocoon project. Click apply/debug.
>>
>>Set a breakpoint in your code. Request a page with your browser from
>>port 8888, and you should see eclipse catch the breakpoint.
>>
>>Upayavira
>>    
>>
>
>
>
>
>  
>



[SUMMARY] How-to debug cocoon with eclipse

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Thank you Upayavira. It works.

Antonio Gallardo

Upayavira dijo:
> Antonio Gallardo wrote:
>>Desafortunately, we dont know how to start cocoon in debug mode under
>> eclipse. If someone can write a doc about this, please do it. This will
>> for sure help us in finding where the bug is.
>
> Start Cocoon with cocoon  servlet-debug (instead of just cocoon servlet)
>
> Then, in eclipse, select run/debug...
> Click remove java application, then new at the bottom.
> Select your cocoon project. Click apply/debug.
>
> Set a breakpoint in your code. Request a page with your browser from
> port 8888, and you should see eclipse catch the breakpoint.
>
> Upayavira