I sent this email at the start of the weekend, so it may not have been seen much. However the NPE is blocking progress, so I'd like to see if anyone can help me with it.
Anybody have ideas?

After the difficulties of the last week or two, I'm starting to wonder if we'd be better off going back to Cocoon 2.1.11. A colleague asked me, why take the risk and time to move to Cocoon 3, when we have Cocoon 2.1.11 working well? I gave the standard "2.1.11 is several years old and will be increasingly unsupported" answer, but I had to admit that the decision was not looking as good now as it seemed last summer when C3 had a recent new alpha and even a beta candidate.

Please don't take this as criticism of the Cocoon developers ... I have been continually impressed at the readiness of the committers to debug problems quickly and implement fixes. However I do wonder whether there is just too much debugging left, to reach a stable state in time for our work. Also I am concerned that since there doesn't seem to be a roadmap for feature freeze, there may be no point at which bugs will settle down so that a stable release can be completed.

Lars


On 3/23/2012 3:08 PM, Lars Huttar wrote:
Hello,

I'm attempting to port our Cocoon 2.1.11 sitemap to C3, little by little.
So far I have gotten a very simple pipeline to work:
<map:match pattern="test.html">
<map:read src="test.html" />
</map:match>
Hooray!

However when I get a little more complicated, I get an exception:
<!-- {map:1} = generator name, {map:2} = param, {map:3} = value -->
<map:match pattern="generator/*/*/*/source">
<map:generate src="generators/{map:1}.xml" />
<map:serialize type="xml"/>
</map:match>

The "{map:1}" used to be just "{1}", but from the c3 samples it looks like we now should use "{map:1}". Fine. But when I try to call this pipeline, using "" in the browser, I get an empty response (status 200 OK, but zero bytes of content). And the cocoon.log has the following error (shown with preceding context):

2012-03-23 14:33:30,598 DEBUG 11202659@qtp-14536088-0 org.apache.cocoon.sitemap.node.MatchNode$MatcherContext - Matching: expression=generator/*/*/*/source, testValue=generator/languages-in-country/country_id/77/source, result={3=77, 2=country_id, 1=languages-in-country, 0=generator/languages-in-country/country_id/77/source} 2012-03-23 14:33:30,598 DEBUG 11202659@qtp-14536088-0 org.apache.cocoon.sitemap.node.AbstractSitemapNode - GenerateNode(src=generators/{map:1}.xml, type=url).invoke(/generator/languages-in-country/country_id/77/source) 2012-03-23 14:33:30,598 DEBUG 11202659@qtp-14536088-0 org.apache.cocoon.pipeline.AbstractPipeline - Adding component XMLGenerator(hashCode=29969233 internalGenerator=URLGenerator(hashCode=19145797 source=file:/C:/Users/HuttarL/Documents/work/c3/theParent/ethnologue-17-pub/src/main/resources/COB-INF/generators/languages-in-country.xml)) to pipeline [CachingPipeline(hashCode=7335482 components=[])]. 2012-03-23 14:33:30,598 DEBUG 11202659@qtp-14536088-0 org.apache.cocoon.sitemap.node.AbstractSitemapNode - SerializeNode(type=xml).invoke(/generator/languages-in-country/country_id/77/source) 2012-03-23 14:33:30,598 DEBUG 11202659@qtp-14536088-0 org.apache.cocoon.pipeline.AbstractPipeline - Adding component XMLSerializer(hashCode=8467590) to pipeline [CachingPipeline(hashCode=7335482 components=[XMLGenerator(hashCode=29969233 internalGenerator=URLGenerator(hashCode=19145797 source=file:/C:/Users/HuttarL/Documents/work/c3/theParent/ethnologue-17-pub/src/main/resources/COB-INF/generators/languages-in-country.xml))])]. 2012-03-23 14:33:30,599 INFO 11202659@qtp-14536088-0 org.apache.cocoon.servlet.RequestProcessor - Sitemap execution for /generator/languages-in-country/country_id/77/source took 2.818942 ms. 2012-03-23 14:33:30,600 ERROR 11202659@qtp-14536088-0 org.apache.cocoon.servlet.XMLSitemapServlet - Cocoon can't process the request.
java.lang.NullPointerException: null
at org.apache.cocoon.servlet.collector.ResponseHeaderCollector.isModifiedResponse(ResponseHeaderCollector.java:176) ~[cocoon-servlet-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT] at org.apache.cocoon.servlet.RequestProcessor.sendSitemapResponse(RequestProcessor.java:354) ~[cocoon-servlet-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT] at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:92) ~[cocoon-servlet-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT] at org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:54) ~[cocoon-servlet-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) [servlet-api-2.5-20081211.jar:na]

Up to the error, everything seems to be going great: the source is expanded to "file:/C:/.../generators/languages-in-country.xml", which is a file that does exist, I double-checked.


I also tried using named parameters, following the samples' example:
<map:match pattern="generator/{genName}/{paramName}/{value}/source">
<map:generate src="generators/{map:genName}.xml" />

But the result was the same.

So my questions are, (1) How to fix this NPE? but also (2) why do I see an empty HTTP response (status 200 OK) in the browser for certain errors (like this one), instead of an error message in the browser? Some errors do show up in the browser, but not this one.

Thanks for any help.

Lars



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to