question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

watchUrls fail if build/classes/java/main is missing

See original GitHub issue

If 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:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
chrisjenxcommented, Oct 14, 2017

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:

I’m using Gradle (with the ‘application’ plugin) and IntelliJ 😃

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Kotlin/ktor/issues/217#issuecomment-336617332, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHRsSDi11Es450CyFVCn9A_C9-biGDGks5ssGSGgaJpZM4P3Usw .

1reaction
orangycommented, Oct 12, 2017

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found