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

Gretty 4.1.1 requires the src/main/webapp path. #298

Open
mklinkj opened this issue Nov 16, 2023 · 0 comments
Open

Gretty 4.1.1 requires the src/main/webapp path. #298

mklinkj opened this issue Nov 16, 2023 · 0 comments

Comments

@mklinkj
Copy link

mklinkj commented Nov 16, 2023

hello.

In the 3.1.x version, the server didn't fail to start without the src/main/webapp path,
but in the 4.1.1 version, the src/main/webapp path must be present for it to run properly.

The following example project uses thymeleaf and does not have a src/main/webapp path because the viewfiles are in src/resources/templates or src/resources/statics.

Is the src/main/webapp path absolutely necessary in Gretty?

  • exception log (When I removed the webapp path.)
Exception in thread "Thread-1769" java.lang.IllegalStateException: java.nio.file.NoSuchFileException: F:\test\requestMatchers-example-jakarta\src\main\webapp
        at org.eclipse.jetty.util.Scanner.addFile(Scanner.java:434)
        at org.eclipse.jetty.util.Scanner.setScanDirs(Scanner.java:406)
        at org.akhikhl.gretty.JettyScannerManager.startScanner(JettyScannerManager.groovy:70)
        at org.akhikhl.gretty.ScannerManager$startScanner.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callSafe(AbstractCallSite.java:88)
        at org.akhikhl.gretty.DefaultLauncher.beforeJavaExec(DefaultLauncher.groovy:59)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:362)
        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:61)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:176)
        at org.akhikhl.gretty.LauncherBase$_launchThread_closure3.doCall$original(LauncherBase.groovy:180)
        at org.akhikhl.gretty.LauncherBase$_launchThread_closure3.doCall(LauncherBase.groovy)
        at org.akhikhl.gretty.LauncherBase$_launchThread_closure3.doCall$original(LauncherBase.groovy)
        at org.akhikhl.gretty.LauncherBase$_launchThread_closure3.doCall(LauncherBase.groovy)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:274)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)
        at groovy.lang.Closure.call(Closure.java:412)
        at groovy.lang.Closure.call(Closure.java:406)
        at groovy.lang.Closure.run(Closure.java:493)
        at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.nio.file.NoSuchFileException: F:\test\requestMatchers-example-jakarta\src\main\webapp
        at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85)
        at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:96)
        at java.base/sun.nio.fs.WindowsLinkSupport.getRealPath(WindowsLinkSupport.java:258)
        at java.base/sun.nio.fs.WindowsPath.toRealPath(WindowsPath.java:933)

thank you have a good day. 👍

mklinkj added a commit to mklinkj/spring-security-samples that referenced this issue Dec 5, 2023
I have modified the hello-mvc-security example.

Remove Unused HiddenHttpMethodFilter
1. Remove Unused HiddenHttpMethodFilter
2. Gretty 4.x Requirement: Gretty 4.x requires the /src/main/webapp path.
   This prevents failure when running the example project with the appRun task.

* spring-projects#167
* gretty-gradle-plugin/gretty#298

thanks.
mklinkj added a commit to mklinkj/spring-security-samples that referenced this issue Dec 6, 2023
hello.

I have modified the hello-mvc-security example.

Remove Unused HiddenHttpMethodFilter
1. Remove Unused HiddenHttpMethodFilter
2. Gretty 4.x Requirement: Gretty 4.x requires the /src/main/webapp path.
   This prevents failure when running the example project with the appRun task.

* spring-projects#167
* gretty-gradle-plugin/gretty#298

thanks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant