You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Derek Hohls <DH...@csir.co.za> on 2004/02/17 14:19:47 UTC

[SOLVED] NullPointerException for FormValidatorAction ?

Changed 2 things:

1. The parameter names in the validation file did not match those on
the form input fields, and

2.     The  <map:parameter name="constraint-set" value="{2}" />
       entry in the sitemap should be
        <map:parameter name="validate-set" value="{2}" />
      (which I think is confusing, considering the tag is called
"constraint-set", but anyway....)

In case anyone was wondering .... ;-)

>>> DHohls@CSIR.CO.ZA 2004/02/17 03:02:52 PM >>>
I am trying to perform a form validation using a
file and sitemap entry with parameters, and am 
getting a null pointer error when I try and display
the page with the "blank" form:

sitemap extracts:

...
  <map:actions>
    <map:action name="form-validator" 
src="org.apache.cocoon.acting.FormValidatorAction"/>
    </map:actions>
...
      <map:match pattern="mng/forms/*_*">
       <!-- validate data for new entry -->
       <map:act type="form-validator">
         <map:parameter name="descriptor"
value="context://ethek/db-metadata.xml" />
         <map:parameter name="constraint-set" value="{2}" />
         ...
        </map:act>
     </map:match>


db-metadata.xml:   (in the root folder of the app)

<?xml version="1.0"?>
<page>
<parameter name="TriggerID"   type="long"   nullable="no"/>
<parameter name="TriggerDesc" type="string" nullable="no"
max-len="100"
/>
<constraint-set name="legaltrigger">
  <validate name="TriggerID"/>
  <validate name="TriggerDesc"/>  
</constraint-set>
</page>



ERROR LOG:

ERROR   (2004-02-17) 14:36.41:489   [sitemap.handled-errors]
(/cocoon21/ethek/mng/forms/add_legaltrigger)
http8080-Processor3/PipelineNode: 
java.lang.NullPointerException
	at
org.apache.cocoon.acting.FormValidatorAction.createMapOfParameters(FormValidatorAction.java:87)
	at
org.apache.cocoon.acting.AbstractValidatorAction.act(AbstractValidatorAction.java:284)
	at
org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.invoke(ActTypeNode.java:152)
	at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)
	at
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:164)
	at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)
	at
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:164)
	at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
	at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:163)
	at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
	at
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:152)
	at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:354)
	at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:307)
	at
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:133)
	at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)
	at
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:164)
	at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
	at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:163)
	at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
	at
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:152)
	at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:354)
	at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:307)
	at org.apache.cocoon.Cocoon.process(Cocoon.java:656)
	at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1112)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
	at java.lang.Thread.run(Thread.java:534)

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.


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


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.


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


Re: [SOLVED] NullPointerException for FormValidatorAction ?

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Joerg Heinicke wrote:

> On 17.02.2004 14:19, Derek Hohls wrote:
>
>> 2.     The  <map:parameter name="constraint-set" value="{2}" />
>>        entry in the sitemap should be
>>         <map:parameter name="validate-set" value="{2}" />
>>       (which I think is confusing, considering the tag is called
>> "constraint-set", but anyway....)
>
>
> I have fixed the NPE in the CVS, now you will get at least an 
> expressive error message: 
> http://marc.theaimsgroup.com/?l=xml-cocoon-cvs&m=107947310920651&w=4.
>
> With this message I also want to raise the other issue on the dev 
> list: What about renaming the validate-set to constraint-set for 
> consistency? The descriptor contains a constraint-set element with 
> validate child elements, but in the sitemap the pointer to the 
> constraint-set is named validate-set. I would like to change this 
> including a deprecation phase for validate-set of course.


No objections whatsoever.

Vadim



Re: [SOLVED] NullPointerException for FormValidatorAction ?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 17.02.2004 14:19, Derek Hohls wrote:

> 2.     The  <map:parameter name="constraint-set" value="{2}" />
>        entry in the sitemap should be
>         <map:parameter name="validate-set" value="{2}" />
>       (which I think is confusing, considering the tag is called
> "constraint-set", but anyway....)

I have fixed the NPE in the CVS, now you will get at least an expressive 
error message: 
http://marc.theaimsgroup.com/?l=xml-cocoon-cvs&m=107947310920651&w=4.

With this message I also want to raise the other issue on the dev list: 
What about renaming the validate-set to constraint-set for consistency? 
The descriptor contains a constraint-set element with validate child 
elements, but in the sitemap the pointer to the constraint-set is named 
validate-set. I would like to change this including a deprecation phase 
for validate-set of course.

Joerg

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


Re: [SOLVED] NullPointerException for FormValidatorAction ?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 17.02.2004 14:19, Derek Hohls wrote:

> 2.     The  <map:parameter name="constraint-set" value="{2}" />
>        entry in the sitemap should be
>         <map:parameter name="validate-set" value="{2}" />
>       (which I think is confusing, considering the tag is called
> "constraint-set", but anyway....)

I have fixed the NPE in the CVS, now you will get at least an expressive 
error message: 
http://marc.theaimsgroup.com/?l=xml-cocoon-cvs&m=107947310920651&w=4.

With this message I also want to raise the other issue on the dev list: 
What about renaming the validate-set to constraint-set for consistency? 
The descriptor contains a constraint-set element with validate child 
elements, but in the sitemap the pointer to the constraint-set is named 
validate-set. I would like to change this including a deprecation phase 
for validate-set of course.

Joerg