cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christofer Dutz <d...@c-ware.de>
Subject Re: Still: "Class cannot be casted to array" with CForms
Date Sat, 21 May 2005 14:46:57 GMT
Mabe I should post my questions earlier.
Everytime I have a problem I try to figure it out myself and this 
results in days of work. Then, after giving up I post my question and 
half an hour later I sovle it. Don't know why.
In my form definition I wanted to make sure that exactly one button is 
selected, so I added the
           <fd:validation>
               <fd:value-count exact="1"/>
           </fd:validation>
part. After removing It everything worked fine, except that now I can't 
make sure that a field is selected, but I think I'll figure that out 
about half an hour after this post.
Don't know why I didn't find this earlier, since I commented the 
validation stuff out yesterday.

Chris

Christofer Dutz wrote:

> Hi,
>
> I am still having problems with CForm fields with selection lists.
> Everytime I set a value I get "Class cannot be casted to array" 
> exceptions.
> Here the code-parts I am using (I am using the xsl-files in the cocoon
> form-block sample/resource directory)
> Everything else is working fine except these stupid errors :(
>
> Form-Definition:
>        <fd:field id="alternateFormat" required="false">
>            <fd:label>Falls A7 zur Zeit nicht lieferbar ist, erhalte ich
> zum gleichen Preis das entsprechende im größeren Format Din 
> A6:</fd:label>
>            <fd:datatype base="string"/>
>            <fd:validation>
>                <fd:value-count exact="1"/>
>            </fd:validation>
>            <fd:selection-list>
>                <fd:item value="yes">
>                    <fd:label>damit bin ich einverstanden</fd:label>
>                </fd:item>
>                <fd:item value="no">
>                    <fd:label>ich warte bis zur Lieferbarkeit</fd:label>
>                </fd:item>
>            </fd:selection-list>
>        </fd:field>
>
> Template-File:
>            <ft:widget id="alternateFormat">
>                <fi:styling list-type="radio"
> list-orientation="horizontal"/>
>            </ft:widget>
> (Tried without the radio-button hint, but doesn't change anything)
>
> Flowscript:
> function showCart() {
>    // Initialize the forms and create their corresponding bindings.
>    var cartForm = new Form("shop/forms/shoppingCartForm.xml");
>    //cartForm.createBinding("shop/bindings/shoppingCartBinding.xml");
>    //cartForm.load(cart);
>    cartForm.showForm("shop/shoppingCartTemplate.jexl");
> }
>
> Output HTML-code generated by the system:
>    <span title=""><input value="yes" name="alternateFormat" id="N1007C"
> type="radio"><label title="" for="N1007C">damit bin ich
> einverstanden</label><input value="no" name="alternateFormat"
> id="N10080" type="radio"><label title="" for="N10080">ich warte bis zur
> Lieferbarkeit</label></span>
>
> As soon as I select any raido-button or select any item from the
> drop-down-list I get thisexception. I am REALY DESPERATE ... if I don't
> get this working, I will have to quit th entire CForms stuff and go back
> to my first solution using some pretty ugly XSP and JSP solution.
>
>
>  Internal Server Error
>
> Message: Class cannot be casted to array
>
> Description: org.apache.avalon.framework.CascadingRuntimeException:
> uncaught JavaScript exception: at
> (resource://org/apache/cocoon/forms/flow/javascript/Form.js, Line 144):
> java.lang.ClassCastException: Class cannot be casted to array
>
> Sender: org.apache.cocoon.servlet.CocoonServlet
>
> Source: Cocoon Servlet
>
> Request URI
>
> shop/152c5874097b3049724474697d455b8a888b2735.continue
>
> cause
>
> java.lang.ClassCastException: Class cannot be casted to array
>
> request-uri
>
> /shop/152c5874097b3049724474697d455b8a888b2735.continue
>
> full exception chain stacktrace
>
> org.apache.avalon.framework.CascadingRuntimeException: uncaught 
> JavaScript exception:
> at  (resource://org/apache/cocoon/forms/flow/javascript/Form.js, Line 
> 144):
> java.lang.ClassCastException: Class cannot be casted to array
>     at 
> org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.handleContinuation(FOM_JavaScriptInterpreter.java:853)

>
>     at 
> org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:123)

>
>     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:138)

>
>     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:243)

>
>     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.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:138)

>
>     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:243)

>
>     at org.apache.cocoon.Cocoon.process(Cocoon.java:608)
>     at 
> org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1123)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
>     at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)

>
>     at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

>
>     at 
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75) 
>
>     at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)

>
>     at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

>
> Caused by: java.lang.ClassCastException: Class cannot be casted to array
>     at 
> org.apache.cocoon.forms.datatype.validationruleimpl.ValueCountValidationRule.validate(ValueCountValidationRule.java:60)

>
>     at 
> org.apache.cocoon.forms.validation.impl.ValidationRuleValidator.validate(ValidationRuleValidator.java:54)

>
>     at 
> org.apache.cocoon.forms.formmodel.AbstractWidgetDefinition.validate(AbstractWidgetDefinition.java:221)

>
>     at 
> org.apache.cocoon.forms.formmodel.AbstractWidget.validate(AbstractWidget.java:289) 
>
>     at org.apache.cocoon.forms.formmodel.Field.doValidate(Field.java:333)
>     at org.apache.cocoon.forms.formmodel.Field.validate(Field.java:271)
>     at 
> org.apache.cocoon.forms.formmodel.WidgetList.validate(WidgetList.java:103) 
>
>     at 
> org.apache.cocoon.forms.formmodel.AbstractContainerWidget.validate(AbstractContainerWidget.java:110)

>
>     at org.apache.cocoon.forms.formmodel.Form.validate(Form.java:304)
>     at org.apache.cocoon.forms.formmodel.Form.process(Form.java:268)
>     at 
> jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown

> Source)
>     at 
> java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown

> Source)
>     at 
> org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:230)
>     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.mozilla.javascript.ScriptableObject.callMethod(ScriptableObject.java:1591) 
>
>     at 
> org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.handleContinuation(FOM_JavaScriptInterpreter.java:843)

>
>     at 
> org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:123)

>
>     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:138)

>
>     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)

>
>
> stacktrace
>
> java.lang.ClassCastException: Class cannot be casted to array
>     at 
> org.apache.cocoon.forms.datatype.validationruleimpl.ValueCountValidationRule.validate(ValueCountValidationRule.java:60)

>
>     at 
> org.apache.cocoon.forms.validation.impl.ValidationRuleValidator.validate(ValidationRuleValidator.java:54)

>
>     at 
> org.apache.cocoon.forms.formmodel.AbstractWidgetDefinition.validate(AbstractWidgetDefinition.java:221)

>
>     at 
> org.apache.cocoon.forms.formmodel.AbstractWidget.validate(AbstractWidget.java:289) 
>
>     at org.apache.cocoon.forms.formmodel.Field.doValidate(Field.java:333)
>     at org.apache.cocoon.forms.formmodel.Field.validate(Field.java:271)
>     at 
> org.apache.cocoon.forms.formmodel.WidgetList.validate(WidgetList.java:103) 
>
>     at 
> org.apache.cocoon.forms.formmodel.AbstractContainerWidget.validate(AbstractContainerWidget.java:110)

>
>     at org.apache.cocoon.forms.formmodel.Form.validate(Form.java:304)
>     at org.apache.cocoon.forms.formmodel.Form.process(Form.java:268)
>     at 
> jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown

> Source)
>     at 
> java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown

> Source)
>     at 
> org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:230)
>     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.mozilla.javascript.ScriptableObject.callMethod(ScriptableObject.java:1591) 
>
>     at 
> org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.handleContinuation(FOM_JavaScriptInterpreter.java:843)

>
>     at 
> org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:123)

>
>     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:138)

>
>     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)

>
>
> Apache Cocoon 2.1.7 <http://cocoon.apache.org/>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>



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


Mime
View raw message