Re: Running Cocoon in debugger
On 1/5/2007 9:44 AM, Lars Huttar wrote: On 1/4/2007 3:31 PM, Mark Lundquist wrote: On Jan 4, 2007, at 1:28 PM, Lars Huttar wrote: [snipped] When this is all over, you will be well-qualified to write the "Debugging Cocoon Applications in Eclipse on Windows" document :-) By the way, where should I write this? I was going to start by adding some detail to http://wiki.apache.org/cocoon/DebuggingCocoon, but the page seems to be "immutable" for some reason. Lars Never mind, it was only "immutable" because I wasn't logged in. :-p Lars - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On 1/4/2007 11:49 PM, Mark Lundquist wrote: On Jan 4, 2007, at 8:49 PM, Lars Huttar wrote: Many thanks, Grzegorz and Mark! I've tried to get Cocoon running in Eclipse a number of times in the past, and now it's finally there. Awesome! :-) Next step is to figure out how to use this to trace data flow through the sitemap. You might take a look here: http://cocoon.apache.org/2.1/userdocs/concepts/profiler.html or, oftentimes just turning on debug-level logging in logkit.xconf provides enough information in the log file... then you can see what pipelines are getting invoked. Thanks, that looks helpful too. Lars - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On 1/4/2007 3:31 PM, Mark Lundquist wrote: On Jan 4, 2007, at 1:28 PM, Lars Huttar wrote: [snipped] When this is all over, you will be well-qualified to write the "Debugging Cocoon Applications in Eclipse on Windows" document :-) By the way, where should I write this? I was going to start by adding some detail to http://wiki.apache.org/cocoon/DebuggingCocoon, but the page seems to be "immutable" for some reason. Lars - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Running Cocoon in debugger
-Original Message- From: Mark Lundquist [mailto:[EMAIL PROTECTED] Sent: 05 January 2007 05:49 To: users@cocoon.apache.org Subject: Re: Running Cocoon in debugger On Jan 4, 2007, at 8:49 PM, Lars Huttar wrote: > Many thanks, Grzegorz and Mark! I've tried to get Cocoon running in > Eclipse a number of times in the past, and now it's finally there. Awesome! :-) > Next step is to figure out how to use this to trace data flow through > the sitemap. You might take a look here: http://cocoon.apache.org/2.1/userdocs/concepts/profiler.html or, oftentimes just turning on debug-level logging in logkit.xconf provides enough information in the log file... then you can see what pipelines are getting invoked. cheers, -ml- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Martin Spinks Chief Technical Officer navyblue design group Corn Exchange Constitution Street Edinburgh EH6 7BS t 0131 553 5050 f 0131 555 0707 isdn 0131 555 0711 www.navyblue.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On Jan 4, 2007, at 8:49 PM, Lars Huttar wrote: Many thanks, Grzegorz and Mark! I've tried to get Cocoon running in Eclipse a number of times in the past, and now it's finally there. Awesome! :-) Next step is to figure out how to use this to trace data flow through the sitemap. You might take a look here: http://cocoon.apache.org/2.1/userdocs/concepts/profiler.html or, oftentimes just turning on debug-level logging in logkit.xconf provides enough information in the log file... then you can see what pipelines are getting invoked. cheers, —ml— - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On 1/4/2007 4:22 PM, Grzegorz Kossakowski wrote: Lars Huttar napisał(a): -Run ./cocoon.sh servlet-debug -Connect to http://localhost: from browser -Connect to port 8000 from the Eclipse remote debugger -Build from scratch, directly from the release archive then yes, that's how I've been trying it. I presume it's Windows related. Now I work on Linux (and preparing for a sleep soon) so cannot test it. I'll give it a try tomorrow. Try to figure out why it's getting refused, search maillist archives, check firewall settings (really carefully, windows firewall are sometimes too "smart") and if being desperate try dumping http traffic on 8000 port : It's working!! The fix was to add an exception for port 8000 to the Windows firewall. I had tried to do that earlier but apparently it didn't "take". Also, future people trying to do the same thing may wish to know that apparently Windows Firewall was blocking the connection, even though it didn't notify me about the blockage, despite the fact that "Display a notification when Windows Firewall blocks a program" was checked. Many thanks, Grzegorz and Mark! I've tried to get Cocoon running in Eclipse a number of times in the past, and now it's finally there. Next step is to figure out how to use this to trace data flow through the sitemap. Regards, Lars - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On 1/4/2007 4:22 PM, Grzegorz Kossakowski wrote: Lars Huttar napisał(a): -Run ./cocoon.sh servlet-debug -Connect to http://localhost: from browser -Connect to port 8000 from the Eclipse remote debugger -Build from scratch, directly from the release archive then yes, that's how I've been trying it. I presume it's Windows related. Now I work on Linux (and preparing for a sleep soon) so cannot test it. I'll give it a try tomorrow. Try to figure out why it's getting refused, search maillist archives, check firewall settings (really carefully, windows firewall are sometimes too "smart") and if being desperate try dumping http traffic on 8000 port :) FWIW, Jetty's first log output (without -DDEBUG) is "Listening for transport dt_socket at address: 8000". So that's a good sign. Also, I tried "telnet localhost 8000" to see what would happen. telnet seems to connect successfully. (It gives me a blinking cursor and lets me type, but nothing shows up.) I think that's normal. Lars - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On Jan 4, 2007, at 12:56 PM, Grzegorz Kossakowski wrote: Mark explained in detail that this is not supposed to be that way, now I will explain how to turn on debug logging in Jetty ;) So before running cocoon.bat servlet[-debug] you have to set JAVA_OPTIONS environment variable to '-DDEBUG' (double d is not typo!). So in cmd line do this: set JAVA_OPTIONS=-DDEBUG Grzegorz, where does the debug logging go ... besides the console window? Is there a log file somewhere? My console can't keep up with it all! :-) Thanks, Lars - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
Lars Huttar napisał(a): >> -Run ./cocoon.sh servlet-debug >> -Connect to http://localhost: from browser >> -Connect to port 8000 from the Eclipse remote debugger > -Build from scratch, directly from the release archive > then yes, that's how I've been trying it. I presume it's Windows related. Now I work on Linux (and preparing for a sleep soon) so cannot test it. I'll give it a try tomorrow. Try to figure out why it's getting refused, search maillist archives, check firewall settings (really carefully, windows firewall are sometimes too "smart") and if being desperate try dumping http traffic on 8000 port :) -- Grzegorz Kossakowski - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On 1/4/2007 3:58 PM, Grzegorz Kossakowski wrote: Lars Huttar napisał(a): OK, did that. That was nice and easy! Now I no longer get the message about errors in the project. So now we're just down to the problem of "Connection refused". Have you tried it with Jetty? Yes, that's the only way I've tried it. (I can't do it with Tomcat ... Tomcat doesn't like the debugging Java flags.) Steps described by Bertrand. If you are referring to -Build from scratch, directly from the release archive -Run ./cocoon.sh servlet-debug -Connect to http://localhost: from browser -Connect to port 8000 from the Eclipse remote debugger then yes, that's how I've been trying it. Lars - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
Lars Huttar napisał(a): > OK, did that. That was nice and easy! > Now I no longer get the message about errors in the project. > > So now we're just down to the problem of "Connection refused". Have you tried it with Jetty? Steps described by Bertrand. -- Grzegorz Kossakowski - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On 1/4/2007 3:47 PM, Lars Huttar wrote: On 1/4/2007 3:32 PM, Grzegorz Kossakowski wrote: Doh! What these entries come from? :) Do the rest looks normally? I mean, for example do you have exactly that entry: avalon-framework-impl-4.1.5.jar - Cocoon 2.1.7/lib/core That line says avalon-framework-api-4.1.5.jar - C:\Program Files\Apache Software Foundation\cocoon-2.1.7\lib\core The others are similar. And how have you got Cocoon project into workspace? By calling build.bat eclipse-project and importing the project? Um, no. I just created the project in Cocoon and picked the Cocoon source folder and the build.xml (File / New / Java Project from Existing Ant Buildfile). I'll try what you suggested. Lars OK, did that. That was nice and easy! Now I no longer get the message about errors in the project. So now we're just down to the problem of "Connection refused". Lars - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On 1/4/2007 3:32 PM, Grzegorz Kossakowski wrote: Lars Huttar napisał(a): When I click the "Debug" button, I get a dialog saying, "Errors exist in required project(s): Apache cocoon. Continue launch?" I click Yes, and after a moment of "Establishing connection...", I get: Exception occurred during launch Reason: failed to connect to remote VM. Connection refused. Details: Connection refused: connect Let me elaborate by saying what the errors in the "Apache Cocoon" project are. The first error I see is in org.apache.cocoon/CocoonTask.java. On line 132 it says "BuildException cannot be resolved to a type." I assume that has something to do with specifying classpaths? When I go to the Properties dialog for the project, and click on Java Build Path, I see an info (yellow "!" triangle icon) message saying "2 build path entries are missing." Under "JARs and class folders on the build path", it lists a bunch of jars, starting with altrmi-common-0.9.2.jar. The last two have yellow "!" triangle icons: C:/Program Files/Apache Software Foundation/cocoon-2.1.7/build/cocoon-2.1.7/classes and .../mocks. If I expand them, there is an item "Access rules: No rules defined" under each. That's as far as I know how to get... it's not clear to me how these path entries are "missing". (The folders "classes" and "mocks" exist on disk.) Any idea what I should do? Maybe "Add JARs" or Library or Class Folder? Doh! What these entries come from? :) Do the rest looks normally? I mean, for example do you have exactly that entry: avalon-framework-impl-4.1.5.jar - Cocoon 2.1.7/lib/core That line says avalon-framework-api-4.1.5.jar - C:\Program Files\Apache Software Foundation\cocoon-2.1.7\lib\core The others are similar. And how have you got Cocoon project into workspace? By calling build.bat eclipse-project and importing the project? Um, no. I just created the project in Cocoon and picked the Cocoon source folder and the build.xml (File / New / Java Project from Existing Ant Buildfile). I'll try what you suggested. Lars - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On 1/4/2007 3:28 PM, Lars Huttar wrote: On 1/4/2007 3:18 PM, Mark Lundquist wrote: On Jan 4, 2007, at 1:02 PM, Lars Huttar wrote: Anyway, I've now got Jetty/Cocoon successfully running with "cocoon servlet-debug". However, when I try connecting to them remotely with a debugger (jdb or Eclipse), it fails. (1) Trying with jdb: C:\Program Files\Java\jdk1.5.0_09\bin>jdb -attach localhost:8000 java.io.IOException: shmemBase_attach failed: The system cannot find the file specified Google says :-) this is a Windows-specific problem, try this instead: jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8000 I bow before your superior google-fu... OK, that helped. Now instead of " The system cannot find the file specified", I get "Connection refused: connect". So it would seem that jdb has caught up with Eclipse. Is it possible that I need to do something as a different user? I'm logged on as an Administrator... Lars P.S. I added port 8000 TCP to the Windows firewall exceptions, just in case. No improvement. By the way, I'm running all this on one local machine, not trying to remote-debug across a network. Lars - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
Lars Huttar napisał(a): > I bow before your superior google-fu... > > OK, that helped. Now instead of " The system cannot find the file > specified", I get "Connection refused: connect". > So it would seem that jdb has caught up with Eclipse. > > Is it possible that I need to do something as a different user? I'm > logged on as an Administrator... Connection refuses was the main reason for starting to think that debugging with Jetty (with zero configuration) is Right Thing(tm) :) So let's focus on jetty+eclipse. -- Grzegorz Kossakowski - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On 1/4/2007 3:33 PM, Grzegorz Kossakowski wrote: Mark Lundquist napisał(a): On Jan 4, 2007, at 1:28 PM, Lars Huttar wrote: [snipped] When this is all over, you will be well-qualified to write the "Debugging Cocoon Applications in Eclipse on Windows" document :-) +1 :-) Sure, I'll be happy to do it. :-) Even if I didn't, at least I'd be glad to know this thread will be there for googlers. Lars - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
Mark Lundquist napisał(a): > > On Jan 4, 2007, at 1:28 PM, Lars Huttar wrote: > >> [snipped] > > When this is all over, you will be well-qualified to write the > "Debugging Cocoon Applications in Eclipse on Windows" document > > :-) +1 :-) -- Grzegorz Kossakowski - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
Lars Huttar napisał(a): >> When I click the "Debug" button, I get a dialog saying, "Errors exist >> in required project(s): Apache cocoon. Continue launch?" >> I click Yes, and after a moment of "Establishing connection...", I get: >>Exception occurred during launch >>Reason: failed to connect to remote VM. Connection refused. >>Details: >>Connection refused: connect > Let me elaborate by saying what the errors in the "Apache Cocoon" > project are. > The first error I see is in org.apache.cocoon/CocoonTask.java. On line > 132 it says "BuildException cannot be resolved to a type." > I assume that has something to do with specifying classpaths? > > When I go to the Properties dialog for the project, and click on Java > Build Path, I see an info (yellow "!" triangle icon) message saying "2 > build path entries are missing." Under "JARs and class folders on the > build path", it lists a bunch of jars, starting with > altrmi-common-0.9.2.jar. The last two have yellow "!" triangle icons: > C:/Program Files/Apache Software > Foundation/cocoon-2.1.7/build/cocoon-2.1.7/classes and .../mocks. > If I expand them, there is an item "Access rules: No rules defined" > under each. > That's as far as I know how to get... it's not clear to me how these > path entries are "missing". (The folders "classes" and "mocks" exist > on disk.) > Any idea what I should do? Maybe "Add JARs" or Library or Class Folder? Doh! What these entries come from? :) Do the rest looks normally? I mean, for example do you have exactly that entry: avalon-framework-impl-4.1.5.jar - Cocoon 2.1.7/lib/core And how have you got Cocoon project into workspace? By calling build.bat eclipse-project and importing the project? -- Grzegorz Kossakowski - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On Jan 4, 2007, at 1:28 PM, Lars Huttar wrote: [snipped] When this is all over, you will be well-qualified to write the "Debugging Cocoon Applications in Eclipse on Windows" document :-) —ml— - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On 1/4/2007 3:18 PM, Mark Lundquist wrote: On Jan 4, 2007, at 1:02 PM, Lars Huttar wrote: Anyway, I've now got Jetty/Cocoon successfully running with "cocoon servlet-debug". However, when I try connecting to them remotely with a debugger (jdb or Eclipse), it fails. (1) Trying with jdb: C:\Program Files\Java\jdk1.5.0_09\bin>jdb -attach localhost:8000 java.io.IOException: shmemBase_attach failed: The system cannot find the file specified Google says :-) this is a Windows-specific problem, try this instead: jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8000 I bow before your superior google-fu... OK, that helped. Now instead of " The system cannot find the file specified", I get "Connection refused: connect". So it would seem that jdb has caught up with Eclipse. Is it possible that I need to do something as a different user? I'm logged on as an Administrator... Lars - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On 1/4/2007 2:56 PM, Grzegorz Kossakowski wrote: Lars Huttar napisał(a): Lars Huttar napisał(a): I have the first but not the second: 09:42:46.355 EVENT Started SocketListener on 0.0.0.0: 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(HttpServer.java:640) at org.mortbay.jetty.Server.main(Server.java:429) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ... at Loader.run(Unknown 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?? Any idea what document is failing to parse? Is the document root element really supposed to be ? Mark explained in detail that this is not supposed to be that way, now I will explain how to turn on debug logging in Jetty ;) So before running cocoon.bat servlet[-debug] you have to set JAVA_OPTIONS environment variable to '-DDEBUG' (double d is not typo!). So in cmd line do this: set JAVA_OPTIONS=-DDEBUG cocoon.bat servlet[-debug] and you will get _lots_ of debug messages, I think you will be satisfied with the amount ;-) 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 guess I will have to bite the bullet and learn Eclipse if I want to use Eclipse to debug Cocoon. When you figure out how to get Jetty happy with servlet-debug we'll be able to pass on this. I'll describe it in detail. OK, I'll take you up on that offer! :-) Jetty is now happy with servlet-debug. My previous email mentions what happens when I try to debug it remotely using Eclipse: When I click the "Debug" button, I get a dialog saying, "Errors exist in required project(s): Apache cocoon. Continue launch?" I click Yes, and after a moment of "Establishing connection...", I get: Exception occurred during launch Reason: failed to connect to remote VM. Connection refused. Details: Connection refused: connect Let me elaborate by saying what the errors in the "Apache Cocoon" project are. The first error I see is in org.apache.cocoon/CocoonTask.java. On line 132 it says "BuildException cannot be resolved to a type." I assume that has something to do with specifying classpaths? When I go to the Properties dialog for the project, and click on Java Build Path, I see an info (yellow "!" triangle icon) message saying "2 build path entries are missing." Under "JARs and class folders on the build path", it lists a bunch of jars, starting with altrmi-common-0.9.2.jar. The last two have yellow "!" triangle icons: C:/Program Files/Apache Software Foundation/cocoon-2.1.7/build/cocoon-2.1.7/classes and .../mocks. If I expand them, there is an item "Access rules: No rules defined" under each. That's as far as I know how to get... it's not clear to me how these path entries are "missing". (The folders "classes" and "mocks" exist on disk.) Any idea what I should do? Maybe "Add JARs" or Library or Class Folder? Thanks for your help, Lars - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On Jan 4, 2007, at 1:02 PM, Lars Huttar wrote: Anyway, I've now got Jetty/Cocoon successfully running with "cocoon servlet-debug". However, when I try connecting to them remotely with a debugger (jdb or Eclipse), it fails. (1) Trying with jdb: C:\Program Files\Java\jdk1.5.0_09\bin>jdb -attach localhost:8000 java.io.IOException: shmemBase_attach failed: The system cannot find the file specified Google says :-) this is a Windows-specific problem, try this instead: jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8000 HTH, —ml— - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On Jan 4, 2007, at 1:02 PM, Lars Huttar wrote: I believe it *is* on the path... see previous response. D'oh, it is... not sure what I was thinking :-) —ml— - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On Jan 4, 2007, at 12:56 PM, Grzegorz Kossakowski wrote: Mark explained in detail that this is not supposed to be that way, now I will explain how to turn on debug logging in Jetty ;) So before running cocoon.bat servlet[-debug] you have to set JAVA_OPTIONS environment variable to '-DDEBUG' (double d is not typo!). So in cmd line do this: set JAVA_OPTIONS=-DDEBUG I did not know this.. it is very useful! thx, —ml- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
Solved! Again, thanks to all who wrote in with suggestions and questions. You prodded me in the right directions. The problem causing Jetty not to start Cocoon was in web.xml. Based on a tip at http://www.servlets.com/archive/servlet/ReadMsg?msgId=534721&listName=jetty-support, I checked Cocoon's WEB-INF\web.xml and found that in Cocoon 2.1.7 I had long ago commented out the DOCTYPE declaration. [Why? An unsuccessful attempt to speed up Cocoon's startup time under Tomcat.] This had not caused Cocoon to fail under Tomcat, but it did under Jetty. After reinstating the DOCTYPE, jetty ran Cocoon successfully again. On 1/4/2007 2:23 PM, Mark Lundquist wrote: 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(HttpServer.java:640) at org.mortbay.jetty.Server.main(Server.java:429) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ... at Loader.run(Unknown 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". Thanks for digging into this. As noted above, I managed to find the problem. I appreciate your sharing your familiarity with Jetty! 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. But I would know that Cocoon and its servlet container were correctly configured for debugging, with a lot less configuration than it would take to set up Eclipse for debugging. 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. I believe it *is* on the path... see previous response. When you currently have no debugging configuration, and don't know what you're doing, it's a lot easier to set up a debugging scenario if you can isolate debuggee configuration from debugger config. That way when it doesn't work, you have an idea whether it's a problem with debugger config or debuggee config. In other words, once I know that I have Jetty/Cocoon set up right for remote debugging, I can proceed to attempt remote debugging via Eclipse with much more confidence. 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. I'm sure debugging Cocoon with Eclipse is better than with jdb, but I have to crawl before I can walk. My debugging requirements may even be small enough that jdb would do the job. As for the pickled herring... With mustard? :-) 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 http://wiki.apache.org/cocoon/LoadInEclipse 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 t
Re: Running Cocoon in debugger
Lars Huttar napisał(a): > Lars Huttar napisał(a): > I have the first but not the second: > > 09:42:46.355 EVENT Started SocketListener on 0.0.0.0: > 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(HttpServer.java:640) >at org.mortbay.jetty.Server.main(Server.java:429) >at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > ... >at Loader.run(Unknown 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?? > Any idea what document is failing to parse? Is the document root > element really supposed to be ? Mark explained in detail that this is not supposed to be that way, now I will explain how to turn on debug logging in Jetty ;) So before running cocoon.bat servlet[-debug] you have to set JAVA_OPTIONS environment variable to '-DDEBUG' (double d is not typo!). So in cmd line do this: set JAVA_OPTIONS=-DDEBUG cocoon.bat servlet[-debug] and you will get _lots_ of debug messages, I think you will be satisfied with the amount ;-) > 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 guess I will have to bite the bullet and > learn Eclipse if I want to use Eclipse to debug Cocoon. When you figure out how to get Jetty happy with servlet-debug we'll be able to pass on this. I'll describe it in detail. -- Grzegorz Kossakowski - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On Jan 4, 2007, at 12:08 PM, Lars Huttar wrote: However, Cocoon 2.1.7 runs fine with Tomcat. Right, but since your error is at the Jetty level... So I must have done something to the Jetty bundled with Cocoon 2.1.7. Apparently so... However the Jetty config files (tools\jetty\**) are the same in both installations. What about your cocoon.bat? Is that changed from the distribution? Do you have a virgin 2.1.7 distribution to compare to? —ml— - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
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(HttpServer.java:640) at org.mortbay.jetty.Server.main(Server.java:429) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ... at Loader.run(Unknown 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 http://wiki.apache.org/cocoon/LoadInEclipse 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 not? cheers, —ml—
Re: Running Cocoon in debugger
P.S... On 1/4/2007 12:03 PM, Grzegorz Kossakowski wrote: Lars Huttar napisał(a): On 1/4/2007 8:19 AM, Grzegorz Kossakowski wrote: Thanks for your quick reply. You are right of course about the port number. However the :8000 was just an email typo. When browsing to http://localhost:/, the browser gives the above error ("No context on this server matched or handled this request"). Browsing to http://localhost:8000/ actually gives no error but causes Jetty to shut down. So, I still have the same problem. When I browse to http://localhost:/, Jetty outputs the following message to the console: 09:44:51.166 EVENT Started HttpContext[/] So I know Jetty is to some degree "catching" the request. Also, I neglected to mention that the heading above "No context on this server matched..." was "Error 404 - Not Found." It's odd. Which version of java do you have? JDK 1.5.0_09. Do you have something like this as output on jetty console: 18:48:40.007 EVENT Started SocketListener on 0.0.0.0: 18:48:40.007 EVENT Started [EMAIL PROTECTED] ? I tried jetty in a fairly pristine install of Cocoon 2.1.9, and it worked fine (gave the above two EVENTs and Cocoon responded to the browser). So there's clearly something wrong with my Cocoon 2.1.7 / Jetty config. However, Cocoon 2.1.7 runs fine with Tomcat. So I must have done something to the Jetty bundled with Cocoon 2.1.7. However the Jetty config files (tools\jetty\**) are the same in both installations. There was a difference such that under Cocoon 2.1.7, jetty\conf\main.xml had / where in 2.1.9 it had . But even when I tried changing the 2.1.7 file to conform to the 2.1.9 file, the error did not go away. Maybe if I could correct the parsing error, jetty would work. Lars - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On 1/4/2007 12:26 PM, Mark Lundquist wrote: On Jan 4, 2007, at 7:49 AM, Lars Huttar wrote: If I don't find a solution for debugging with Jetty, I may try Eclipse as you suggest. NB we are actually talking about Eclipse either way... the distinction IIUC is just between two different types of debugging setup in Eclipse. The remote debugging method (what you are refrerring to as "with Jetty") is by far the simplest way, is quite performant and has always worked great for me. My suggestion: work with us to figure out why remote debugging of Jetty+Cocoon is not working in your environment, don't spend your energy messing around with a bunch of other methods. Thanks... I'll be happy for whatever's easiest and requires the least messing around! I guess I'll make a fresh install of Cocoon 2.1.7 elsewhere, make sure it runs in Jetty, then do some comparing of files. However, YMMV, maybe this is just easiest for me because I actually deploy in the bundled Jetty for production... if you use Tomcat for production then maybe some Tomcat-oriented debugging method would be best for you, I dunno :-) We do use Tomcat in production but I trust that debugging in Jetty wouldn't make much difference. I could be wrong. Lars My $.02, —ml— - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On 1/4/2007 10:47 AM, Bertrand Delacretaz wrote: On 1/4/07, Lars Huttar <[EMAIL PROTECTED]> wrote: ...Method (1): using Jetty The first method, "cocoon.bat servlet-debug" (as recommended in [1]), appears to start OK. But when you try to browse to http://localhost:8000/, the browser gives the error:... FWIW, the following works with the current 2.1.10 release, macosx, JDK 1.5: -Build from scratch, directly from the release archive -Run ./cocoon.sh servlet-debug -Connect to http://localhost: from browser -Connect to port 8000 from the Eclipse remote debugger You might want to try that, to compare with what you're seeing. The Cocoon release shouldn't make a difference. -Bertrand Thanks for your reply. The steps you mentioned for starting jetty used to work for me, but don't anymore; so I would agree with Grzegorz that something must be wrong with my configuration. But I'm at a loss to know what's wrong. Does Jetty output more informative error messages into a log anywhere? Or where might I find Jetty configuration that I might have messed up earlier and forgotten about it? The files in tools\jetty\conf seem to be untouched. On 1/4/2007 12:03 PM, Grzegorz Kossakowski wrote: Lars Huttar napisał(a): ... So, I still have the same problem. When I browse to http://localhost:/, Jetty outputs the following message to the console: 09:44:51.166 EVENT Started HttpContext[/] So I know Jetty is to some degree "catching" the request. Also, I neglected to mention that the heading above "No context on this server matched..." was "Error 404 - Not Found." It's odd. Which version of java do you have? Do you have something like this as output on jetty console: 18:48:40.007 EVENT Started SocketListener on 0.0.0.0: 18:48:40.007 EVENT Started [EMAIL PROTECTED] ? I have the first but not the second: 09:42:46.355 EVENT Started SocketListener on 0.0.0.0: 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(HttpServer.java:640) at org.mortbay.jetty.Server.main(Server.java:429) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ... at Loader.run(Unknown 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?? Any idea what document is failing to parse? Is the document root element really supposed to be ? I've checked out (on linux, but I do remember I have debugged C2.1.7 on WinXP long time ago) and it just works so it must be something with your configuration. If I don't find a solution for debugging with Jetty, I may try Eclipse as you suggest. The headache there is that if I really do have to maintain a SVN working copy of Cocoon for debugging, I will have to keep manually updating it with changes from my development copy of Cocoon, in which I have cocoon.xconf and some other Cocoon config files tracked by our internal SVN repository. Is it possible to use Eclipse to debug Cocoon without involving Subclipse? I'm not sure if I understand you correctly but: 1. Use Eclipse as debugger in any case (if you use jetty or tomcat) I was going to try raw jdb as a simplest case, to see if it worked; if so then I could work up to getting Eclipse configured to work with Cocoon. Or am I mistaken in thinking that you can debug Cocoon without Eclipse? 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 http://wiki.apache.org/cocoon/LoadInEclipse assume you check Cocoon out of SVN. 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 guess I will have to bite the bullet and learn Eclipse if I want to use Eclipse to debug Cocoon. On 1/4/2007 12:14 PM, Mark Lundquist wrote: On Jan 4, 2007, at 7:49 AM, Lars Huttar wrote: If I don't find a solution for debugging with Jetty, I may try Eclipse as you suggest. The headache there is that if I really do have to maintain a SVN working copy of Cocoon for debugging, huh, why do you have to have Cocoon sources in Subversion just to debug with Eclipse? What does Eclipse care whether the sources are in Subversion? (See above response.) I will have to keep manually updating it with changes from
Re: Running Cocoon in debugger
On Jan 4, 2007, at 7:49 AM, Lars Huttar wrote: If I don't find a solution for debugging with Jetty, I may try Eclipse as you suggest. NB we are actually talking about Eclipse either way... the distinction IIUC is just between two different types of debugging setup in Eclipse. The remote debugging method (what you are refrerring to as "with Jetty") is by far the simplest way, is quite performant and has always worked great for me. My suggestion: work with us to figure out why remote debugging of Jetty+Cocoon is not working in your environment, don't spend your energy messing around with a bunch of other methods. However, YMMV, maybe this is just easiest for me because I actually deploy in the bundled Jetty for production... if you use Tomcat for production then maybe some Tomcat-oriented debugging method would be best for you, I dunno :-) My $.02, —ml— - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On Jan 4, 2007, at 7:49 AM, Lars Huttar wrote: If I don't find a solution for debugging with Jetty, I may try Eclipse as you suggest. The headache there is that if I really do have to maintain a SVN working copy of Cocoon for debugging, huh, why do you have to have Cocoon sources in Subversion just to debug with Eclipse? What does Eclipse care whether the sources are in Subversion? I will have to keep manually updating it with changes from my development copy of Cocoon, in which I have cocoon.xconf and some other Cocoon config files tracked by our internal SVN repository. Is it possible to use Eclipse to debug Cocoon without involving Subclipse? Subclipse!?! Now, I do keep Cocoon sources in my own Subversion repository [1], but I don't use Subclipse. Just because your sources are in Subversion (and once again, debugging with Eclipse doesn't require this), wouldn't mean you have to use Subclipse. HTH ...? :-) —ml— [1] — http://wiki.apache.org/cocoon/CocoonVendorBranch
Re: Running Cocoon in debugger
Lars Huttar napisał(a): > On 1/4/2007 8:19 AM, Grzegorz Kossakowski wrote: > Thanks for your quick reply. You are right of course about the port > number. > However the :8000 was just an email typo. When browsing to > http://localhost:/, the browser gives the above error ("No context > on this server matched or handled this request"). Browsing to > http://localhost:8000/ actually gives no error but causes Jetty to > shut down. > > So, I still have the same problem. > When I browse to http://localhost:/, Jetty outputs the following > message to the console: >09:44:51.166 EVENT Started HttpContext[/] > So I know Jetty is to some degree "catching" the request. > Also, I neglected to mention that the heading above "No context on > this server matched..." was "Error 404 - Not Found." It's odd. Which version of java do you have? Do you have something like this as output on jetty console: 18:48:40.007 EVENT Started SocketListener on 0.0.0.0: 18:48:40.007 EVENT Started [EMAIL PROTECTED] ? I've checked out (on linux, but I do remember I have debugged C2.1.7 on WinXP long time ago) and it just works so it must be something with your configuration. > If I don't find a solution for debugging with Jetty, I may try Eclipse > as you suggest. The headache there is that if I really do have to > maintain a SVN working copy of Cocoon for debugging, I will have to > keep manually updating it with changes from my development copy of > Cocoon, in which I have cocoon.xconf and some other Cocoon config > files tracked by our internal SVN repository. Is it possible to use > Eclipse to debug Cocoon without involving Subclipse? I'm not sure if I understand you correctly but: 1. Use Eclipse as debugger in any case (if you use jetty or tomcat) 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. -- Grzegorz Kossakowski - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On 1/4/07, Lars Huttar <[EMAIL PROTECTED]> wrote: ...Method (1): using Jetty The first method, "cocoon.bat servlet-debug" (as recommended in [1]), appears to start OK. But when you try to browse to http://localhost:8000/, the browser gives the error:... FWIW, the following works with the current 2.1.10 release, macosx, JDK 1.5: -Build from scratch, directly from the release archive -Run ./cocoon.sh servlet-debug -Connect to http://localhost: from browser -Connect to port 8000 from the Eclipse remote debugger You might want to try that, to compare with what you're seeing. The Cocoon release shouldn't make a difference. -Bertrand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
On 1/4/2007 8:19 AM, Grzegorz Kossakowski wrote: Lars Huttar napisał(a): Hello, I'm trying to run Cocoon in a debugger, as is often suggested in answers to queries on this list. The instructions I've found are at [1] and [2]. Nothing I've tried works. I'd appreciate any help. (FYI: I'm using Windows XP, Cocoon 2.1.7, and Tomcat 5.5.9.) Method (1): using Jetty The first method, "cocoon.bat servlet-debug" (as recommended in [1]), appears to start OK. But when you try to browse to http://localhost:8000/, the browser gives the error: No context on this server matched or handled this request. Contexts known to this server are: * WebApplicationContext[/,.\build\webapp] The links above may not work if a virtual host is configured Going back to baseline, I discovered that it fails the same way regardless of whether you use "cocoon.bat servlet-debug" or just plain "cocoon servlet". I googled on the error message but couldn't find anything that helped me solve the problem. Nor could I find any jetty logs with errors. The easiest method is the first one. Your mistake is that you try to browse on port 8000 instead of . Port is used to communicate with browser, 8000 one is reserved for communication between Java VM and debugger. So if you are in debug mode you should still use and configure your favorite debugger with localhost (as host) and 8000 as port. I really recommend using Eclipse for debugging. I find this IDE the best one on the earth and debugging with it is damn easy :-) But do not shy to ask even basic questions about Eclipse related debugging Cocoon/your project. At the beginning, not everything have to be obvious. Thanks for your quick reply. You are right of course about the port number. However the :8000 was just an email typo. When browsing to http://localhost:/, the browser gives the above error ("No context on this server matched or handled this request"). Browsing to http://localhost:8000/ actually gives no error but causes Jetty to shut down. So, I still have the same problem. When I browse to http://localhost:/, Jetty outputs the following message to the console: 09:44:51.166 EVENT Started HttpContext[/] So I know Jetty is to some degree "catching" the request. Also, I neglected to mention that the heading above "No context on this server matched..." was "Error 404 - Not Found." If I don't find a solution for debugging with Jetty, I may try Eclipse as you suggest. The headache there is that if I really do have to maintain a SVN working copy of Cocoon for debugging, I will have to keep manually updating it with changes from my development copy of Cocoon, in which I have cocoon.xconf and some other Cocoon config files tracked by our internal SVN repository. Is it possible to use Eclipse to debug Cocoon without involving Subclipse? Regards, Lars - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Cocoon in debugger
Lars Huttar napisał(a): > Hello, > I'm trying to run Cocoon in a debugger, as is often suggested in > answers to queries on this list. > The instructions I've found are at [1] and [2]. Nothing I've tried > works. I'd appreciate any help. > > (FYI: I'm using Windows XP, Cocoon 2.1.7, and Tomcat 5.5.9.) > > Method (1): using Jetty > The first method, "cocoon.bat servlet-debug" (as recommended in [1]), > appears to start OK. But when you try to browse to > http://localhost:8000/, the browser gives the error: > >No context on this server matched or handled this request. >Contexts known to this server are: >* WebApplicationContext[/,.\build\webapp] >The links above may not work if a virtual host is configured > > Going back to baseline, I discovered that it fails the same way > regardless of whether you use "cocoon.bat servlet-debug" or just plain > "cocoon servlet". > I googled on the error message but couldn't find anything that helped > me solve the problem. Nor could I find any jetty logs with errors. > > The easiest method is the first one. Your mistake is that you try to browse on port 8000 instead of . Port is used to communicate with browser, 8000 one is reserved for communication between Java VM and debugger. So if you are in debug mode you should still use and configure your favorite debugger with localhost (as host) and 8000 as port. I really recommend using Eclipse for debugging. I find this IDE the best one on the earth and debugging with it is damn easy :-) But do not shy to ask even basic questions about Eclipse related debugging Cocoon/your project. At the beginning, not everything have to be obvious. -- Grzegorz Kossakowski - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]