Uploaded image for project: 'JCommune'
  1. JCommune
  2. JC-2004

TypeMismatchException to be DEBUG

VotersWatchers
    XMLWordPrintable

    Details

    • Sprint:
      2.12 Larks, 2.13 Larks, 2.14 Larks

      Description

      There seem to be a lot of bots crawling javatalks. They use wrong URLs and thus a lot of exceptions are being seen in console (see below).

      AR: Exception is logged as WARN
      ER:

      • Exception stacktrace is logged as DEBUG
      • Single line that explains wrong params were passed to the URL - this should be INFO. Basically it should be the very same [org.jtalks.jcommune.web.exception.PrettyLogExceptionResolver] - [GET]http://javatalks.ru/topics/id="10322"[null][] but explaining what went wrong.

      Exception body:

      2014-10-06 21:49:38 [INFO ][http-8080-72    ][anonymous-1694][org.jtalks.jcommune.web.exception.PrettyLogExceptionResolver] - [GET][http://javatalks.ru/topics/id="10322"][null][]
      2014-10-06 21:49:38 [DEBUG][http-8080-72    ][anonymous-1694][org.jtalks.jcommune.web.exception.PrettyLogExceptionResolver] - Resolving to view 'redirect:/errors/400' for exception 
      of type [org.springframework.beans.TypeMismatchException], based on exception mapping [org.springframework.beans.TypeMismatchException]
      2014-10-06 21:49:38 [DEBUG][http-8080-72    ][anonymous-1694][org.jtalks.jcommune.web.exception.PrettyLogExceptionResolver] - Exposing Exception as model attribute 'exception'
      2014-10-06 21:49:39 [DEBUG][http-8080-72    ][anonymous-22B8][org.jtalks.jcommune.web.exception.PrettyLogExceptionResolver] - Resolving exception from handler [public org.springfram
      ework.web.servlet.ModelAndView org.jtalks.jcommune.web.controller.TopicController.showTopicPage(org.springframework.web.context.request.WebRequest,java.lang.Long,java.lang.String) t
      hrows org.jtalks.jcommune.service.exceptions.NotFoundException]: org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type
       'java.lang.Long'; nested exception is java.lang.NumberFormatException: For input string: "id="10325""
      2014-10-06 21:49:39 [WARN ][http-8080-72    ][anonymous-22B8][           org.jtalks.jcommune] - Handler execution resulted in exception
      org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Long'; nested exception is java.lang.NumberFormatExce
      ption: For input string: "id="10325""
              at org.springframework.beans.TypeConverterSupport.doConvert(TypeConverterSupport.java:74)
              at org.springframework.beans.TypeConverterSupport.convertIfNecessary(TypeConverterSupport.java:45)
              at org.springframework.validation.DataBinder.convertIfNecessary(DataBinder.java:595)
              at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:102)
              at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:77)
              at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:162)
              at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:123)
              at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
              at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
              at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686)
              at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
              at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
              at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
              at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
              at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
              at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jtalks.jcommune.web.filters.HeadRequestTypeFilter.doFilter(HeadRequestTypeFilter.java:45)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jtalks.jcommune.web.filters.LoggingConfigurationFilter.doFilter(LoggingConfigurationFilter.java:69)
              at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
              at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)

        Attachments

          Structure

            Activity

              People

              • Assignee:
                begemosha Anton Barkov
                Reporter:
                ctapobep Stanislav Bashkyrtsev
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.25h
                  0.25h

                    Structure Helper Panel