Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvalidPathException on Windows with web-dependency-locator and webRoot #41237

Closed
shemminga opened this issue Jun 17, 2024 · 1 comment · Fixed by #41271
Closed

InvalidPathException on Windows with web-dependency-locator and webRoot #41237

shemminga opened this issue Jun 17, 2024 · 1 comment · Fixed by #41271
Assignees
Labels
env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@shemminga
Copy link

Describe the bug

On Windows, with the quarkus-web-dependency-locator extension included and src/main/resources/web/test.html present, an InvalidPathException occurs. The exception indicates that web/* contains an illegal character (*).

The triggering HotDeploymentWatchedFileBuildItem is created here:
https://github.com/quarkusio/quarkus/blob/3.11.2/extensions/web-dependency-locator/deployment/src/main/java/io/quarkus/webdependency/locator/deployment/WebDependencyLocatorProcessor.java#L58

Though the error gets triggered here:

The Paths.get() will end in sun.nio.fs.WindowsPathParser rejecting the input because of that *.

Expected behavior

Successful start.

Actual behavior

An exception occurs:

Failed to start quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.deployment.dev.HotDeploymentWatchedFileBuildStep#setupWatchedFileHotDeployment threw an exception: java.nio.file.InvalidPathException: Illegal char <*> at index 4: web/*

How to Reproduce?

  1. quarkus.cmd create app -x quarkus-web-dependency-locator
  2. cd .\code-with-quarkus\
  3. mkdir .\src\main\resources\web
  4. echo 'Test' > .\src\main\resources\web\test.html
  5. quarkus.cmd dev
    • Exception: java.nio.file.InvalidPathException: Illegal char <*> at index 4: web/*
  6. rm .\src\main\resources\web\test.html
  7. rmdir .\src\main\resources\web\
  8. quarkus.cmd dev
    • Successful start

Output of uname -a or ver

Windows 11 Pro (version 10.0.22631 N/A Build 22631)

Output of java -version

openjdk version "21.0.2" 2024-01-16

Quarkus version or git rev

3.11.2

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)

Additional information

Full stack trace:

2024-06-17 02:56:05,604 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (vert.x-worker-thread-2) Failed to start quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.deployment.dev.HotDeploymentWatchedFileBuildStep#setupWatchedFileHotDeployment threw an exception: java.nio.file.InvalidPathException: Illegal char <*> at index 4: web/*
        at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:204)
        at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:175)
        at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
        at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:231)
        at java.base/java.nio.file.Path.of(Path.java:148)
        at java.base/java.nio.file.Paths.get(Paths.java:69)
        at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.setWatchedFilePathsInternal(RuntimeUpdatesProcessor.java:1206)
        at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.setWatchedFilePaths(RuntimeUpdatesProcessor.java:1146)
        at io.quarkus.deployment.dev.HotDeploymentWatchedFileBuildStep.setupWatchedFileHotDeployment(HotDeploymentWatchedFileBuildStep.java:37)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
        at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
        at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
        at java.base/java.lang.Thread.run(Thread.java:1583)
        at org.jboss.threads.JBossThread.run(JBossThread.java:483)

        at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:331)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.reloadExistingApplication(AugmentActionImpl.java:265)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.reloadExistingApplication(AugmentActionImpl.java:58)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.restartApp(IsolatedDevModeMain.java:191)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.restartCallback(IsolatedDevModeMain.java:174)
        at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.doScan(RuntimeUpdatesProcessor.java:547)
        at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.doScan(RuntimeUpdatesProcessor.java:447)
        at io.quarkus.vertx.http.runtime.devmode.VertxHttpHotReplacementSetup$6.call(VertxHttpHotReplacementSetup.java:161)
        at io.quarkus.vertx.http.runtime.devmode.VertxHttpHotReplacementSetup$6.call(VertxHttpHotReplacementSetup.java:148)
        at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$0(ContextImpl.java:178)
        at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:279)
        at io.vertx.core.impl.ContextImpl.lambda$internalExecuteBlocking$2(ContextImpl.java:210)
        at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
        at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1495)
        at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:11)
        at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:11)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.deployment.dev.HotDeploymentWatchedFileBuildStep#setupWatchedFileHotDeployment threw an exception: java.nio.file.InvalidPathException: Illegal char <*> at index 4: web/*
        at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:204)
        at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:175)
        at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
        at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:231)
        at java.base/java.nio.file.Path.of(Path.java:148)
        at java.base/java.nio.file.Paths.get(Paths.java:69)
        at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.setWatchedFilePathsInternal(RuntimeUpdatesProcessor.java:1206)
        at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.setWatchedFilePaths(RuntimeUpdatesProcessor.java:1146)
        at io.quarkus.deployment.dev.HotDeploymentWatchedFileBuildStep.setupWatchedFileHotDeployment(HotDeploymentWatchedFileBuildStep.java:37)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
        at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
        at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
        at java.base/java.lang.Thread.run(Thread.java:1583)
        at org.jboss.threads.JBossThread.run(JBossThread.java:483)

        at io.quarkus.builder.Execution.run(Execution.java:123)
        at io.quarkus.builder.BuildExecutionBuilder.execute(BuildExecutionBuilder.java:79)
        at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:160)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:327)
        ... 19 more
Caused by: java.nio.file.InvalidPathException: Illegal char <*> at index 4: web/*
        at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:204)
        at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:175)
        at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
        at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:231)
        at java.base/java.nio.file.Path.of(Path.java:148)
        at java.base/java.nio.file.Paths.get(Paths.java:69)
        at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.setWatchedFilePathsInternal(RuntimeUpdatesProcessor.java:1206)
        at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.setWatchedFilePaths(RuntimeUpdatesProcessor.java:1146)
        at io.quarkus.deployment.dev.HotDeploymentWatchedFileBuildStep.setupWatchedFileHotDeployment(HotDeploymentWatchedFileBuildStep.java:37)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
        at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
        at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
        at java.base/java.lang.Thread.run(Thread.java:1583)
        at org.jboss.threads.JBossThread.run(JBossThread.java:483)
@shemminga shemminga added the kind/bug Something isn't working label Jun 17, 2024
@quarkus-bot quarkus-bot bot added env/windows Impacts Windows machines triage/needs-triage labels Jun 17, 2024
@geoand
Copy link
Contributor

geoand commented Jun 17, 2024

cc @ia3andy @phillip-kruger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants