GithubHelp home page GithubHelp logo

gh-spring-boot-thymeleaf's Introduction

Bugreport

Spring Boot v2.7.5

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.7.5)

2022-11-14 18:22:21.248  INFO 155770 --- [           main] com.example.demo.DemoApplicationTests    : Starting DemoApplicationTests using Java 17.0.5 on babbage with PID 155770 (started by agebhar1 in /home/agebhar1/src/github.com/agebhar1/gh-spring-boot-thymeleaf/v2.7.5)
2022-11-14 18:22:21.249  INFO 155770 --- [           main] com.example.demo.DemoApplicationTests    : No active profile set, falling back to 1 default profile: "default"
2022-11-14 18:22:21.930  INFO 155770 --- [           main] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page template: index
2022-11-14 18:22:22.178  INFO 155770 --- [           main] o.s.b.t.m.w.SpringBootMockServletContext : Initializing Spring TestDispatcherServlet ''
2022-11-14 18:22:22.179  INFO 155770 --- [           main] o.s.t.web.servlet.TestDispatcherServlet  : Initializing Servlet ''
2022-11-14 18:22:22.179  INFO 155770 --- [           main] o.s.t.web.servlet.TestDispatcherServlet  : Completed initialization in 0 ms
2022-11-14 18:22:22.471  INFO 155770 --- [           main] com.example.demo.DemoApplicationTests    : Started DemoApplicationTests in 1.361 seconds (JVM running for 1.937)
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.036 s - in com.example.demo.DemoApplicationTests
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.957 s
[INFO] Finished at: 2022-11-14T18:22:23+01:00
[INFO] ------------------------------------------------------------------------

Spring Boot v3.0.0-RC2

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::            (v3.0.0-RC2)

2022-11-14T18:22:44.173+01:00  INFO 156844 --- [           main] com.example.demo.DemoApplicationTests    : Starting DemoApplicationTests using Java 17.0.5 with PID 156844 (started by agebhar1 in /home/agebhar1/src/github.com/agebhar1/gh-spring-boot-thymeleaf/v3.0.0-RC2)
2022-11-14T18:22:44.174+01:00  INFO 156844 --- [           main] com.example.demo.DemoApplicationTests    : No active profile set, falling back to 1 default profile: "default"
2022-11-14T18:22:44.710+01:00  INFO 156844 --- [           main] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page template: index
2022-11-14T18:22:44.798+01:00  INFO 156844 --- [           main] o.s.b.t.m.w.SpringBootMockServletContext : Initializing Spring TestDispatcherServlet ''
2022-11-14T18:22:44.799+01:00  INFO 156844 --- [           main] o.s.t.web.servlet.TestDispatcherServlet  : Initializing Servlet ''
2022-11-14T18:22:44.801+01:00  INFO 156844 --- [           main] o.s.t.web.servlet.TestDispatcherServlet  : Completed initialization in 1 ms
2022-11-14T18:22:45.050+01:00  INFO 156844 --- [           main] com.example.demo.DemoApplicationTests    : Started DemoApplicationTests in 1.031 seconds (process running for 1.529)
[ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 1.536 s <<< FAILURE! - in com.example.demo.DemoApplicationTests
[ERROR] shouldServeIndex_mockMvc  Time elapsed: 0.236 s  <<< ERROR!
jakarta.servlet.ServletException: Request processing failed: java.lang.IllegalArgumentException: Cannot build an application for a request which servlet context does not match with the application that it is being built for.
        at com.example.demo.DemoApplicationTests.shouldServeIndex_mockMvc(DemoApplicationTests.java:26)
Caused by: java.lang.IllegalArgumentException: Cannot build an application for a request which servlet context does not match with the application that it is being built for.
        at com.example.demo.DemoApplicationTests.shouldServeIndex_mockMvc(DemoApplicationTests.java:26)

[ERROR] shouldServeIndex_webClient  Time elapsed: 0.026 s  <<< ERROR!
java.io.IOException: jakarta.servlet.ServletException: Request processing failed: java.lang.IllegalArgumentException: Cannot build an application for a request which servlet context does not match with the application that it is being built for.
        at com.example.demo.DemoApplicationTests.shouldServeIndex_webClient(DemoApplicationTests.java:33)
Caused by: jakarta.servlet.ServletException: Request processing failed: java.lang.IllegalArgumentException: Cannot build an application for a request which servlet context does not match with the application that it is being built for.
        at com.example.demo.DemoApplicationTests.shouldServeIndex_webClient(DemoApplicationTests.java:33)
Caused by: java.lang.IllegalArgumentException: Cannot build an application for a request which servlet context does not match with the application that it is being built for.
        at com.example.demo.DemoApplicationTests.shouldServeIndex_webClient(DemoApplicationTests.java:33)

Analysis

In org.thymeleaf.spring6.view.ThymeleafView of org.thymleaf:thymeleaf-spring6:3.1.0.RC1.jar while render the request the check org.thymeleaf.web.servlet.JakartaServletWebApplication#servletContextMatches fails because the provided current context path is not equal to the requested one. In spring module v5 it's not checked.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.