4 Replies Latest reply on Jan 30, 2008 8:33 AM by Ilya Shaikovsky

    Tomcat6 migration problem

    Jim Vincent Newbie

      I have tried to change from myFace to sun JSF.
      I have migrated on jdk1.5 and tomcat 6.

      I have a datatable with input fields.
      I have set ajax fields with keypress events.
      For example, when the dimension field is changed, the price must change.

      Here is my code:

      <rich:column>
       <f:facet name="header">
       <h:outputText
       value="#{my_messages['part.h_dimension']}" />
       </f:facet>
      
       <!-- row is also available -->
       <a4j:outputPanel id="idCatalogHDim">
       <h:inputText id="dimensionH" maxlength="5" size="5"
       binding="#{htmlInputTextHDim.valueRef}" immediate="false"
       value="#{part.partDimension.dimensionH}"
       rendered="#{(part.partDimension!=null) && (part.partDimensionMinimum.dimensionH < part.partDimensionMaximum.dimensionH)}">
       <f:converter converterId="catalogIntegerConverter" />
       <f:validator validatorId="dimensionValidator" />
       <a4j:support event="onkeyup" eventsQueue="queueDataCatalog" ignoreDupResponses="false" requestDelay="100"
       action="#{htmlInputTextHDim.change}"
       immediate="true"
       reRender="idPrice,idAddToCart,idMessageHDim" />
       </h:inputText>
      
       <a4j:outputPanel id="idMessageHDim">
       <h:message styleClass="errorMark" for="dimensionH"
       tooltip="true" showDetail="true" showSummary="false">
       </h:message>
       </a4j:outputPanel>
      
       </a4j:outputPanel>
      
       <h:outputText value="#{part.partDimension.dimensionH}"
       rendered="#{(part.partDimension!=null) && (part.partDimension.dimensionH > 0) && (part.partDimensionMinimum.dimensionH == part.partDimensionMaximum.dimensionH)}">
       </h:outputText>
      
       <a4j:outputPanel
       rendered="#{(part.partDimension==null) || (part.partDimension.dimensionH == null)">
       <f:verbatim> </f:verbatim>
       </a4j:outputPanel>
      
       </rich:column>



      Here is the class

      public class HtmlInputNumericTextComponent {
      
       HtmlInputText valueRef;
      
       public HtmlInputText getValueRef() {
       return valueRef;
       }
      
       public void setValueRef(HtmlInputText valueRef) {
       this.valueRef = valueRef;
       }
      
      
      
       public String change(){
       Object submittedValue = valueRef.getSubmittedValue();
      
       valueRef.setSubmittedValue("0");
       Validator[] validators = valueRef.getValidators();
      
       for (int i = 0; i<validators.length; i++){
       valueRef.removeValidator(validators);
       }
       valueRef.processValidators(FacesContext.getCurrentInstance());
       valueRef.processUpdates(FacesContext.getCurrentInstance());
      
       for (int i = 0; i<validators.length; i++){
       valueRef.addValidator(validators);
       }
      
       valueRef.setSubmittedValue(submittedValue);
       valueRef.processValidators(FacesContext.getCurrentInstance());
       valueRef.processUpdates(FacesContext.getCurrentInstance());
      
       return null;
       }
      
       public HtmlInputNumericTextComponent() {
       super();
       // TODO Auto-generated constructor stub
       }
      
      }




      Here is the bug which appears ONLY after the migration:


      org.apache.jasper.JasperException: An exception occurred processing JSP page /catalog/displayCatalog.jsp at line 260
      
      257:
      258: <!-- row is also available -->
      259: <a4j:outputPanel id="idCatalogHDim">
      260: <h:inputText id="dimensionH" maxlength="5" size="5"
      261: binding="#{htmlInputTextHDim.valueRef}" immediate="false"
      262: value="#{part.partDimension.dimensionH}"
      263: rendered="#{(part.partDimension!=null) && (part.partDimensionMinimum.dimensionH < part.partDimensionMaximum.dimensionH)}">
      
      
      Stacktrace:
       org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
       org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417)
       org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
       com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
       com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
       org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
       com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
       com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
       com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
       javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
       org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
       org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
      
      
      root cause
      
      javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.faces.FacesException: Error performing conversion of value ' of type class java.lang.String to type class javax.faces.component.html.HtmlInputText for managed bean htmlInputTextHDim.
       org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
       org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
       org.apache.jsp.catalog.displayCatalog_jsp._jspService(displayCatalog_jsp.java:374)
       org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
       org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
       com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
       com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
       org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
       com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
       com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
       com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
       javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
       org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
       org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
      
      
      root cause
      
      javax.faces.FacesException: Error performing conversion of value ' of type class java.lang.String to type class javax.faces.component.html.HtmlInputText for managed bean htmlInputTextHDim.
       com.sun.faces.config.ManagedBeanFactoryImpl.getConvertedValueConsideringPrimitives(ManagedBeanFactoryImpl.java:971)
       com.sun.faces.config.ManagedBeanFactoryImpl.setPropertiesIntoBean(ManagedBeanFactoryImpl.java:644)
       com.sun.faces.config.ManagedBeanFactoryImpl.newInstance(ManagedBeanFactoryImpl.java:317)
       com.sun.faces.application.ApplicationAssociate.createAndMaybeStoreManagedBeans(ApplicationAssociate.java:546)
       com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:82)
       javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
       com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
       org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:45)
       org.apache.el.parser.AstValue.getValue(AstValue.java:86)
       org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
       org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
       com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:229)
       javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:211)
       javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:476)
       javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:660)
       javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1111)
       com.sun.faces.taglib.html_basic.InputTextTag.doStartTag(InputTextTag.java:419)
       org.apache.jsp.catalog.displayCatalog_jsp._jspx_meth_h_005finputText_005f2(displayCatalog_jsp.java:7328)
       org.apache.jsp.catalog.displayCatalog_jsp._jspx_meth_a4j_005foutputPanel_005f6(displayCatalog_jsp.java:7277)
       org.apache.jsp.catalog.displayCatalog_jsp._jspx_meth_rich_005fcolumn_005f0(displayCatalog_jsp.java:7169)
       org.apache.jsp.catalog.displayCatalog_jsp._jspx_meth_rich_005fdataTable_005f0(displayCatalog_jsp.java:6289)
       org.apache.jsp.catalog.displayCatalog_jsp._jspx_meth_a4j_005fform_005f1(displayCatalog_jsp.java:6191)
       org.apache.jsp.catalog.displayCatalog_jsp._jspx_meth_f_005fsubview_005f0(displayCatalog_jsp.java:6143)
       org.apache.jsp.catalog.displayCatalog_jsp._jspx_meth_a4j_005foutputPanel_005f5(displayCatalog_jsp.java:6098)
       org.apache.jsp.catalog.displayCatalog_jsp._jspx_meth_rich_005fpanel_005f2(displayCatalog_jsp.java:6050)
       org.apache.jsp.catalog.displayCatalog_jsp._jspx_meth_f_005fview_005f0(displayCatalog_jsp.java:660)
       org.apache.jsp.catalog.displayCatalog_jsp._jspService(displayCatalog_jsp.java:365)
       org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
       org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
       com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
       com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
       org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
       com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
       com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
       com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
       javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
       org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
       org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)