cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist <>
Subject Re: Running Cocoon in debugger
Date Thu, 04 Jan 2007 20:23:52 GMT

On Jan 4, 2007, at 11:35 AM, Lars Huttar wrote:

> 09:42:46.355 WARN!!
> org.mortbay.util.MultiException[org.xml.sax.SAXParseException: 
> Document root element "web-app", must match DOCTYPE root "null".]
>        at org.mortbay.http.HttpServer.start(
>        at org.mortbay.jetty.Server.main(
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> ...
>        at Source)
>        at Loader.main(Unknown Source)
> 09:44:51.166 EVENT  Started HttpContext[/]
> The WARN is nothing new, I think, so I've been ignoring it... maybe I 
> shouldn't be??

It's not normal, see below...

> Any idea what document is failing to parse?

It's a file like the webdefaults.xml that is shipped in 
tools/jetty/conf (probably that very file, if you are using cocoon.bat 
or whatever, starting Jetty from the Cocoon distibution —  HTH...

This error message is relevant, and so is the line that follows:

	09:44:51.166 EVENT  Started HttpContext[/]

It should look instead like this:

	11:52:06.987 EVENT  Started WebApplicationContext[/,./webapp]

The log message that you are getting meants that Jetty is not finding 
something like tools/jetty/conf/main.xml, and that is what is causing 
Jetty to display the page that says "No context on this server matched 
or handled this request".

> I was going to try raw jdb as a simplest case, to see if it worked;

You could, and it would, but you would then just have a very 
unsatisfactory debugging environment.

> if so then I could work up to getting Eclipse configured to work with 
> Cocoon.

It's not really "working up to", because being able to debug it w/ jdb 
is not on the path to getting to the happy place where you are 
debugging it with Eclipse.

> Or am I mistaken in thinking that you can debug Cocoon without Eclipse?

You can, but... :-(

You can also eat a liter of pickled herring in one sitting.  I'm sure 
that is also possible, physically.

>> 2. Eclipse must only know about sources of your application and Cocoon
>> to debug happy your applications. It does not care about your configs
>> etc. You just have to import Cocoon as project into Eclipse's 
>> workspace
>> and create project for your java classes and set-up necessary
>> dependencies  on jars. That's all.
> That's good to know. I figured you could probably debug Cocoon in 
> Eclipse without having a SVN working copy of Cocoon, but the 
> instructions at assume you 
> check Cocoon out of SVN.

Yes, that's a problem with those instructions... they are targeted at 
Cocoon developers who are debugging Cocoon proper (vs. a Cocoon-based 
application).  The aspects of "debug with Eclipse" and "set up Eclipse 
for your Cocoon trunk SVN working area" are conflated (our "separation 
of concerns" is not so good there... I remember going down that path 
trying to learn this too :-)

> I'm not familiar with Eclipse so was reluctant to spend time figuring 
> out how to do it independent of the instructions. E.g. it seems 
> non-trivial to learn how to specify where all the jar files are, and 
> all the source code, etc. Are there instructions anywhere on how to do 
> this?

I don't have much time right now to hunt around for it, but... there 
are ant targets to build the .project and .classpath files for Eclipse, 
  I just don't know if those were added in Cocoon 2.1.7.  You know, now 
that I think of it, I'm sure that those targets are in 2.1.7.  Troll 
the list archives and I'm sure you'll find what you're looking for, or 
maybe someone else here will just remember off the top of their head...

> I guess I will have to bite the bullet and learn Eclipse if I want to 
> use Eclipse to debug Cocoon.

A little bit, yes.  But that learning is well worth it.  This is from a 
former reluctant Eclipse learner :-). I was like, "vim is my IDE" ;-).  
I didn't want to deal with the learning curve and dragged my feet on 
the Eclipse thing, but I can tell you... do yourself a favor and take a 
day to learn the basics of Eclipse, it will pay you back well...

Anyway — as I understand it, (a) you have this problem where Jetty 
doesn't start up right when you do the "cocoon.bat servlet-debug", and 
(b) you haven't actually tried debugging Jetty+Cocoon in Eclipse yet, 
you're still trying to figure out (a).  Right?  I see you have sent a 
couple more emails since I started this one, so maybe you have it 
figured out by now.  If not: what happens when you do plain old 
"cocoon.bat servlet"?  Do the log messages look right in the case, and 
do you see good things when you browse to the webapp site root?  Or 


View raw message