Write any simple configuration class:
@Configuration
public class ProjectConfig {
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
return http.build();
}
@Bean
public String anyBean() {
return "Test";
}
}
Any of these beans are not created. If you add a breakpoint in the methods and start with debug you can see that they are not called at all.
However, adding a @Bean method in the Main class works:
@SpringBootApplication
public class Sb303IssueRepApplication {
public static void main(String[] args) {
SpringApplication.run(Sb303IssueRepApplication.class, args);
}
@Bean
public String anyBean() {
return "Test";
}
}
This issue cannot be reproduced with 3.0.2.
Comment From: lspil
Here you have a simple project that reproduces the issue: https://github.com/lspil/youtubechannel/tree/master/sb303_issue_rep
Comment From: lspil
Also, here's a short unlisted video with my issue: https://www.youtube.com/watch?v=5pLtEWy7ByA
Comment From: maciejwalkowiak
@lspil I run the sample on both Java 19 and Java 17 and cannot reproduce this issue.
Comment From: dev-himanshu
Hi @wilkinsona , As you have suspected it's a Windows-specific problem related to component scanning, Is there any way to fix it at our end?
Comment From: wilkinsona
Thanks for trying the sample, @maciejwalkowiak. I too cannot reproduce the problem on macOS. My suspicion is that it's a Windows-specific problem as both @lspil and @dev-himanshu, the raiser of #34380, are using Windows. What OS did you try on, @maciejwalkowiak?
@lspil Can you please run your application on the command line using Maven with trace level logging enabled:
mvnw spring-boot:run -Dspring-boot.run.jvmArguments=-Dlogging.level.org.springframework=trace
Please do this with both Spring Boot 3.0.2 and Spring Boot 3.0.3 and share the complete output of both runs. It would also be interesting to know if the problem occurs with Spring Boot 3.0.3 when you downgrade to Spring Framework 6.0.4. You can do so by adding <spring-framework.version>6.0.4</spring-framework.version> to the <properties> in your pom.xml.
Comment From: dev-himanshu
Hi @wilkinsona, I have tried but not working by using spring boot 3.0.3 with spring framework 6.0.4
Comment From: maciejwalkowiak
@wilkinsona on MacOS. Will give a try on Windows later this weekend.
Comment From: wilkinsona
I can reproduce the problem. Rather than being specific to Windows, it happens when the application's path contains a space, which is much more common on Windows than it is on other operating systems. The log output for #34380 shows multiple spaces in the path:
G:\Java\IntelliJ Workspace\Learning\Spring Boot By Raghu\Spring Boot Data\SpringBootDataJpaStoredProcedureEx\target\classes
I cannot reproduce the problem, even with a space in the application's path, when using Spring Boot 3.0.3 and Framework 6.0.4 @dev-himanshu, are you certain that your downgrade to Spring Framework 6.0.4 was effective?
Comment From: wilkinsona
It looks like it's a URL encoding problem:
14:58:42.632 [main] DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver - Failed to complete search in directory [/Users/awilkinson/dev/temp/youtube%20channel/sb303_issue_rep/target/test-classes/com/example/sb303_issue_rep] for files matching pattern [*.class]: java.nio.file.NoSuchFileException: /Users/awilkinson/dev/temp/youtube%20channel/sb303_issue_rep/target/test-classes/com/example/sb303_issue_rep
Note the %20 in the file's path. This looks like a regression introduced in https://github.com/spring-projects/spring-framework/commit/dbf360997aba5177775c231e473e1b0d8d8bcf06. The problem does not occur when running the application as a packaged jar. That's another pointer towards the Framework change being the cause as it will only come into play with file: URLs not the jar: URLs that java -jar will yield. We'll get the Framework team to take a look.
Comment From: wilkinsona
#30031 is already tracking this on the Framework side. Closing in favor of that issue. We'll pick up a new release of Framework that fixes the problem in due course.
Comment From: dev-himanshu
I can reproduce the problem. Rather than being specific to Windows, it happens when the application's path contains a space, which is much more common on Windows than it is on other operating systems. The log output for #34380 shows multiple spaces in the path:
G:\Java\IntelliJ Workspace\Learning\Spring Boot By Raghu\Spring Boot Data\SpringBootDataJpaStoredProcedureEx\target\classesI cannot reproduce the problem, even with a space in the application's path, when using Spring Boot 3.0.3 and Framework 6.0.4 @dev-himanshu, are you certain that your downgrade to Spring Framework 6.0.4 was effective?
I am sure that downgrade to spring framework 6.0.4 was not effective in my case.
Comment From: rishiraj88
Thanks, @dev-himanshu
Comment From: wilkinsona
@dev-himanshu Was Framework 6.0.4 definitely on the classpath? If it was, you appear to have a different problem. It would be interesting to know if your application works when run from a location with no spaces in its path.
Comment From: puck-codes
I had exactly the same problem with two Spring Boot 3.0.3 projects on Windows OS, I replaced all the spaces in the path with hyphens C:\..\path-to-folder\..\project and they both work fine now.
Like lspil said, I didn't have this problem on 3.0.2.
Comment From: lspil
Thanks everyone! You're such a great team! I love this community!
Comment From: dev-himanshu
@dev-himanshu Was Framework 6.0.4 definitely on the classpath? If it was, you appear to have a different problem. It would be interesting to know if your application works when run from a location with no spaces in its path.
In Runner.java
package com.example.runners;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class Runner implements CommandLineRunner {
@Override
public void run(String... args) throws Exception {
log.info("Runner execution started.");
System.out.println("Runner is running.....");
log.info("Runner execution completed.");
}
}
Console Output:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v3.0.3)
2023-02-26T11:44:43.945+05:30 INFO 10112 --- [ restartedMain] c.example.SpringTestRunnerApplication : Starting SpringTestRunnerApplication using Java 18.0.2.1 with PID 10112 (H:\SpringTestRunner\target\classes started by himan in H:\SpringTestRunner)
2023-02-26T11:44:43.951+05:30 INFO 10112 --- [ restartedMain] c.example.SpringTestRunnerApplication : No active profile set, falling back to 1 default profile: "default"
2023-02-26T11:44:44.003+05:30 INFO 10112 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2023-02-26T11:44:44.523+05:30 INFO 10112 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2023-02-26T11:44:44.540+05:30 INFO 10112 --- [ restartedMain] c.example.SpringTestRunnerApplication : Started SpringTestRunnerApplication in 1.326 seconds (process running for 3.046)
2023-02-26T11:44:44.542+05:30 INFO 10112 --- [ restartedMain] com.example.runners.Runner : Runner execution started.
Runner is running.....
2023-02-26T11:44:44.542+05:30 INFO 10112 --- [ restartedMain] com.example.runners.Runner : Runner execution completed.
Process finished with exit code 0
Hello @wilkinsona Yes, you are right. I tried with the no spaces path and its working So, There is URL encoder issue only.
Comment From: wilkinsona
Thanks for the confirmation, @dev-himanshu.
Comment From: dev-himanshu
you're welcome @wilkinsona
Comment From: 123Haynes
This also happens if the path contains other chars like ## not only with spaces.
I ran into this because my application is named frontend##3.0.0.war so the tomcat manager recognizes the 3.0.0 as the version number.
Comment From: kamrankamilli
I have issue with spring boot 3.0.3 using Ubuntu, I'm not sure if it is specific to Windows. Previously I was using Spring Boot 3.0.2 and had no problems. Looks like spring is not scanning for components.
//Working
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
@RestController
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
@GetMapping("/hello")
public String hello() {
return "hello";
}
}
//Not working no mapping 404
package com.example.demo.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class TestController {
@GetMapping("/hello/hello")
public String hello() {
return "hello";
}
}
**Comment From: wilkinsona**
@kamrankamilli As described in the existing comments on this issue, the problem is not specific to Windows. It will affect an application on any OS when there are characters in its path that are encoded when included in a URL. Spaces are probably the most common.
**Comment From: kamrankamilli**
@wilkinsona Yeah I had space in my project folder name, now it is working thanks
**Comment From: jruedas1**
Hi everyone, I had this problem on Mac OS in 3.0.3 vs 3.0.2, getting 404 when I have a slash in the path, here are some details.
**Comment From: jruedas1**
Using a super simple controller
@RestController public class WelcomeController {
@GetMapping(path = "/hello")
public String sayHello(){
return "hello";
}
}
I get 404 when going to localhost:8080/hello in version 3.0.3
Here are some logs
2023-03-01T13:36:27.367-06:00 DEBUG 1365 --- [(4)-10.10.49.20] sun.rmi.transport.tcp : RMI TCP Connection(4)-10.10.49.20: accepted socket from [10.10.49.20:49648] 2023-03-01T13:36:27.367-06:00 DEBUG 1365 --- [(4)-10.10.49.20] sun.rmi.transport.tcp : RMI TCP Connection(4)-10.10.49.20: (port 49626) op = 80 2023-03-01T13:36:27.368-06:00 DEBUG 1365 --- [(4)-10.10.49.20] sun.rmi.loader : RMI TCP Connection(4)-10.10.49.20: name = "[Ljava.rmi.server.ObjID;", codebase = "", defaultLoader = jdk.internal.loader.ClassLoaders$PlatformClassLoader@68c06d81 2023-03-01T13:36:27.368-06:00 DEBUG 1365 --- [(4)-10.10.49.20] sun.rmi.loader : RMI TCP Connection(4)-10.10.49.20: name = "java.rmi.dgc.Lease", codebase = "", defaultLoader = jdk.internal.loader.ClassLoaders$PlatformClassLoader@68c06d81 2023-03-01T13:36:27.368-06:00 DEBUG 1365 --- [(4)-10.10.49.20] sun.rmi.loader : RMI TCP Connection(4)-10.10.49.20: name = "java.rmi.dgc.VMID", codebase = "", defaultLoader = jdk.internal.loader.ClassLoaders$PlatformClassLoader@68c06d81 2023-03-01T13:36:27.368-06:00 DEBUG 1365 --- [(4)-10.10.49.20] sun.rmi.loader : RMI TCP Connection(4)-10.10.49.20: name = "[B", codebase = "", defaultLoader = jdk.internal.loader.ClassLoaders$PlatformClassLoader@68c06d81 2023-03-01T13:36:27.369-06:00 DEBUG 1365 --- [(4)-10.10.49.20] sun.rmi.loader : RMI TCP Connection(4)-10.10.49.20: name = "java.rmi.server.UID", codebase = "", defaultLoader = jdk.internal.loader.ClassLoaders$PlatformClassLoader@68c06d81 2023-03-01T13:36:27.370-06:00 DEBUG 1365 --- [(4)-10.10.49.20] sun.rmi.transport.tcp : RMI TCP Connection(4)-10.10.49.20: (port 49626) op = 80 2023-03-01T13:36:27.370-06:00 DEBUG 1365 --- [(4)-10.10.49.20] sun.rmi.loader : RMI TCP Connection(4)-10.10.49.20: name = "[Ljava.rmi.server.ObjID;", codebase = "", defaultLoader = jdk.internal.loader.ClassLoaders$PlatformClassLoader@68c06d81 2023-03-01T13:36:27.370-06:00 DEBUG 1365 --- [(4)-10.10.49.20] sun.rmi.loader : RMI TCP Connection(4)-10.10.49.20: name = "java.rmi.server.ObjID", codebase = "", defaultLoader = jdk.internal.loader.ClassLoaders$PlatformClassLoader@68c06d81 2023-03-01T13:36:27.370-06:00 DEBUG 1365 --- [(4)-10.10.49.20] sun.rmi.loader : RMI TCP Connection(4)-10.10.49.20: name = "java.rmi.server.UID", codebase = "", defaultLoader = jdk.internal.loader.ClassLoaders$PlatformClassLoader@68c06d81 2023-03-01T13:36:27.371-06:00 DEBUG 1365 --- [(4)-10.10.49.20] sun.rmi.loader : RMI TCP Connection(4)-10.10.49.20: name = "java.rmi.dgc.VMID", codebase = "", defaultLoader = jdk.internal.loader.ClassLoaders$PlatformClassLoader@68c06d81 2023-03-01T13:36:27.372-06:00 DEBUG 1365 --- [(4)-10.10.49.20] sun.rmi.loader : RMI TCP Connection(4)-10.10.49.20: name = "[B", codebase = "", defaultLoader = jdk.internal.loader.ClassLoaders$PlatformClassLoader@68c06d81 2023-03-01T13:36:47.426-06:00 DEBUG 1365 --- [o-8080-Acceptor] o.apache.tomcat.util.threads.LimitLatch : Counting up[http-nio-8080-Acceptor] latch=1 2023-03-01T13:36:47.426-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.coyote.http11.Http11InputBuffer : Before fill(): parsingHeader: [true], parsingRequestLine: [true], parsingRequestLinePhase: [0], parsingRequestLineStart: [0], byteBuffer.position(): [0], byteBuffer.limit(): [0], end: [639] 2023-03-01T13:36:47.426-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.tomcat.util.net.SocketWrapperBase : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@55b0662f:org.apache.tomcat.util.net.NioChannel@2c663263:java.nio.channels.SocketChannel[connected local=/127.0.0.1:8080 remote=/127.0.0.1:49678]], Read from buffer: [0] 2023-03-01T13:36:47.426-06:00 DEBUG 1365 --- [nio-8080-exec-3] org.apache.tomcat.util.net.NioEndpoint : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@55b0662f:org.apache.tomcat.util.net.NioChannel@2c663263:java.nio.channels.SocketChannel[connected local=/127.0.0.1:8080 remote=/127.0.0.1:49678]], Read direct from socket: [639] 2023-03-01T13:36:47.426-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.coyote.http11.Http11InputBuffer : Received [GET /hello HTTP/1.1 Host: localhost:8080 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/110.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,/;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate, br Connection: keep-alive Cookie: Idea-342842ef=a28fef40-f970-418e-a243-0f98617a3455; _octo=GH1.1.1565316306.1670356781; Webstorm-9f03f5b7=a18d96f9-89d7-44df-862b-d843b374dc36; _ga=GA1.1.1880333784.1676404539 Upgrade-Insecure-Requests: 1 Sec-Fetch-Dest: document Sec-Fetch-Mode: navigate Sec-Fetch-Site: none Sec-Fetch-User: ?1
] 2023-03-01T13:36:47.426-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.t.util.http.Rfc6265CookieProcessor : Cookies: Parsing b[]: Idea-342842ef=a28fef40-f970-418e-a243-0f98617a3455; _octo=GH1.1.1565316306.1670356781; Webstorm-9f03f5b7=a18d96f9-89d7-44df-862b-d843b374dc36; _ga=GA1.1.1880333784.1676404539 2023-03-01T13:36:47.427-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.authenticator.AuthenticatorBase : Security checking request GET /hello 2023-03-01T13:36:47.427-06:00 DEBUG 1365 --- [nio-8080-exec-3] org.apache.catalina.realm.RealmBase : No applicable constraints defined 2023-03-01T13:36:47.427-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.authenticator.AuthenticatorBase : Not subject to any constraint 2023-03-01T13:36:47.427-06:00 DEBUG 1365 --- [nio-8080-exec-3] org.apache.tomcat.util.http.Parameters : Set encoding to UTF-8 2023-03-01T13:36:47.427-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.s.web.servlet.DispatcherServlet : GET "/hello", parameters={} 2023-03-01T13:36:47.427-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped to ResourceHttpRequestHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/], ServletContext [/]] 2023-03-01T13:36:47.430-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.s.w.s.r.ResourceHttpRequestHandler : Resource not found 2023-03-01T13:36:47.430-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.s.web.servlet.DispatcherServlet : Completed 404 NOT_FOUND 2023-03-01T13:36:47.430-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.c.C.[Tomcat].[localhost] : Processing ErrorPage[errorCode=0, location=/error] 2023-03-01T13:36:47.431-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.s.web.servlet.DispatcherServlet : "ERROR" dispatch for GET "/error", parameters={} 2023-03-01T13:36:47.431-06:00 DEBUG 1365 --- [nio-8080-exec-3] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#errorHtml(HttpServletRequest, HttpServletResponse) 2023-03-01T13:36:47.431-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : getResource(META-INF/resources/error/404.html) 2023-03-01T13:36:47.431-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : Delegating to parent classloader jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7 2023-03-01T13:36:47.431-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : --> Resource not found, returning null 2023-03-01T13:36:47.432-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : getResource(resources/error/404.html) 2023-03-01T13:36:47.432-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : Delegating to parent classloader jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7 2023-03-01T13:36:47.432-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : --> Resource not found, returning null 2023-03-01T13:36:47.432-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : getResource(static/error/404.html) 2023-03-01T13:36:47.432-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : Delegating to parent classloader jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7 2023-03-01T13:36:47.432-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : --> Resource not found, returning null 2023-03-01T13:36:47.432-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : getResource(public/error/404.html) 2023-03-01T13:36:47.432-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : Delegating to parent classloader jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7 2023-03-01T13:36:47.432-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : --> Resource not found, returning null 2023-03-01T13:36:47.432-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : getResource(META-INF/resources/error/4xx.html) 2023-03-01T13:36:47.432-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : Delegating to parent classloader jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7 2023-03-01T13:36:47.433-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : --> Resource not found, returning null 2023-03-01T13:36:47.433-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : getResource(resources/error/4xx.html) 2023-03-01T13:36:47.433-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : Delegating to parent classloader jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7 2023-03-01T13:36:47.433-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : --> Resource not found, returning null 2023-03-01T13:36:47.433-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : getResource(static/error/4xx.html) 2023-03-01T13:36:47.433-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : Delegating to parent classloader jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7 2023-03-01T13:36:47.433-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : --> Resource not found, returning null 2023-03-01T13:36:47.433-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : getResource(public/error/4xx.html) 2023-03-01T13:36:47.433-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : Delegating to parent classloader jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7 2023-03-01T13:36:47.433-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase : --> Resource not found, returning null 2023-03-01T13:36:47.434-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.s.w.s.v.ContentNegotiatingViewResolver : Selected 'text/html' given [text/html, text/html;q=0.8] 2023-03-01T13:36:47.434-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.s.web.servlet.DispatcherServlet : Exiting from "ERROR" dispatch, status 404 2023-03-01T13:36:47.434-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Disabling the response for further output 2023-03-01T13:36:47.434-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.coyote.http11.Http11InputBuffer : Before fill(): parsingHeader: [true], parsingRequestLine: [true], parsingRequestLinePhase: [0], parsingRequestLineStart: [0], byteBuffer.position(): [0], byteBuffer.limit(): [0], end: [639] 2023-03-01T13:36:47.435-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.tomcat.util.net.SocketWrapperBase : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@55b0662f:org.apache.tomcat.util.net.NioChannel@2c663263:java.nio.channels.SocketChannel[connected local=/127.0.0.1:8080 remote=/127.0.0.1:49678]], Read from buffer: [0] 2023-03-01T13:36:47.435-06:00 DEBUG 1365 --- [nio-8080-exec-3] org.apache.tomcat.util.net.NioEndpoint : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@55b0662f:org.apache.tomcat.util.net.NioChannel@2c663263:java.nio.channels.SocketChannel[connected local=/127.0.0.1:8080 remote=/127.0.0.1:49678]], Read direct from socket: [0] 2023-03-01T13:36:47.435-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.a.coyote.http11.Http11InputBuffer : Received [] 2023-03-01T13:36:47.435-06:00 DEBUG 1365 --- [nio-8080-exec-3] o.apache.coyote.http11.Http11Processor : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@55b0662f:org.apache.tomcat.util.net.NioChannel@2c663263:java.nio.channels.SocketChannel[connected local=/127.0.0.1:8080 remote=/127.0.0.1:49678]], Status in: [OPEN_READ], State out: [OPEN] 2023-03-01T13:36:47.435-06:00 DEBUG 1365 --- [nio-8080-exec-3] org.apache.tomcat.util.net.NioEndpoint : Registered read interest for [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@55b0662f:org.apache.tomcat.util.net.NioChannel@2c663263:java.nio.channels.SocketChannel[connected local=/127.0.0.1:8080 remote=/127.0.0.1:49678]] 2023-03-01T13:36:56.605-06:00 DEBUG 1365 --- [alina-utility-1] o.apache.catalina.session.ManagerBase : Start expire sessions StandardManager at 1677699416605 sessioncount 0 2023-03-01T13:36:56.605-06:00 DEBUG 1365 --- [alina-utility-1] o.apache.catalina.session.ManagerBase : End expire sessions StandardManager processingTime 0 expired sessions: 0 2023-03-01T13:36:57.365-06:00 DEBUG 1365 --- [(4)-10.10.49.20] sun.rmi.transport.tcp : RMI TCP Connection(4)-10.10.49.20: (port 49626) connection closed 2023-03-01T13:36:57.365-06:00 DEBUG 1365 --- [(4)-10.10.49.20] sun.rmi.transport.tcp : RMI TCP Connection(4)-10.10.49.20: close connection, socket: Socket[addr=/10.10.49.20,port=49648,localport=49626] 2023-03-01T13:36:57.365-06:00 DEBUG 1365 --- [(4)-10.10.49.20] sun.rmi.transport.tcp : RMI TCP Connection(4)-10.10.49.20: socket close: Socket[addr=/10.10.49.20,port=49648,localport=49626]
**Comment From: jruedas1**
When I regress to version 3.0.2, the problem is not there
Here are the corresponding logs:
2023-03-01T13:47:27.578-06:00 DEBUG 1522 --- [o-8080-Acceptor] o.apache.tomcat.util.threads.LimitLatch : Counting up[http-nio-8080-Acceptor] latch=1 2023-03-01T13:47:27.599-06:00 DEBUG 1522 --- [nio-8080-exec-1] o.a.coyote.http11.Http11InputBuffer : Before fill(): parsingHeader: [true], parsingRequestLine: [true], parsingRequestLinePhase: [0], parsingRequestLineStart: [0], byteBuffer.position(): [0], byteBuffer.limit(): [0], end: [0] 2023-03-01T13:47:27.600-06:00 DEBUG 1522 --- [nio-8080-exec-1] o.a.tomcat.util.net.SocketWrapperBase : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@6a921077:org.apache.tomcat.util.net.NioChannel@1a933c66:java.nio.channels.SocketChannel[connected local=/127.0.0.1:8080 remote=/127.0.0.1:49760]], Read from buffer: [0] 2023-03-01T13:47:27.600-06:00 DEBUG 1522 --- [nio-8080-exec-1] org.apache.tomcat.util.net.NioEndpoint : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@6a921077:org.apache.tomcat.util.net.NioChannel@1a933c66:java.nio.channels.SocketChannel[connected local=/127.0.0.1:8080 remote=/127.0.0.1:49760]], Read direct from socket: [639] 2023-03-01T13:47:27.600-06:00 DEBUG 1522 --- [nio-8080-exec-1] o.a.coyote.http11.Http11InputBuffer : Received [GET /hello HTTP/1.1 Host: localhost:8080 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/110.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,/;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate, br Connection: keep-alive Cookie: Idea-342842ef=a28fef40-f970-418e-a243-0f98617a3455; _octo=GH1.1.1565316306.1670356781; Webstorm-9f03f5b7=a18d96f9-89d7-44df-862b-d843b374dc36; _ga=GA1.1.1880333784.1676404539 Upgrade-Insecure-Requests: 1 Sec-Fetch-Dest: document Sec-Fetch-Mode: navigate Sec-Fetch-Site: none Sec-Fetch-User: ?1
] 2023-03-01T13:47:27.611-06:00 DEBUG 1522 --- [nio-8080-exec-1] org.apache.tomcat.util.http.Parameters : Set query string encoding to UTF-8 2023-03-01T13:47:27.612-06:00 DEBUG 1522 --- [nio-8080-exec-1] o.a.t.util.http.Rfc6265CookieProcessor : Cookies: Parsing b[]: Idea-342842ef=a28fef40-f970-418e-a243-0f98617a3455; _octo=GH1.1.1565316306.1670356781; Webstorm-9f03f5b7=a18d96f9-89d7-44df-862b-d843b374dc36; _ga=GA1.1.1880333784.1676404539 2023-03-01T13:47:27.614-06:00 DEBUG 1522 --- [nio-8080-exec-1] o.a.c.authenticator.AuthenticatorBase : Security checking request GET /hello 2023-03-01T13:47:27.614-06:00 DEBUG 1522 --- [nio-8080-exec-1] org.apache.catalina.realm.RealmBase : No applicable constraints defined 2023-03-01T13:47:27.616-06:00 DEBUG 1522 --- [nio-8080-exec-1] o.a.c.a.jaspic.AuthConfigFactoryImpl : Loading persistent provider registrations from [/private/var/folders/xn/x2z1qzds6jl_d31jdwtnyz3r0000gn/T/tomcat.8080.5933864671982932482/conf/jaspic-providers.xml] 2023-03-01T13:47:27.616-06:00 DEBUG 1522 --- [nio-8080-exec-1] o.a.c.authenticator.AuthenticatorBase : Not subject to any constraint 2023-03-01T13:47:27.618-06:00 INFO 1522 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet' 2023-03-01T13:47:27.618-06:00 INFO 1522 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' 2023-03-01T13:47:27.618-06:00 DEBUG 1522 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Detected StandardServletMultipartResolver 2023-03-01T13:47:27.618-06:00 DEBUG 1522 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Detected AcceptHeaderLocaleResolver 2023-03-01T13:47:27.618-06:00 DEBUG 1522 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Detected FixedThemeResolver 2023-03-01T13:47:27.618-06:00 DEBUG 1522 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Detected org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator@74d35c00 2023-03-01T13:47:27.619-06:00 DEBUG 1522 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Detected org.springframework.web.servlet.support.SessionFlashMapManager@291959c6 2023-03-01T13:47:27.619-06:00 DEBUG 1522 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : enableLoggingRequestDetails='false': request parameters and headers will be masked to prevent unsafe logging of potentially sensitive data 2023-03-01T13:47:27.619-06:00 INFO 1522 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms 2023-03-01T13:47:27.623-06:00 DEBUG 1522 --- [nio-8080-exec-1] org.apache.tomcat.util.http.Parameters : Set encoding to UTF-8 2023-03-01T13:47:27.624-06:00 DEBUG 1522 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : GET "/hello", parameters={} 2023-03-01T13:47:27.631-06:00 DEBUG 1522 --- [nio-8080-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to com.example.demo4.controllers.WelcomeController#sayHello() 2023-03-01T13:47:27.644-06:00 DEBUG 1522 --- [nio-8080-exec-1] m.m.a.RequestResponseBodyMethodProcessor : Using 'text/html', given [text/html, application/xhtml+xml, image/avif, image/webp, application/xml;q=0.9, /;q=0.8] and supported [text/plain, /, application/json, application/*+json] 2023-03-01T13:47:27.645-06:00 DEBUG 1522 --- [nio-8080-exec-1] m.m.a.RequestResponseBodyMethodProcessor : Writing ["hello"] 2023-03-01T13:47:27.649-06:00 DEBUG 1522 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed 200 OK 2023-03-01T13:47:27.650-06:00 DEBUG 1522 --- [nio-8080-exec-1] o.a.coyote.http11.Http11InputBuffer : Before fill(): parsingHeader: [true], parsingRequestLine: [true], parsingRequestLinePhase: [0], parsingRequestLineStart: [0], byteBuffer.position(): [0], byteBuffer.limit(): [0], end: [639] 2023-03-01T13:47:27.650-06:00 DEBUG 1522 --- [nio-8080-exec-1] o.a.tomcat.util.net.SocketWrapperBase : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@6a921077:org.apache.tomcat.util.net.NioChannel@1a933c66:java.nio.channels.SocketChannel[connected local=/127.0.0.1:8080 remote=/127.0.0.1:49760]], Read from buffer: [0] 2023-03-01T13:47:27.650-06:00 DEBUG 1522 --- [nio-8080-exec-1] org.apache.tomcat.util.net.NioEndpoint : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@6a921077:org.apache.tomcat.util.net.NioChannel@1a933c66:java.nio.channels.SocketChannel[connected local=/127.0.0.1:8080 remote=/127.0.0.1:49760]], Read direct from socket: [0] 2023-03-01T13:47:27.650-06:00 DEBUG 1522 --- [nio-8080-exec-1] o.a.coyote.http11.Http11InputBuffer : Received [] 2023-03-01T13:47:27.650-06:00 DEBUG 1522 --- [nio-8080-exec-1] o.apache.coyote.http11.Http11Processor : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@6a921077:org.apache.tomcat.util.net.NioChannel@1a933c66:java.nio.channels.SocketChannel[connected local=/127.0.0.1:8080 remote=/127.0.0.1:49760]], Status in: [OPEN_READ], State out: [OPEN] 2023-03-01T13:47:27.650-06:00 DEBUG 1522 --- [nio-8080-exec-1] org.apache.tomcat.util.net.NioEndpoint : Registered read interest for [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@6a921077:org.apache.tomcat.util.net.NioChannel@1a933c66:java.nio.channels.SocketChannel[connected local=/127.0.0.1:8080 remote=/127.0.0.1:49760]] 2023-03-01T13:47:46.247-06:00 DEBUG 1522 --- [(3)-10.10.49.20] sun.rmi.transport.tcp : RMI TCP Connection(3)-10.10.49.20: (port 49755) connection closed 2023-03-01T13:47:46.247-06:00 DEBUG 1522 --- [(3)-10.10.49.20] sun.rmi.transport.tcp : RMI TCP Connection(3)-10.10.49.20: close connection, socket: Socket[addr=/10.10.49.20,port=49759,localport=49755] 2023-03-01T13:47:46.247-06:00 DEBUG 1522 --- [(3)-10.10.49.20] sun.rmi.transport.tcp : RMI TCP Connection(3)-10.10.49.20: socket close: Socket[addr=/10.10.49.20,port=49759,localport=49755]
**Comment From: jruedas1**
In version 3.0.3 when I remove the slash from the GetMapping path, the problem is resolved. This works just fine in 3.0.3:
@RestController public class WelcomeController {
@GetMapping(path = "hello")
public String sayHello(){
return "hello";
}
} ```
Comment From: jruedas1
Hope this helps identify and resolve the issue
Comment From: wilkinsona
@jruedas1 Thanks, but that appears to be a different problem. This issue is about having a space or other character that would be URL encoded in the path on the file system from which the application is running. It's unrelated to paths in @GetMapping annotations. If you believe you've found a bug there, please open a Spring Framework issue.
Comment From: SuperUserDo-Nikola
Any luck fixing issue on 3.0.3 ? On 3.0.2 works perfectly
Comment From: 123Haynes
Any luck fixing issue on 3.0.3 ? On 3.0.2 works perfectly
@HerNidza You can downgrade the spring Framework to 6.0.4 and still use spring-boot 3.0.3 until this is fixed.
Simply add the property
<spring-framework.version>6.0.4</spring-framework.version>
Comment From: SuperUserDo-Nikola
@123Haynes Awesome!
Thanks a lot!
Comment From: philwebb
For anyone watching this issue, we've just done an earlier than scheduled 3.0.4 release to specifically address this regression. Please upgrade.
Comment From: dev-himanshu
For anyone watching this issue, we've just done an earlier than scheduled 3.0.4 release to specifically address this regression. Please upgrade.
Hi @philwebb, thanks for the update in that issue. I have tried with latest release of 3.0.4 and now working fine.