SpringBoot-在调试模式下启动时,应用程序返回404 Not Found

时间:2019-04-19 12:53:14

标签: java spring-boot gradle intellij-idea

我遇到了一种奇怪的情况,即我无法使Spring Boot应用程序在Debug模式下工作。在正常模式下启动时,同一应用程序可以正确响应。仅当我在自己的build.gradle文件中添加this外部库作为依赖项时,才会观察到此行为。

我非常确定问题是由于添加了上述库并确定我应该如何解决。

我的IDE是IntelliJ

到目前为止,我已经尝试过:

  • 清洁并重建
  • IntelliJ使缓存无效并重新启动

成绩输入

compile "com.mpatric:mp3agic:0.9.1"

我可以看到应用程序从日志正确启动并正在侦听端口8080。当我进行API调用时,日志中没有任何条目。

更新 当我以调试级别的日志记录分辨率运行应用程序时,得到以下信息:

2019-04-19 23:25:58.267 DEBUG 8212 --- [nio-8080-exec-2] o.apache.coyote.http11.Http11Processor   : Error parsing HTTP request header

java.io.EOFException: null
    at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1208) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
    at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1142) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
    at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:729) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
    at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:352) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:294) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-9.0.13.jar:9.0.13]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:791) [tomcat-embed-core-9.0.13.jar:9.0.13]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417) [tomcat-embed-core-9.0.13.jar:9.0.13]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.13.jar:9.0.13]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) [na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [na:na]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.13.jar:9.0.13]
    at java.base/java.lang.Thread.run(Thread.java:844) [na:na]

2019-04-19 23:25:58.267 DEBUG 8212 --- [nio-8080-exec-2] o.apache.coyote.http11.Http11Processor   : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@1f2672ea:org.apache.tomcat.util.net.NioChannel@19ebacea:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8080 remote=/0:0:0:0:0:0:0:1:57538]], Status in: [OPEN_READ], State out: [CLOSED]
2019-04-19 23:25:58.269 DEBUG 8212 --- [nio-8080-exec-2] o.apache.tomcat.util.threads.LimitLatch  : Counting down[http-nio-8080-exec-2] latch=2
2019-04-19 23:25:58.269 DEBUG 8212 --- [nio-8080-exec-2] org.apache.tomcat.util.net.NioEndpoint   : Socket: [org.apache.tomcat.util.net.NioChannel@19ebacea:java.nio.channels.SocketChannel[closed]] closed
2019-04-19 23:25:58.279 DEBUG 8212 --- [nio-8080-exec-1] org.apache.tomcat.util.http.Parameters   : Set query string encoding to UTF-8
2019-04-19 23:25:58.283 DEBUG 8212 --- [nio-8080-exec-1] o.a.c.authenticator.AuthenticatorBase    : Security checking request POST /v1/agents
2019-04-19 23:25:58.283 DEBUG 8212 --- [nio-8080-exec-1] org.apache.catalina.realm.RealmBase      :   No applicable constraints defined
2019-04-19 23:25:58.287 DEBUG 8212 --- [nio-8080-exec-1] o.a.c.a.jaspic.AuthConfigFactoryImpl     : Loading persistent provider registrations from [C:\Users\Vino\AppData\Local\Temp\tomcat.11733970093983411817.8080\conf\jaspic-providers.xml]
2019-04-19 23:25:58.287 DEBUG 8212 --- [nio-8080-exec-1] o.a.c.authenticator.AuthenticatorBase    :  Not subject to any constraint
2019-04-19 23:25:58.303 DEBUG 8212 --- [nio-8080-exec-1] o.a.tomcat.util.net.SocketWrapperBase    : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@2d6dfe49:org.apache.tomcat.util.net.NioChannel@1cc15a:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8080 remote=/0:0:0:0:0:0:0:1:57539]], Read from buffer: [0]
2019-04-19 23:25:58.303 DEBUG 8212 --- [nio-8080-exec-1] org.apache.tomcat.util.net.NioEndpoint   : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@2d6dfe49:org.apache.tomcat.util.net.NioChannel@1cc15a:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8080 remote=/0:0:0:0:0:0:0:1:57539]], Read direct from socket: [0]
2019-04-19 23:25:58.303 DEBUG 8212 --- [nio-8080-exec-1] o.apache.coyote.http11.Http11Processor   : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@2d6dfe49:org.apache.tomcat.util.net.NioChannel@1cc15a:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8080 remote=/0:0:0:0:0:0:0:1:57539]], Status in: [OPEN_READ], State out: [OPEN]
2019-04-19 23:26:10.967 DEBUG 8212 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Pool stats (total=10, active=0, idle=10, waiting=0)
2019-04-19 23:26:40.542 DEBUG 8212 --- [Engine[Tomcat]]] org.apache.catalina.session.ManagerBase  : Start expire sessions StandardManager at 1555680400542 sessioncount 0
2019-04-19 23:26:40.542 DEBUG 8212 --- [Engine[Tomcat]]] org.apache.catalina.session.ManagerBase  : End expire sessions StandardManager processingTime 0 expired sessions: 0
2019-04-19 23:26:40.969 DEBUG 8212 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Pool stats (total=10, active=0, idle=10, waiting=0)
2019-04-19 23:26:44.541 DEBUG 8212 --- [nnection-reaper] h.i.c.PoolingHttpClientConnectionManager : Closing connections idle longer than 60000 MILLISECONDS
2019-04-19 23:26:44.541 DEBUG 8212 --- [nnection-reaper] h.i.c.PoolingHttpClientConnectionManager : Closing connections idle longer than 60000 MILLISECONDS
2019-04-19 23:26:44.541 DEBUG 8212 --- [nnection-reaper] h.i.c.PoolingHttpClientConnectionManager : Closing connections idle longer than 60000 MILLISECONDS
2019-04-19 23:26:44.541 DEBUG 8212 --- [nnection-reaper] h.i.c.PoolingHttpClientConnectionManager : Closing connections idle longer than 60000 MILLISECONDS

因此,基本上,请求已到达服务器。正在创建响应,但服务器未发送该响应。

0 个答案:

没有答案