watchUrls fail if build/classes/java/main is missing
See original GitHub issueIf you have no java source files the build/classes/java/main won’t exist. When you run your ktor application you get this error:
Exception in thread "main" java.nio.file.NoSuchFileException: D:\wadaxw\awdawdx\awdad\awdaw\awdawd\build\classes\java\main
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:53)
at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:38)
at sun.nio.fs.WindowsFileSystemProvider.readAttributes(WindowsFileSystemProvider.java:193)
at java.nio.file.Files.readAttributes(Files.java:1737)
at java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:219)
at java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:276)
at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:322)
at java.nio.file.Files.walkFileTree(Files.java:2662)
at java.nio.file.Files.walkFileTree(Files.java:2742)
at org.jetbrains.ktor.host.ApplicationHostEnvironmentReloading.watchUrls(ApplicationHostEnvironmentReloading.kt:204)
at org.jetbrains.ktor.host.ApplicationHostEnvironmentReloading.createClassLoader(ApplicationHostEnvironmentReloading.kt:153)
at org.jetbrains.ktor.host.ApplicationHostEnvironmentReloading.createApplication(ApplicationHostEnvironmentReloading.kt:115)
at org.jetbrains.ktor.host.ApplicationHostEnvironmentReloading.start(ApplicationHostEnvironmentReloading.kt:219)
at org.jetbrains.ktor.netty.NettyApplicationHost.start(NettyApplicationHost.kt:35)
at org.jetbrains.ktor.netty.NettyApplicationHost.start(NettyApplicationHost.kt:15)
at org.jetbrains.ktor.host.ApplicationHost$DefaultImpls.start$default(ApplicationHost.kt:20)
at org.jetbrains.ktor.netty.DevelopmentHost.main(CommandLine.kt:9)
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, so I’m guessing it’s the Gradle plugin not creating the Java folder if there are no Java classes. Hopefully an easy fix.
On Sat, 14 Oct 2017, 08:36 Magnus Vinther, notifications@github.com wrote:
What’s runtime classpath for the application? Can it be gradle adding non-existing folders there? Said that, I think we indeed should check if folders from classpath exist.