1

Sorry, cant post images with low reputation) Here is my settings: Spring Boot: 2.3.0.RELEASE

secret

build.gradle

Intellij Idea IDE Run/Debug Configuration

I have this app working at Pivotal Cloud Foundry. I have runing Remote App and after build through IDE or using

./gradlew clean assemble

I get Exception in thread "File Watcher" java.lang.IllegalStateException: Unexpected 404 NOT_FOUND response uploading class files

error

Oleg Kamuz
  • 29
  • 3
  • Are you intentionally trying to run Dev Tools here? You wouldn't normally do this, and I quote from the docs `Remote support is opt-in as enabling it can be a security risk.`. https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/reference/html/using-spring-boot.html#using-boot-devtools-remote. It should also normally be disabled when you deploy to CF with the Java buildpack. – Daniel Mikusa Jul 04 '20 at 03:58
  • For development purposes to push code changes to remote and automatically make mods and test them immediately. – Oleg Kamuz Jul 04 '20 at 09:00
  • It does not seem like it's able to connect to your app. If you run `cf logs` on your app, do you see any requests to the app? Do you require a proxy to talk to the Internet? – Daniel Mikusa Jul 08 '20 at 19:14
  • 2020-07-16T13:51:24.54+0300 [RTR/7] OUT lsb-tired-elephant-pw.cfapps.io - [2020-07-16T10:51:24.525144702Z] "POST /.~~spring-boot!~/restart HTTP/1.1" 404 2264 6745 "-" "Java/12.0.2" "10.10.66.251:55238" "10.10.148.57:61198" x_forwarded_for:"109.251.102.101, 10.10.66.251" x_forwarded_proto:"https" vcap_request_id:"e4b853b4-e8b5-4814-4084-b7afb7e2947e" response_time:0.020901 gorouter_time:0.000150 app_id:"bbe49967-be62-492f-830f-a40170e0d5af" app_index:"0" x_cf_routererror:"-" x_b3_traceid:"752f82bc4d56f675" x_b3_spanid:"752f82bc4d56f675" x_b3_parentspanid:"-" b3:"752f82bc4d56f675-752f8... – Oleg Kamuz Jul 16 '20 at 11:00
  • Can problem be connected to whether I`m using static or dynamical ip address? – Oleg Kamuz Jul 16 '20 at 11:14
  • I'm not using proxy – Oleg Kamuz Jul 16 '20 at 11:15
  • I was looking at this a bit and what worked for me was just changing `developmentOnly 'org.springframework.boot:spring-boot-devtools'` to `implementation 'org.springframework.boot:spring-boot-devtools'`. I saw the note you must have seen about adding `classpath configurations.developmentOnly`, which seems like it should work but it was unclear to me why you'd want to declare something you need running in production, dev tools in this case, as `developmentOnly` and then mess with the classpath to make it work. It seems less roundabout to just change it to `implementation` which worked. – Daniel Mikusa Jul 16 '20 at 18:37
  • At any rate, you're getting 404s for that post request because the required dependency is missing. You should be able to confirm by running `unzip -l build/libs/your-app.jar | grep -i dev`, and you should see something like ` 223156 07-16-2020 13:17 BOOT-INF/lib/spring-boot-devtools-2.3.1.RELEASE.jar` included in the JAR (your version may vary). If it's missing, then the library isn't being included and that's why you're getting the 404. – Daniel Mikusa Jul 16 '20 at 18:40
  • I got `223155 2020-06-28 20:36 BOOT-INF/lib/spring-boot-devtools-2.3.0.RELEASE.jar` – Oleg Kamuz Jul 16 '20 at 20:03
  • just `implementation` same result – Oleg Kamuz Jul 16 '20 at 20:11
  • What do you see in `cf logs` for the remote app output when you save a change and it generates the error you posted in your question? Also, set `logging.level.org.springframework.boot.devtools=debug` on the remote app. You should minimally see ` o.s.boot.devtools.restart.Restarter : Creating new Restarter for thread Thread[main,5,main]` to indicate devtools are running. – Daniel Mikusa Jul 18 '20 at 18:43
  • yes, `main] o.s.boot.devtools.restart.Restarter : Creating new Restarter for thread Thread[main,5,main]` presents in logs – Oleg Kamuz Jul 18 '20 at 22:03
  • Sorry, I'm not seeing what it could be based on the info here. If you've got a sample app you can point me to that replicates the problem, I'd be happy to take a look and see if I can spot the issue. Maybe someone else has some ideas or things I've overlooked. – Daniel Mikusa Jul 20 '20 at 03:53
  • @DanielMikusa please check your linkedin(sent invite), I will supply any info I have) – Oleg Kamuz Jul 31 '20 at 20:29

1 Answers1

0

Ok, so after looking through your demo app I believe the issue is that you're using Spring Webflux and that's not supported at the moment.

The remote devtools functionality is only available with Spring WebMVC & Servlet. See this Github issue for reference: https://github.com/spring-projects/spring-boot/issues/13092#issuecomment-387350811

Daniel Mikusa
  • 13,716
  • 1
  • 22
  • 28