Tapestry
  1. Tapestry
  2. TAPESTRY-2591

Email Validator Throws MissingFormatArgumentException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.15
    • Fix Version/s: 5.0.15
    • Component/s: Core Components
    • Labels:
      None

      Description

      Now that TAPESTRY-2585 has been fixed, a new issue has come up.

      Now when trying to visir a page with an email validator on it, the following error is thrown:

      java.util.MissingFormatArgumentException
      Format specifier '2$s'

      Stack trace

      • java.util.Formatter.format(Formatter.java:2454)
      • java.util.Formatter.format(Formatter.java:2383)
      • java.lang.String.format(String.java:2825)
      • org.apache.tapestry5.ioc.internal.util.MessageFormatterImpl.format(MessageFormatterImpl.java:49)
      • org.apache.tapestry5.validator.Email.buildMessage(Email.java:52)
      • org.apache.tapestry5.validator.Email.render(Email.java:47)
      • org.apache.tapestry5.validator.Email.render(Email.java:28)
      • org.apache.tapestry5.internal.services.FieldValidatorImpl.render(FieldValidatorImpl.java:56)
      • org.apache.tapestry5.internal.services.CompositeFieldValidator.render(CompositeFieldValidator.java:45)
      • org.apache.tapestry5.corelib.base.AbstractTextField.begin(AbstractTextField.java:177)
      • org.apache.tapestry5.corelib.base.AbstractTextField.beginRender(AbstractTextField.java)

        Activity

        Hide
        Martijn Brinkers added a comment - - edited

        I had a similar error just 5 minutes ago when I deployed my war on jetty. After I did a clean build the error was gone. I don't know if this is some kind of transient Tapestry error or if there was something wrong with my build.

        The error was also caused by java.util.MissingFormatArgumentException but was format was called by addScript in my case

        Caused by: java.util.MissingFormatArgumentException: Format specifier '40e'
        at java.util.Formatter.format(Formatter.java:2431)
        at java.util.Formatter.format(Formatter.java:2366)
        at java.lang.String.format(String.java:2770)
        at org.apache.tapestry5.internal.services.RenderSupportImpl.addScript(RenderSupportImpl.java:134)

        Show
        Martijn Brinkers added a comment - - edited I had a similar error just 5 minutes ago when I deployed my war on jetty. After I did a clean build the error was gone. I don't know if this is some kind of transient Tapestry error or if there was something wrong with my build. The error was also caused by java.util.MissingFormatArgumentException but was format was called by addScript in my case Caused by: java.util.MissingFormatArgumentException: Format specifier '40e' at java.util.Formatter.format(Formatter.java:2431) at java.util.Formatter.format(Formatter.java:2366) at java.lang.String.format(String.java:2770) at org.apache.tapestry5.internal.services.RenderSupportImpl.addScript(RenderSupportImpl.java:134)
        Hide
        Dave Dombrosky added a comment -

        I just want to state that I am still experiencing this issue. It is definitely not a transient error like the previous comment suggested.

        Show
        Dave Dombrosky added a comment - I just want to state that I am still experiencing this issue. It is definitely not a transient error like the previous comment suggested.
        Hide
        Ulrich Stärk added a comment -

        This is caused by the email validator only providing one argument to MessageFormatter.format() but the message is expecting two. %2$s has to be changed to %1$s in Validate*.properties

        Show
        Ulrich Stärk added a comment - This is caused by the email validator only providing one argument to MessageFormatter.format() but the message is expecting two. %2$s has to be changed to %1$s in Validate*.properties
        Hide
        Igor Drobiazko added a comment -

        Thanx, Ulrich. I figured it out already but didn't had the time to commit the fix.

        Show
        Igor Drobiazko added a comment - Thanx, Ulrich. I figured it out already but didn't had the time to commit the fix.

          People

          • Assignee:
            Igor Drobiazko
            Reporter:
            Dave Dombrosky
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development