cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "angeloimm" <angelo...@libero.it>
Subject Re:Binding problem
Date Fri, 26 Nov 2004 11:18:14 GMT
No ideas??

---------- Initial Header -----------

>From      : "angeloimm" angeloimm@libero.it
To          : "Help Cocoon" users@cocoon.apache.org
Cc          : 
Date      : Fri, 26 Nov 2004 09:42:08 +0100
Subject : Binding problem

> Hi all; i'm tring binding framework; i have this form-model:
> 
> <fd:form id="defConf" xmlns:fd="http://apache.org/cocoon/forms/1.0#definition">
>   <fd:widgets>
>     <fd:repeater id="modules">
>       <fd:widgets>
>         <fd:field id="id" required="false">
>           <fd:label>Nome modulo</fd:label>
>           <fd:help>Nome del modulo</fd:help>
>           <fd:datatype base="string"/>
>         </fd:field>
>         <fd:field id="ipAddress" required="false">
>           <fd:label>Indirizzo IP</fd:label>
>           <fd:datatype base="string"/>
>         </fd:field>
>         <fd:field id="port">
>           <fd:label>Numero porta</fd:label>
>           <fd:datatype base="string"/>
>         </fd:field>
>         <fd:field id="webAppRoot">
>           <fd:label>Root web application</fd:label>
>           <fd:datatype base="string"/>
>         </fd:field>
>       </fd:widgets>
>     </fd:repeater>
>   </fd:widgets>
> </fd:form>
> 
> This is my binding file:
> 
> <fb:context id="defConf" xmlns:fb="http://apache.org/cocoon/forms/1.0#binding" path="/">
>   <fb:repeater id="modules" parent-path="." row-path="modules" unique-row-id="id"
unique-path="@id">
>     <fb:on-bind>
>       <fb:value id="id" path="id"/>
>       <fb:value id="ipAddress" path="ipAddress"/>
>       <fb:value id="port" path="port"/>
>       <fb:value id="webAppRoot" path="webAppRoot"/>
>     </fb:on-bind>
>     <fb:on-delete-row>
>       <fb:delete-node/>
>     </fb:on-delete-row>
>   </fb:repeater>
> </fb:context>
> 
> My form template is this one:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0" xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
xmlns:fi="http://apache.org/cocoon/forms/1.0#instance">
>   <jx:import uri="resource://org/apache/cocoon/forms/generation/template.jx"/>
>   <title>Configurazione sistema Nikko</title>
>   <div style="margin-top:20px;">
>     <ft:repeater-size id="modules"/>
>     <table>
>       <tr>
>         <th>        </th>
>         <th>
>           <ft:repeater-widget-label id="modules" widget-id="id"/>
>         </th>
>         <th>
>           <ft:repeater-widget-label id="modules" widget-id="ipAddress"/>
>         </th>
>         <th>
>           <ft:repeater-widget-label id="modules" widget-id="port"/>
>         </th>
>         <th>
>           <ft:repeater-widget-label id="modules" widget-id="webAppRoot"/>
>         </th>
>       </tr>
>       <ft:repeater-widget id="modules">
>       <tr>
>         <td>
>           <ft:widget id="id" />
>         </td>
>       </tr>
>       <tr>
>         <td>
>           <ft:widget id="ipAddress" />
>         </td>
>       </tr>
>       <tr>
>         <td>
>           <ft:widget id="port" />
>         </td>
>       </tr>
>       <tr>
>         <td>
>           <ft:widget id="webAppRoot" />
>         </td>
>       </tr>
>       </ft:repeater-widget>
>     </table>
>   </div>
> </page>
> 
> The java bean i want to use is:
> 
> public class ConfigVO implements Serializable {
> 
>     private String id;
>     private String ipAddress;
>     private String portNumber;
>     private String webAppRoot;
> 
>     public ConfigVO(String newId, String newIpAddress, String newPortNumber,
>                     String newWebAppRoot) throws ConfigVOException {
> 
>         if ((!(checkString(newId))) || (!(checkString(newIpAddress))) ||
>             (!(checkString(newPortNumber))) || (!(checkString(newWebAppRoot)))) {
> 
>             throw new ConfigVOException("Exception in configuration parameter");
>         }
>         setId(newId);
>         setIpAddress(newIpAddress);
>         setPortNumber(newPortNumber);
>         setWebAppRoot(newWebAppRoot);
>     }
> 
>     public void setId(String value) {
> 
>         this.id = value;
>     }
> 
>     public String getId() {
> 
>         return id;
>     }
> 
>     public void setIpAddress(String value) {
> 
>         this.ipAddress = value;
>     }
> 
>     public String getIpAddress() {
> 
>         return ipAddress;
>     }
> 
>     public void setPortNumber(String value) {
> 
>         this.portNumber = value;
>     }
> 
>     public String getPortNumber() {
> 
>         return portNumber;
>     }
> 
>     public void setWebAppRoot(String value) {
> 
>         this.webAppRoot = value;
>     }
> 
>     public String getWebAppRoot() {
> 
>         return webAppRoot;
>     }
> 
>     private boolean checkString(String value) {
> 
>         return (value == null ? false : ((value.trim().equals("")) ? false : true));
>     }
> 
>     public boolean equals(Object object) {
> 
>         if (this.getClass().equals(object.getClass())) {
> 
>             ConfigVO con = ((ConfigVO) (object));
>             if ((checkString(con.getId(), this.getId())) &&
>                 (checkString(con.getIpAddress(), this.getIpAddress())) &&
>                 (checkString(con.getPortNumber(), this.getPortNumber())) &&
>                 (checkString(con.getWebAppRoot(), this.getWebAppRoot()))) {
> 
>                 return true;
>             }
>             return false;
>         }
>         return false;
>     }
> 
>     public String toString() {
> 
>         return "ConfigVO: " + this.id + " " + this.ipAddress + " " +
>                 this.portNumber + " " + this.webAppRoot;
>     }
> 
>     private boolean checkString(String aString, String anotherString) {
> 
>         return aString.equals(anotherString);
>     }
> }
> 
> In the flow script i have this method:
> 
> function confHome(){
> 
>   var log = Logger.getLogger( "Configurator.js" );
> 
>   log.info( "Getting all modules from interface inner class" );
>   var modules = ( ( Collection )( Configuration.Conf.getModuleCollection() ) );
>   var defConf = new Form("forms/defConf.xml");
>   var bindingURI = cocoon.parameters["bindingURI"];
>     if (bindingURI != null) {
> 
>         log.info( "bindingURI: "+ bindingURI );
>         defConf.createBinding(bindingURI);
>     }
>   for( var iteratore = ( ( Iterator )( modules.iterator() ) ); iteratore.hasNext(); ){
> 
>      defConf.load( ( ( ConfigVO )( iteratore.next() ) ) );
>   }
> }
> 
> Note that the variable called "modules" is a Java Collection of ConfigVO objects and
these objects have been valorized form the db.
> When i try this i have this error:
> 
> Internal Server Error
> Message: Failed to execute pipeline.
> 
> Description: org.apache.cocoon.ProcessingException: Failed to execute pipeline.: file:/C:/jboss-3.2.5/server/nikko/tmp/deploy/tmp58181NikkoCM.war/NikkoConfiguration/documents/defConf.jx:26:40:java.lang.NumberFormatException:
For input string: "length"
> 
> Sender: org.apache.cocoon.servlet.CocoonServlet
> 
> Source: Cocoon Servlet
> 
> Request URI
> 
> NikkoConfiguration/home
> 
> cause
> 
> java.lang.NumberFormatException: For input string: "length"
> 
> request-uri
> 
> /Nikko/NikkoConfiguration/home
> 
> 
> The full stack trace is:
> 
> 
> Original Exception: java.lang.NumberFormatException: For input string: "length"
> 	at org.apache.cocoon.generation.JXTemplateGenerator.call(Unknown Source)
> 	at org.apache.cocoon.generation.JXTemplateGenerator.execute(Unknown Source)
> 	at org.apache.cocoon.generation.JXTemplateGenerator.performGeneration(Unknown Source)
> 	at org.apache.cocoon.generation.JXTemplateGenerator.generate(Unknown Source)
> 	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(Unknown
Source)
> 	at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(Unknown
Source)
> 	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(Unknown
Source)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(Unknown Source)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(Unknown
Source)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(Unknown
Source)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(Unknown
Source)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(Unknown Source)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(Unknown
Source)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(Unknown Source)
> 	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(Unknown Source)
> 	at org.apache.cocoon.components.treeprocessor.TreeProcessor.handleCocoonRedirect(Unknown
Source)
> 	at org.apache.cocoon.components.treeprocessor.TreeProcessor.access$000(Unknown Source)
> 	at org.apache.cocoon.components.treeprocessor.TreeProcessor$TreeProcessorRedirector.cocoonRedirect(Unknown
Source)
> 	at org.apache.cocoon.environment.ForwardRedirector.redirect(Unknown Source)
> 	at org.apache.cocoon.components.flow.AbstractInterpreter.forwardTo(Unknown Source)
> 	at org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.forwardTo(Unknown
Source)
> 	at org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon.forwardTo(Unknown Source)
> 	at org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon.jsFunction_sendPage(Unknown
Source)
> 	at inv12.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(Unknown
Source)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(Unknown
Source)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(Unknown
Source)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(Unknown
Source)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(Unknown
Source)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(Unknown Source)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(Unknown
Source)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(Unknown Source)
> 	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(Unknown Source)
> 	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(Unknown Source)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(Unknown Source)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(Unknown
Source)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(Unknown
Source)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(Unknown
Source)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(Unknown Source)
> 	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(Unknown
Source)
> 	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(Unknown Source)
> 	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(Unknown Source)
> 	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(Unknown Source)
> 	at org.apache.cocoon.Cocoon.process(Unknown Source)
> 	at org.apache.cocoon.servlet.CocoonServlet.service(Unknown Source)
> 	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.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> 	at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
> 	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:72)
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
> 	at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:275)
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
> 	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
> 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
> 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
> 	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
> 	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
> 	at java.lang.Thread.run(Thread.java:534)
> etc.....
> 
> 
> The log4J output is:
> 
> 09:40:07,953 INFO  [js] Getting all modules from interface inner class
> 09:40:07,983 INFO  [Configuration$Conf] Getting this collection: [ConfigVO: CA xxx.xxx.xxx.xxx
xxxx Prova/root, ConfigVO: CE xxx.xxx.xxx.xxx xxxx root/ContentEditor, ConfigVO: PM xxx.xxx.xxx.xxx
xxxx root/PM]
> 09:40:08,203 INFO  [js] bindingURI: bind/defConfFormBinding.xml
> 09:40:09,595 INFO  [STDOUT] "resource://org/apache/cocoon/components/flow/javascript/fom/fom_system.js",
line 19: uncaught JavaScript exception: 
> at  (resource://org/apache/cocoon/forms/flow/javascript/v2/Form.js, Line 118)
> at  (resource://org/apache/cocoon/components/flow/javascript/fom/fom_system.js, Line
19):
> org.apache.cocoon.ProcessingException: Failed to execute pipeline.: file:/C:/jboss-3.2.5/server/nikko/tmp/deploy/tmp9020NikkoCM.war/NikkoConfiguration/documents/defConf.jx:26:40:java.lang.NumberFormatException:
For input string: "length"
> 
> Can you tell me why i have this error? How can i solve this problem?
> Thanks
> 
> 
> 
> 
> 
> 
> ____________________________________________________________
> Libero ADSL: navighi gratis a 1.2 Mega, senza canone e costi di attivazione. 
> Abbonati subito su http://www.libero.it 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 



____________________________________________________________
Libero ADSL: navighi gratis a 1.2 Mega, senza canone e costi di attivazione. 
Abbonati subito su http://www.libero.it 



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


Mime
View raw message