Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3074

CreditCardValidator throws NumberFormatException on non-numeric characters.

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.11
    • 1.4.13, 1.5-M3
    • wicket
    • None
    • Linux

    Description

      CreditCardValidator mishandles strings with alpha characters in them. See the stacktrace below. It should call error() instead of throwing a NumberFormatException if IValidatable.getValue() contains non-numeric characters.

      org.apache.wicket.WicketRuntimeException: Exception 'java.lang.NumberFormatException: For input string: "ll22"' occurred during validation org.apache.wicket.validation.validator.Cred
      itCardValidator on component 1:CCForm:CreditCardPanel:cardnum
      at org.apache.wicket.markup.html.form.FormComponent.validateValidators(FormComponent.java:1622)
      at org.apache.wicket.markup.html.form.FormComponent.validate(FormComponent.java:1201)
      at org.apache.wicket.markup.html.form.Form$23.validate(Form.java:2161)
      at org.apache.wicket.markup.html.form.Form$ValidationVisitor.formComponent(Form.java:173)
      at org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper(FormComponent.java:441)
      at org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper(FormComponent.java:428)
      at org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper(FormComponent.java:428)
      at org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrder(FormComponent.java:400)Sep 22 15:15:52 dpxnu0 logger: at org.apache.wicket.markup.html.form.Form.visitFormComponentsPostOrder(Form.java:1233)
      at org.apache.wicket.markup.html.form.Form.validateComponents(Form.java:2153)
      at org.apache.wicket.markup.html.form.Form.validate(Form.java:2133)
      at org.apache.wicket.markup.html.form.Form.process(Form.java:1005)Sep 22 15:15:52 dpxnu0 logger: at org.apache.wicket.markup.html.form.Form.process(Form.java:955)
      at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:920)Sep 22 15:15:52 dpxnu0 logger: at sun.reflect.GeneratedMethodAccessor101.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:182)Sep 22 15:15:52 dpxnu0 logger: at org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents(ListenerInterfaceRequestTarget.java:73)
      at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)Sep 22 15:15:52 dpxnu0 logger: at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)Sep 22 15:15:52 dpxnu0 logger: at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)Sep 22 15:15:52 dpxnu0 logger: at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
      at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)Sep 22 15:15:52 dpxnu0 logger: at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484)Sep 22 15:15:52 dpxnu0 logger: at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:317)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)Sep 22 15:15:52 dpxnu0 logger: at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)Sep 22 15:15:52 dpxnu0 logger: at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)Sep 22 15:15:52 dpxnu0 logger: at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347)
      at org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:227)Sep 22 15:15:52 dpxnu0 logger: at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)Sep 22 15:15:52 dpxnu0 logger: at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)Sep 22 15:15:52 dpxnu0 logger: at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
      at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)Sep 22 15:15:52 dpxnu0 logger: at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.NumberFormatException: For input string: "ll22"
      at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
      at java.lang.Integer.parseInt(Integer.java:449)
      at java.lang.Integer.parseInt(Integer.java:499)
      at org.apache.wicket.validation.validator.CreditCardValidator.isJCB(CreditCardValidator.java:366)

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            mgrigorov Martin Tzvetanov Grigorov
            clampley@epoch.com Chris Lampley
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment