0 Replies Latest reply on Mar 7, 2007 11:19 PM by Ricardo Memoria

    s:selectDate raises an exception in romanian language

    Ricardo Memoria Novice

      Hi,

      I'm using JBOSS 4.0.5ga + SEAM1.2patch1.

      My app suports 3 languages: English, Portuguese and Romanian. Bellow is part of my faces-config.xml

      <application>
       <locale-config>
       <default-locale>pt</default-locale>
       <supported-locale>en</supported-locale>
       <supported-locale>pt</supported-locale>
       <supported-locale>ro</supported-locale>
       </locale-config>
      ..
      ..


      If the user changes the language to romanian (ro) and move to any page with a s:selectDate component there, the system raises the following exception:

      01:13:41,968 ERROR [STDERR] 08/03/2007 01:13:41 com.sun.facelets.FaceletViewHandler handleRenderException
      SEVERE: Error Rendering View[/test.xhtml]
      java.lang.StringIndexOutOfBoundsException: String index out of range: 2
       at java.lang.String.substring(Unknown Source)
       at org.jboss.seam.ui.UISelectDate.commaSeparate(UISelectDate.java:141)
       at org.jboss.seam.ui.UISelectDate.writeLocaleInformation(UISelectDate.java:118)
       at org.jboss.seam.ui.UISelectDate.writeScript(UISelectDate.java:98)
       at org.jboss.seam.ui.UISelectDate.encodeBegin(UISelectDate.java:70)
       at javax.faces.render.Renderer.encodeChildren(Renderer.java:65)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:524)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:244)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:573)
       at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:229)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Unknown Source)


      Trying to isolate the problem as much as I can, I made a very simple page where this error occurs

      <?xml version="1.0" encoding="iso-8859-1"?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:a="https://ajax4jsf.dev.java.net/ajax"
       xmlns:rich="http://richfaces.ajax4jsf.org/rich"
       template="/templates/padrao.xhtml">
      
      <ui:define name="content">
      
      <f:facet name="header">This is the title</f:facet>
       Inform the data
       <h:inputText id="dt" value="" required="true">
       <s:convertDateTime/>
       </h:inputText>
       <s:selectDate for="dt">
       <h:graphicImage url="../resources/dtpick.gif" style="margin-left:5px;cursor:pointer"/>
       </s:selectDate>
      
      </ui:define>
      
      </ui:composition>


      In English and Portuguese this page is rendered with no errors.

      If I set the language to Romanian and move to this page the exception above is raised.

      If I remove the s:selectDate the page is rendered in Romanian.

      The error just happens in pages with a s:selectDate component.

      Tips?????

      Best,
      Ricardo