cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kaj Kandler <KajKand...@Conficio.com>
Subject Re: NPE when styling a textarea
Date Wed, 17 May 2006 21:37:07 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Well when you need the solution, you start debugging and try to fix the
problem (thank god it is open source !)

Here is my hack for the Null Pointer Exceptions.

EffectWidgetReplacingPipe.java
- ---- line 973 ---
            if (elementNesting == 0 && styling != null) {
                styling.toSAX(getContentHandler());
            }
- -----
EffectPipe.java
- ---- line 487 ---
        locators.addFirst(locator);
        if (locator != null) {
        	locator = new LocatorImpl(locator);
        }
        this.buffer = new SaxBuffer();
- -----

I'm not sure this is the best or correct fix. At least it works for me
for now. It appears that under certain circumstances, the buffers don't
get put in the list and the locations neither. I guess the real issue is
 someplace else and needs to be fixed by someone more knowledgeable.

Hope this helps someone else.

Kaj
P.S.: See full modified *.java files attached (originals release 2.1.8)


Kaj Kandler wrote:
> Oh my god!
> 
> This has been raised in the developer list pre 2.1.8 release as a
> regression issue.
> 
> http://www.mail-archive.com/dev@cocoon.apache.org/msg35389.html
> 
> Does anybody know the solution, or does nobody use 2.1.8 and textarea?
> 
> Kaj
> 
> Kaj Kandler wrote:
>>> Hi there,
>>> I'm using 2.1.8 and have trouble styling a form field as textarea.
>>>
>>>      <ft:widget id="question">
>>>       	<fi:styling type="textarea" rows="40" cols="10"/>
>>>      </ft:widget>
>>>
>>> I'm getting a null pointer exception. Any ideas why? Does someone know a
>>> solution?
>>> ---
>>> java.lang.NullPointerException
>>> file:/D:/M_Drive/WorkspaceCocoon/Plan-B4OOo/webapp/OpenOffice/resources/stylesheets/video-page2xhtml.xsl
>>> - 274:38
>>>
>>> Failed to process pipeline
>>> file:/D:/M_Drive/WorkspaceCocoon/Plan-B4OOo/webapp/OpenOffice/resources/stylesheets/video-page2xhtml.xsl
>>> - 274:38	[TransformerException]
>>> file:/D:/M_Drive/WorkspaceCocoon/Plan-B4OOo/webapp/OpenOffice/sitemap.xmap
>>> - 129:33	<map:serialize type="xml">
>>> file:/D:/M_Drive/WorkspaceCocoon/Plan-B4OOo/webapp/OpenOffice/sitemap.xmap
>>> - 415:41	<map:transform type="jx">
>>> file:/D:/M_Drive/WorkspaceCocoon/Plan-B4OOo/webapp/OpenOffice/sitemap.xmap
>>> - 414:47	<map:transform type="forms">
>>> file:/D:/M_Drive/WorkspaceCocoon/Plan-B4OOo/webapp/OpenOffice/sitemap.xmap
>>> - 410:81	<map:transform>
>>> file:/D:/M_Drive/cocoon-2.1.8/build/webapp/sitemap.xmap - 659:76	<map:mount>
>>> resource://org/apache/cocoon/forms/flow/javascript/Form.js - 184:-1
>>> file:/D:/M_Drive/WorkspaceCocoon/Plan-B4OOo/webapp/OpenOffice/resources/forms/question_form.js
>>> - 10:-1
>>> file:/D:/M_Drive/WorkspaceCocoon/Plan-B4OOo/webapp/OpenOffice/sitemap.xmap
>>> - 422:35	<map:call>
>>> file:/D:/M_Drive/cocoon-2.1.8/build/webapp/sitemap.xmap - 659:76
>>> ---
>>> org.apache.cocoon.ProcessingException: Failed to process pipeline
>>> 	at [TransformerException] -
>>> file:/D:/M_Drive/WorkspaceCocoon/Plan-B4OOo/webapp/OpenOffice/resources/stylesheets/video-page2xhtml.xsl:274:38
>>> 	at <map:serialize type="xml"> -
>>> file:/D:/M_Drive/WorkspaceCocoon/Plan-B4OOo/webapp/OpenOffice/sitemap.xmap:129:33
>>> 	at <map:transform type="jx"> -
>>> file:/D:/M_Drive/WorkspaceCocoon/Plan-B4OOo/webapp/OpenOffice/sitemap.xmap:415:41
>>> 	at <map:transform type="forms"> -
>>> file:/D:/M_Drive/WorkspaceCocoon/Plan-B4OOo/webapp/OpenOffice/sitemap.xmap:414:47
>>> 	at <map:transform> -
>>> file:/D:/M_Drive/WorkspaceCocoon/Plan-B4OOo/webapp/OpenOffice/sitemap.xmap:410:81
>>> 	at <map:mount> -
>>> file:/D:/M_Drive/cocoon-2.1.8/build/webapp/sitemap.xmap:659:76
>>> 	at resource://org/apache/cocoon/forms/flow/javascript/Form.js:184:-1
>>> 	at
>>> file:/D:/M_Drive/WorkspaceCocoon/Plan-B4OOo/webapp/OpenOffice/resources/forms/question_form.js:10:-1
>>> 	at <map:call> -
>>> file:/D:/M_Drive/WorkspaceCocoon/Plan-B4OOo/webapp/OpenOffice/sitemap.xmap:422:35
>>> 	at <map:mount> -
>>> file:/D:/M_Drive/cocoon-2.1.8/build/webapp/sitemap.xmap:659:76
>>> 	at
>>> org.apache.cocoon.ProcessingException.throwLocated(ProcessingException.java:144)
>>> 	at
>>> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.handleException(AbstractProcessingPipeline.java:951)
>>> 	at
>>> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:582)
>>> 	at
>>> org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:183)
>>> 	at
>>> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:480)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:120)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.ContainerNode.invoke(ContainerNode.java:31)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.sitemap.TransformNode.invoke(TransformNode.java:84)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:142)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:234)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:176)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:248)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:117)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:107)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:142)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:234)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.handleCocoonRedirect(ConcreteTreeProcessor.java:298)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.access$000(ConcreteTreeProcessor.java:47)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor$TreeProcessorRedirector.cocoonRedirect(ConcreteTreeProcessor.java:339)
>>> 	at
>>> org.apache.cocoon.environment.ForwardRedirector.redirect(ForwardRedirector.java:59)
>>> 	at
>>> org.apache.cocoon.components.flow.AbstractInterpreter.forwardTo(AbstractInterpreter.java:209)
>>> 	at
>>> org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.forwardTo(FOM_JavaScriptInterpreter.java:906)
>>> 	at
>>> org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon.forwardTo(FOM_Cocoon.java:698)
>>> 	at
>>> org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon.jsFunction_sendPage(FOM_Cocoon.java:269)
>>> 	at inv8.invoke()
>>> 	at org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:523)
>>> 	at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:438)
>>> 	at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
>>> 	at
>>> org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:1134)
>>> 	at
>>> org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:190)
>>> 	at
>>> org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:138)
>>> 	at
>>> org.mozilla.javascript.continuations.InterpretedFunctionImpl.call(InterpretedFunctionImpl.java:121)
>>> 	at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
>>> 	at
>>> org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.callFunction(FOM_JavaScriptInterpreter.java:758)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:138)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:142)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:234)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:176)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:248)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:117)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:107)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:142)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:234)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:176)
>>> 	at
>>> org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:248)
>>> 	at org.apache.cocoon.Cocoon.process(Cocoon.java:679)
>>> 	at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1154)
>>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>>> 	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:358)
>>> 	at
>>> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
>>> 	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
>>> 	at org.mortbay.http.HttpContext.handle(HttpContext.java:1807)
>>> 	at
>>> org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:525)
>>> 	at org.mortbay.http.HttpContext.handle(HttpContext.java:1757)
>>> 	at org.mortbay.http.HttpServer.service(HttpServer.java:879)
>>> 	at org.mortbay.http.HttpConnection.service(HttpConnection.java:789)
>>> 	at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:960)
>>> 	at org.mortbay.http.HttpConnection.handle(HttpConnection.java:806)
>>> 	at
>>> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:218)
>>> 	at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:300)
>>> 	at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:511)
>>> Caused by: org.apache.commons.lang.exception.NestableRuntimeException:
>>> javax.xml.transform.TransformerException: java.lang.NullPointerException
>>> 	at
>>> org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTransformer.java:603)
>>> 	at
>>> org.apache.cocoon.sitemap.ContentAggregator.generate(ContentAggregator.java:135)
>>> 	at
>>> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:578)
>>> 	... 77 more
>>> Caused by: javax.xml.transform.TransformerException:
>>> java.lang.NullPointerException
>>> 	at
>>> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2416)
>>> 	at
>>> org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374)
>>> 	at
>>> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
>>> 	at
>>> org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374)
>>> 	at
>>> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
>>> 	at
>>> org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374)
>>> 	at
>>> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
>>> 	at
>>> org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374)
>>> 	at
>>> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
>>> 	at
>>> org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374)
>>> 	at
>>> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
>>> 	at org.apache.xalan.templates.ElemTemplate.execute(ElemTemplate.java:392)
>>> 	at
>>> org.apache.xalan.templates.ElemCallTemplate.execute(ElemCallTemplate.java:246)
>>> 	at
>>> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
>>> 	at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:139)
>>> 	at
>>> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
>>> 	at
>>> org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374)
>>> 	at
>>> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
>>> 	at
>>> org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374)
>>> 	at
>>> org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:393)
>>> 	at
>>> org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:176)
>>> 	at
>>> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
>>> 	at
>>> org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2281)
>>> 	at
>>> org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1367)
>>> 	at
>>> org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3458)
>>> 	at
>>> org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:406)
>>> 	at
>>> org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:55)
>>> 	at
>>> org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTransformer.java:585)
>>> 	... 79 more
>>> Caused by: java.lang.NullPointerException
>>> 	at
>>> org.apache.cocoon.forms.transformation.EffectWidgetReplacingPipe$StylingContentHandler.endElement(EffectWidgetReplacingPipe.java:967)
>>> 	at
>>> org.apache.cocoon.forms.formmodel.AbstractWidget.generateSaxFragment(AbstractWidget.java:500)
>>> 	at
>>> org.apache.cocoon.forms.transformation.EffectWidgetReplacingPipe$WidgetHandler.endElement(EffectWidgetReplacingPipe.java:528)
>>> 	at
>>> org.apache.cocoon.forms.transformation.EffectPipe.endElement(EffectPipe.java:534)
>>> 	at
>>> org.apache.xml.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.java:261)
>>> 	at
>>> org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1399)
>>> 	at
>>> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
>>> 	... 106 more
>>> -------
>>>
>>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> --
> KajKandler@Conficio.com
> 
> -----------------------------------------------------
> |  We produce animated software manuals that click  |
> -----------------------------------------------------
>  Conficio
>  http://www.conficio.com/
>  P.O.Box 761062,  Melrose,
>  MA 02176
> 

- ---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


- --
KajKandler@Conficio.com

- -----------------------------------------------------
|  We produce animated software manuals that click  |
- -----------------------------------------------------
 Conficio
 http://www.conficio.com/
 P.O.Box 761062,  Melrose,
 MA 02176

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)

iD8DBQFEa5eDRDUvrJRNjTARAic7AJ4vmslggjIz6GhZMOJAoVmrClc1bACeMMUa
9/TlfghGyJHWUGVmSal6DpE=
=Vm1M
-----END PGP SIGNATURE-----

Mime
View raw message