java.lang.IllegalStateException: Pattern "/site/*/{id}.p;jsessionid=*" is not a match for "/site/Apple/3107695.p"

Spring JIRA | Jason Terhune-Wold | 4 years ago
  1. 0

    We tried to upgrade from 3.2.0 to 3.2.2, and our integration tests started failing with an IllegalStateException. This problem also exists in 3.2.1. Adding this test to RequestMappingInfoHandlerMappingTests will reproduce the problem: {code:java} @Test public void bestMatchingPatternAttributeWithParameters() { PatternsRequestCondition patterns = new PatternsRequestCondition("/site/*/{id}.p;jsessionid=*", "/site/*/{id}.p"); RequestMappingInfo key = new RequestMappingInfo(patterns, null, null, null, null, null, null); MockHttpServletRequest requestWithJsession = new MockHttpServletRequest("GET", "/site/Apple/3107695.p;jsessionid=123"); this.handlerMapping.handleMatch(key, "/site/Apple/3107695.p;jsessionid=123", requestWithJsession); assertEquals("/site/*/{id}.p;jsessionid=*", requestWithJsession.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE)); MockHttpServletRequest requestWithoutJsession = new MockHttpServletRequest("GET", "/site/Apple/3107695.p"); this.handlerMapping.handleMatch(key, "/site/Apple/3107695.p", requestWithoutJsession); assertEquals("/site/*/{id}.p", requestWithoutJsession.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE)); } {code} If you swap the order of the strings to PatternsRequestCondition, it will change the location of the failure. Please let me know if I can provide any more info. The abbreviated stacktrace is: {noformat} java.lang.IllegalStateException: Pattern "/site/*/{id}.p;jsessionid=*" is not a match for "/site/Apple/3107695.p" at org.springframework.util.Assert.state(Assert.java:385) at org.springframework.util.AntPathMatcher.extractUriTemplateVariables(AntPathMatcher.java:287) at org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping.handleMatch(RequestMappingInfoHandlerMapping.java:102) ... {noformat}

    Spring JIRA | 4 years ago | Jason Terhune-Wold
    java.lang.IllegalStateException: Pattern "/site/*/{id}.p;jsessionid=*" is not a match for "/site/Apple/3107695.p"
  2. 0

    We tried to upgrade from 3.2.0 to 3.2.2, and our integration tests started failing with an IllegalStateException. This problem also exists in 3.2.1. Adding this test to RequestMappingInfoHandlerMappingTests will reproduce the problem: {code:java} @Test public void bestMatchingPatternAttributeWithParameters() { PatternsRequestCondition patterns = new PatternsRequestCondition("/site/*/{id}.p;jsessionid=*", "/site/*/{id}.p"); RequestMappingInfo key = new RequestMappingInfo(patterns, null, null, null, null, null, null); MockHttpServletRequest requestWithJsession = new MockHttpServletRequest("GET", "/site/Apple/3107695.p;jsessionid=123"); this.handlerMapping.handleMatch(key, "/site/Apple/3107695.p;jsessionid=123", requestWithJsession); assertEquals("/site/*/{id}.p;jsessionid=*", requestWithJsession.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE)); MockHttpServletRequest requestWithoutJsession = new MockHttpServletRequest("GET", "/site/Apple/3107695.p"); this.handlerMapping.handleMatch(key, "/site/Apple/3107695.p", requestWithoutJsession); assertEquals("/site/*/{id}.p", requestWithoutJsession.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE)); } {code} If you swap the order of the strings to PatternsRequestCondition, it will change the location of the failure. Please let me know if I can provide any more info. The abbreviated stacktrace is: {noformat} java.lang.IllegalStateException: Pattern "/site/*/{id}.p;jsessionid=*" is not a match for "/site/Apple/3107695.p" at org.springframework.util.Assert.state(Assert.java:385) at org.springframework.util.AntPathMatcher.extractUriTemplateVariables(AntPathMatcher.java:287) at org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping.handleMatch(RequestMappingInfoHandlerMapping.java:102) ... {noformat}

    Spring JIRA | 4 years ago | Jason Terhune-Wold
    java.lang.IllegalStateException: Pattern "/site/*/{id}.p;jsessionid=*" is not a match for "/site/Apple/3107695.p"
  3. 0

    JSessionID is causing problems with forgot password flow

    GitHub | 3 years ago | jefffischer
    java.lang.IllegalStateException: Pattern "/changePassword" is not a match for "/changePassword;JSESSIONIDADMIN=B7022BAB6EB112C432 24D34C38ADD823.node2"
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Pattern "/**/services/*/{requestName}/**" is not a match for

    Stack Overflow | 1 year ago | Avinash Kumar
    java.lang.IllegalStateException: Pattern "/**/services/*/{requestName}/**" is not a match for "/api-money/v1/payroll/7T1/00001654384/paycheck-details-pdf/S0/N/2015-06-15/1/6/0/2014-10-01"
  6. 0

    SEC-3130: PathVariableSecurityEvaluationContextPostProcessor fails with different case

    GitHub | 1 year ago | spring-issuemaster
    java.lang.IllegalStateException: Pattern "/permitall/**" is not a match for "/permitAll/something"

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      Pattern "/site/*/{id}.p;jsessionid=*" is not a match for "/site/Apple/3107695.p"

      at org.springframework.util.Assert.state()
    2. Spring Core
      AntPathMatcher.extractUriTemplateVariables
      1. org.springframework.util.Assert.state(Assert.java:385)
      2. org.springframework.util.AntPathMatcher.extractUriTemplateVariables(AntPathMatcher.java:287)
      2 frames
    3. Spring MVC
      RequestMappingInfoHandlerMapping.handleMatch
      1. org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping.handleMatch(RequestMappingInfoHandlerMapping.java:102)
      1 frame