Stuck on Hello World, with non-FAQ Problem
Hi guys, I'm following along in the book Cocoon: Building XML Applications and trying to get the Hello World example to work. BEFORE you delete my email, PLEASE take a quick look at the really simple files and config info below and see if you can help me. I would REALLY appreciate the help so that I can learn. First, the version info: Cocoon 2.0.3 (latest stable release, obtained in binary form) JDK: 1.4 Tomcat 4.1.12 (just obtained about a week ago in binary form) OS: Redhat 7.3 The error: The requested URI /cocoon/helloworld was not found. Now, the pipeline config info in sitemap.xmap: map:pipelines map:pipeline map:match pattern=helloworld map:generate src=helloworld.xml/ map:transform src=helloworld2html.xsl/ map:serialize/ /map:match /map:pipeline /map:pipelines Note that, for ultra simplicity, this is the ENTIRE map:pipelines section (I deleted the rest). Ok, now here's the simple contents of the helloworld.xml file: ?xml version=1.0 document textHello World/text /document And of the helloworld2html.xsl file: ?xml version=1.0? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xsl:template match=document html body h1xsl:value-of select=text//h1 /body /html /xsl:template /xsl:stylesheet Basically, with the modified sitemap the URI helloworld can't be mapped to anything and yet the original Cocoon welcome page and other pages it links to still come up. Also, here's the sitemap tag in $COCOON_HOME/WEB-INF/cocoon.xconf: sitemap check-reload=yes class=org.apache.cocoon.sitemap.SitemapManager file=sitemap.xmap logger=sitemap reload-method=synchron/ *The check-reload and reload-methods look like what they should be for the sitemap to be reloaded upon being changed and before serving any new requests. *I also tried stopping and restarting Tomcat. *I both flushed and turn off Konqueror's cache as well. Could it have something to do with Cocoon's cache itself?? I would be very happy if one of you could take the time to point me in the right direction. I'm a newbie, I know, but I'd like to become the next happy Cocoon user. All the best, Sonny _ Conserve wilderness with a click (free!) and get your own EcologyFund.net email (free!) at http://www.ecologyfund.com. _ Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No Ads, 6MB, POP more! http://www.everyone.net/selectmail?campaign=tag - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stuck on Hello World, with non-FAQ Problem
On Monday 07 October 2002 19:24, Sonny Sukumar wrote: The error: The requested URI /cocoon/helloworld was not found. Now, the pipeline config info in sitemap.xmap: I could have wild guess at this since I just was confused looking at a helloworld example myself. But of course, your problem could be entirely different from mine. Anyway, try access with cocoon/helloworld/helloworld instead. You'll need that if your sitemap is a dir of its own. Best, Kjetil -- Kjetil Kjernsmo Astrophysicist/IT Consultant/Skeptic/Ski-orienteer/Orienteer/Mountaineer [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] Homepage: http://www.kjetil.kjernsmo.net/ - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stuck on Hello World, with non-FAQ Problem
Hi, I should have mentioned that sitemap.xmap is in $COCOON_HOME, where it is supposed to be from what I've read. I tried your suggestion, and got the same error. Btw, can anyone tell me why there are MULTIPLE sitemap.xmap files in $COCOON_HOME subdirectories? I thought there was only supposed to be the one in $COCOON_HOME. If anyone can help me out with my original Hello World question, I would REALLY appreciate it..I want to get this to work sooo much. Thanks again. :-) Sonny --- Kjetil Kjernsmo [EMAIL PROTECTED] wrote: On Monday 07 October 2002 19:24, Sonny Sukumar wrote: The error: The requested URI /cocoon/helloworld was not found. Now, the pipeline config info in sitemap.xmap: Anyway, try access with cocoon/helloworld/helloworld instead. You'll need that if your sitemap is a dir of its own. Best, Kjetil _ Conserve wilderness with a click (free!) and get your own EcologyFund.net email (free!) at http://www.ecologyfund.com. _ Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No Ads, 6MB, POP more! http://www.everyone.net/selectmail?campaign=tag - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stuck on Hello World, with non-FAQ Problem
Sonny Sukumar wrote: If anyone can help me out with my original Hello World question, I would REALLY appreciate it..I want to get this to work sooo much. I have trouble understanding your problem, too. Could you give us a dirlisting of $TOMCAT_HOME/webapps/cocoon - assuming you have deployed Cocoon over there? The error message you get is a Tomcat one, I guess, so maybe the Cocoon context isn't properly set up. /Steven -- Steven Noelshttp://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stuck on Hello World, with non-FAQ Problem
Sure, here's a quick copy and paste of $COCOON_HOME (same thing as $TOMCAT_HOME/webapps/cocoon): cocoon.xconf.moved i18n resources sitemap.xmap.bak tutorial docs logicsheets samples stylesheets WEB-INF documentationMETA-INF searchsub welcome helloworld2html.xsl mountsitebuilder sunspotdemo helloworld.xml protectedsitemap.xmap templates The problem *is* a Cocoon problem. The Tomcat servlet engine works just fine and Cocoon runs on it, but I can't get this Hello World example to work. I also don't understand why the other Cocoon pages still come up after I deleted ALL the other stuff inside the map:pipelines tag other than my map:pipeline for the Hello World example that generates from helloworld.xml, transforms with helloworld2html.xsl and serializes the output. Does it make sense now? If I need to clarify anything at all or paste some things from my first email, please let me know and I will gladly do so. Thanks again, Sonny --- Steven Noels [EMAIL PROTECTED] wrote: Sonny Sukumar wrote: If anyone can help me out with my original Hello World question, I would REALLY appreciate it..I want to get this to work sooo much. I have trouble understanding your problem, too. Could you give us a dirlisting of $TOMCAT_HOME/webapps/cocoon - assuming you have deployed Cocoon over there? The error message you get is a Tomcat one, I guess, so maybe the Cocoon context isn't properly set up. /Steven -- Steven Noelshttp://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Conserve wilderness with a click (free!) and get your own EcologyFund.net email (free!) at http://www.ecologyfund.com. _ Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No Ads, 6MB, POP more! http://www.everyone.net/selectmail?campaign=tag - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Stuck on Hello World, with non-FAQ Problem
I also don't understand why the other Cocoon pages still come up after I deleted ALL the other stuff inside the map:pipelines tag other than my map:pipeline for the Hello World example that generates from helloworld.xml, transforms with helloworld2html.xsl and serializes the output. That tends to suggest that the copy of Cocoon you are modifying isn't the same one that Tomcat is running... How are you deploying Cocoon (expanding the EAR manually and copying?)? BTW, to answer another question you had earlier, the reason you see sitemap.xconf in multiple directories is that a parent sitemap can mount sub-sitemaps. It's a parent child relationship from the main sitemap... - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stuck on Hello World, with non-FAQ Problem
Sonny Sukumar wrote: The problem *is* a Cocoon problem. The Tomcat servlet engine works just fine and Cocoon runs on it, but I can't get this Hello World example to work. I also don't understand why the other Cocoon pages still come up after I deleted ALL the other stuff inside the map:pipelines tag other than my map:pipeline for the Hello World example that generates from helloworld.xml, transforms with helloworld2html.xsl and serializes the output. Does it make sense now? If I need to clarify anything at all or paste some things from my first email, please let me know and I will gladly do so. It does make sense and indeed it seems like your changed sitemap isn't loaded. Did you clean out the 'work' directory of Tomcat when restarting - not that this should be the problem, but one never knows. Also, adding a error-handling section in your pipeline configuration might provide you with some useful info: ... map:handle-errors map:transform src=stylesheets/error2html.xsl/ map:serialize/ /map:handle-errors /map:pipeline Another idea: switching to the (interpreting instead of compiling) treeprocessor, by swapping it with the normal sitemap engine configation with sitemap logger=sitemap/ Oh, BTW, it's not that you are editing the wrong sitemap file (.bak)? /Steven -- Steven Noelshttp://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Stuck on Hello World, with non-FAQ Problem
On a fresh Tomcat (4.1.12) installation I copied the file cocoon.war (this is Cocoon 2.0.3) into the $TOMCAT_HOME/webapps directory. I then started Tomcat using $TOMCAT_HOME/bin/startup.sh, navigated to http://localhost:8080/cocoon and Tomcat expanded cocoon.war into $TOMCAT_HOME/webapps/cocoon, started the Cocoon servlet, and displayed the Cocoon intro page. As I said before, to do this Hello World example, I modified the map:pipelines section of sitemap.xmap to just contain the map:pipeline for the Hello World example. Actually, first I tried just adding the Hello World pipeline...when that didn't work I deleted the rest. It still doesn't work. And I'm not sure how Tomcat could be running some other Cocoon instance either. But I am obviously missing something somewhere. And thanks for the info on the parent-child sitemaps..I guess I'll get to that later, once I get this to work. :-) --- Hunsberger, Peter [EMAIL PROTECTED] wrote: I also don't understand why the other Cocoon pages still come up after I deleted ALL the other stuff inside the map:pipelines tag other than my map:pipeline for the Hello World example that generates from helloworld.xml, transforms with helloworld2html.xsl and serializes the output. That tends to suggest that the copy of Cocoon you are modifying isn't the same one that Tomcat is running... How are you deploying Cocoon (expanding the EAR manually and copying?)? BTW, to answer another question you had earlier, the reason you see sitemap.xconf in multiple directories is that a parent sitemap can mount sub-sitemaps. It's a parent child relationship from the main sitemap... - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Conserve wilderness with a click (free!) and get your own EcologyFund.net email (free!) at http://www.ecologyfund.com. _ Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No Ads, 6MB, POP more! http://www.everyone.net/selectmail?campaign=tag - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stuck on Hello World, with non-FAQ Problem
I switched treeprocessor by commenting out one sitemap tag and uncommenting the other one in cocoon.xconf. Btw, what is stored in Tomcat's work directory? This might sound like a dumb question to you, but I'm still on Hello World. :-) Likewise, I haven't done anything with error handling, so if you feel this is something important that I should do here and now to diagnose the problem, I humbly ask for a small explanation so I can understand what's going on. For example, what XML source does the error2html.xsl file in your sample code operate on? Lastly, I know for a fact I'm editing sitemap.xmap and not the sitemap.xmap.bak file I created to simply backup the original sitemap.xmap file before I started playing around with it. But it is good of you to point out. :-) Sonny --- Steven Noels [EMAIL PROTECTED] wrote: Sonny Sukumar wrote: The problem *is* a Cocoon problem. The Tomcat servlet engine works just fine and Cocoon runs on it, but I can't get this Hello World example to work. I also don't understand why the other Cocoon pages still come up after I deleted ALL the other stuff inside the map:pipelines tag other than my map:pipeline for the Hello World example that generates from helloworld.xml, transforms with helloworld2html.xsl and serializes the output. Does it make sense now? If I need to clarify anything at all or paste some things from my first email, please let me know and I will gladly do so. It does make sense and indeed it seems like your changed sitemap isn't loaded. Did you clean out the 'work' directory of Tomcat when restarting - not that this should be the problem, but one never knows. Also, adding a error-handling section in your pipeline configuration might provide you with some useful info: ... map:handle-errors map:transform src=stylesheets/error2html.xsl/ map:serialize/ /map:handle-errors /map:pipeline Another idea: switching to the (interpreting instead of compiling) treeprocessor, by swapping it with the normal sitemap engine configation with sitemap logger=sitemap/ Oh, BTW, it's not that you are editing the wrong sitemap file (.bak)? /Steven -- Steven Noelshttp://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Conserve wilderness with a click (free!) and get your own EcologyFund.net email (free!) at http://www.ecologyfund.com. _ Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No Ads, 6MB, POP more! http://www.everyone.net/selectmail?campaign=tag - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stuck on Hello World, with non-FAQ Problem
Sonny Sukumar wrote: I switched treeprocessor by commenting out one sitemap tag and uncommenting the other one in cocoon.xconf. no huuray however? Btw, what is stored in Tomcat's work directory? This might sound like a dumb question to you, but I'm still on Hello World. :-) using the (default) compiled sitemap processor, the java classes that implement your sitemap (which are generated using xslt from your sitemap.xmap - don't ask ;-) are created there and compiled many people have experienced already that for some mysterious reasons, getting rid of these java sources/compiled classes sometimes does help Likewise, I haven't done anything with error handling, so if you feel this is something important that I should do here and now to diagnose the problem, I humbly ask for a small explanation so I can understand what's going on. For example, what XML source does the error2html.xsl file in your sample code operate on? not exactly a 'source', but a built-in error generator that provides the error2html.xsl stylesheet with an XML representation of the exception/stacktrace Lastly, I know for a fact I'm editing sitemap.xmap and not the sitemap.xmap.bak file I created to simply backup the original sitemap.xmap file before I started playing around with it. But it is good of you to point out. :-) I could as well try ;-) /Steven -- Steven Noelshttp://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stuck on Hello World, with non-FAQ Problem
Sonny Sukumar wrote: HOWEVER: Cocoon now recognizes the URI when I navigate to http://localhost:8080/cocoon/helloworld, but it is nothing but a blank page. This started happening after switching the sitemap tag, and this behavior is still there after deleting the contents of $TOMCAT_HOME/work. I guess this is a step forward though. Any idea why I could be getting a blank page? If not, then I guess I'll have try that error handling stuff eh? I'm scared. :-/ You shouldn't ;-) Two choices now: dig in the log files ($COCOON_HOME/WEB-INF/logs/error.log) or have that error handling stuff set up. But I'm off to bed soon now :-) /Steven -- Steven Noelshttp://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stuck on Hello World, with non-FAQ Problem
I cleared out error.log and accessed http://localhost:8080/cocoon/helloworld again and there's no errors that are logged. The page just comes up blank. When I click on View Source, the document source is COMPLETELY empty. Should I be using something other than serialize/? I just copied the example straight from the book. --- Steven Noels [EMAIL PROTECTED] wrote: Sonny Sukumar wrote: HOWEVER: Cocoon now recognizes the URI when I navigate to http://localhost:8080/cocoon/helloworld, but it is nothing but a blank page. This started happening after switching the sitemap tag, and this behavior is still there after deleting the contents of $TOMCAT_HOME/work. I guess this is a step forward though. Any idea why I could be getting a blank page? If not, then I guess I'll have try that error handling stuff eh? I'm scared. :-/ You shouldn't ;-) Two choices now: dig in the log files ($COCOON_HOME/WEB-INF/logs/error.log) or have that error handling stuff set up. But I'm off to bed soon now :-) /Steven -- Steven Noelshttp://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Conserve wilderness with a click (free!) and get your own EcologyFund.net email (free!) at http://www.ecologyfund.com. _ Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No Ads, 6MB, POP more! http://www.everyone.net/selectmail?campaign=tag - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stuck on Hello World, with non-FAQ Problem
Sonny Sukumar wrote: I cleared out error.log and accessed http://localhost:8080/cocoon/helloworld again and there's no errors that are logged. The page just comes up blank. When I click on View Source, the document source is COMPLETELY empty. Should I be using something other than serialize/? I just copied the example straight from the book. Damn, my bad. So finally, I copied your code into files and fed that through Cocoon. Hm... org.xml.sax.SAXParseException: a pseudo attribute name is expected on my error page and in my logs... What could this be...? Load up your helloworld.xml in an XML editor, press validate and tada, typo found: ?xml version=1.0? ^ Yup, that stupid - didn't had anything to do with Cocoon. Do you have your error page up running now? The error message isn't particularly helpful (plain wrong in this case), but at least you get a feeling where to look at. OK now? /Steven -- Steven Noelshttp://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stuck on Hello World, with non-FAQ Problem
Man, Steven, thanks for pointing that out--the Hello World example works now. The really weird thing is that I *did* check that quite a few times and fixed the missing ? mark before. However, I had made a backup copy of the helloworld.xml file so that I could delete my whole cocoon directory and reinstall cocoon from scratch (I thought I might have messed up the installation somehow). So I guess the backed up helloworld.xml file still had the missing ? and that's been a major culprit here. Sigh Also weird: Remember that I kept getting the error about cocoon/helloworld being an unknown URI? That error has mysteriously gone away...could it have been cleaning out the $TOMCAT_HOME/work directory that did it?? In any case, the example finally works!! Hooraaay!!! And it was supposed to be a trivial example too. :-) Go get some sleep--you have earned it. :-) Thanks! Sonny --- Steven Noels [EMAIL PROTECTED] wrote: Sonny Sukumar wrote: I cleared out error.log and accessed http://localhost:8080/cocoon/helloworld again and there's no errors that are logged. The page just comes up blank. When I click on View Source, the document source is COMPLETELY empty. Should I be using something other than serialize/? I just copied the example straight from the book. Damn, my bad. So finally, I copied your code into files and fed that through Cocoon. Hm... org.xml.sax.SAXParseException: a pseudo attribute name is expected on my error page and in my logs... What could this be...? Load up your helloworld.xml in an XML editor, press validate and tada, typo found: ?xml version=1.0? ^ Yup, that stupid - didn't had anything to do with Cocoon. Do you have your error page up running now? The error message isn't particularly helpful (plain wrong in this case), but at least you get a feeling where to look at. OK now? /Steven -- Steven Noelshttp://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Conserve wilderness with a click (free!) and get your own EcologyFund.net email (free!) at http://www.ecologyfund.com. _ Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No Ads, 6MB, POP more! http://www.everyone.net/selectmail?campaign=tag - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Stuck on Hello World, with non-FAQ Problem
- Make sure you xml declaration in helloworld.xml is ?xml version=1.0? (in your email it reads: ?xml version=1.0, missing the ending ? - hopefully that was just a typo. - Try adding to your xsl: xsl:template match=/ xsl:apply-templates select=document/ /xsl:template Doing those two things, it works fine. If that doesn't fix it, I'd reccomend: - Add the error page back in to your stripped down pipeline. - stop tomcat, while it's down delete your cache-dir (probably under $TOMCAT_HOME/work - the default). - monitor your access.log, and on startup core.log to confirm that things are starting and processing correctly without errors. (I often do tail -f access.log while testing pages in a browser in another window). Geoff Howard __ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos More http://faith.yahoo.com - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]