Unless you changed the spring application context that is auto-generated using 
the cocoon block archetype you should use:

http://localhost:8888/mysite/test.html

Robby

From: Lars Huttar [mailto:lars_hut...@sil.org]
Sent: Thursday, March 22, 2012 4:55 PM
To: users@cocoon.apache.org
Cc: Francesco Chicchiriccò
Subject: Re: [C3] Working with archetypes [Was Re: parent of parent artifact?]

Francesco,
Thanks for your patience. I feel like I'm very close, but I apparently still 
don't have some of the concept understood correctly, because things are not 
working for me.

I generated the myparent, mysite, and mywebapp artifacts as described in your 
instructions at http://markmail.org/message/d6m2yidkrfqkslo2 part C.

Then I went into mysite (instead of mywebapp) and ran mvn jetty:run.
Then I created a sitemap in mysite/src/main/resource/COB-INF and gave it a 
simple match pattern:
      <map:match pattern="test.html">
        <map:read src="test.html" />
      </map:match>

But when I try to exercise this test, by going to 
http://localhost:8888/test.html in the browser, I get an empty response (200 OK 
status but zero bytes of content), and the following error in 
mysite\target\work\log\cocoon.log:
2012-03-22 10:32:22,026 ERROR 24024212@qtp-19118752-2 
org.apache.cocoon.servlet.XMLSitemapServlet - Cocoon can't process the request.
org.apache.cocoon.sitemap.NoMatchingPipelineException: No pipeline matched the 
request '/test.html'

Here is a little more context from the log (note that e-17-pub is my version of 
mysite):

2012-03-22 10:32:22,022 DEBUG 24024212@qtp-19118752-2 
org.apache.cocoon.servletservice.DispatcherServlet - DispatcherServlet: service 
servlet=org.apache.cocoon.servlet.XMLSitemapServlet@980484 mountPath= 
servletPath= pathInfo=/test.html
2012-03-22 10:32:22,022 INFO  24024212@qtp-19118752-2 
org.apache.cocoon.servlet.RequestProcessor - Performing GET request at 
/test.html
2012-03-22 10:32:22,022 DEBUG 24024212@qtp-19118752-2 
org.apache.cocoon.servlet.RequestProcessor - The base URL for this request is 
file:/C:/Users/HuttarL/Documents/work/c3/theParent/e-17-pub/./src/main/resources/COB-INF/<file:///C:\Users\HuttarL\Documents\work\c3\theParent\e-17-pub\src\main\resources\COB-INF\>
2012-03-22 10:32:22,023 DEBUG 24024212@qtp-19118752-2 
org.apache.cocoon.sitemap.node.AbstractSitemapNode - 
PipelinesNode.invoke(/test.html)
2012-03-22 10:32:22,023 DEBUG 24024212@qtp-19118752-2 
org.apache.cocoon.sitemap.node.AbstractSitemapNode - 
PipelineNode(caching).invoke(/test.html)
2012-03-22 10:32:22,024 DEBUG 24024212@qtp-19118752-2 
org.apache.cocoon.sitemap.node.AbstractSitemapNode - 
MatchNode.invoke(/test.html)
2012-03-22 10:32:22,024 DEBUG 24024212@qtp-19118752-2 
org.apache.cocoon.sitemap.node.MatchNode$MatcherContext - Matching: 
expression=, testValue=test.html, result=null
2012-03-22 10:32:22,024 INFO  24024212@qtp-19118752-2 
org.apache.cocoon.servlet.RequestProcessor - Sitemap execution for /test.html 
took 1.549768 ms.
2012-03-22 10:32:22,026 ERROR 24024212@qtp-19118752-2 
org.apache.cocoon.servlet.XMLSitemapServlet - Cocoon can't process the request.
org.apache.cocoon.sitemap.NoMatchingPipelineException: No pipeline matched the 
request '/test.html'
    at 
org.apache.cocoon.sitemap.node.PipelinesNode.invoke(PipelinesNode.java:55) 
~[cocoon-sitemap-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]


Notice that the base URL for the request is 
e-17-pub/./src/main/resources/COB-INF/
yet Cocoon doesn't seem to be looking at 
e-17-pub/./src/main/resources/COB-INF/sitemap.xmap.

Any ideas? Is it really running the webapp instead of the block? In that case 
do I need to put a mount command (or equivalent) in the webapp's sitemap to 
direct URLs to my block?

Thanks,
Lars


On 3/22/2012 6:29 AM, Francesco Chicchiriccò wrote:
On 21/03/2012 21:09, Lars Huttar wrote:
[...]
Thank you, that is definitely clearer.
So I do my development in blocks, not in the webapp; the webapp is for 
packaging for external deployment.

The one thing I'm not clear on, then, is this part of your instructions: 
(http://markmail.org/message/d6m2yidkrfqkslo2 for full context)



C) If you want to develop a complete C3 web application

You need to generate a multimodule maven project [2] with the following 
structure:

myparent/
  mysite/
  mywebapp/
...


Now you can finally

cd mywebapp
mvn jetty:run

Why is this telling me to run jetty in mywebapp, instead of in mysite?
Maybe that's just a red herring (not important), but it has me confused.

Running "mvn jetty:run" in each of your blocks (i.e. mysite) will let you 
develop and test each single block.
If you want to look how the final webapp assembles everything together, you 
will have to run "mvn jetty:run" under mywebapp.

Having a single block (like as in your case) the two things above are 
equivalent.

Regards.


--

Francesco Chicchiriccò



Apache Cocoon PMC and Apache Syncope PPMC Member

http://people.apache.org/~ilgrosso/<http://people.apache.org/%7Eilgrosso/>

Reply via email to