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

./dtcw previewSite fails with java.lang.NoClassDefFoundError: org/gradle/api/internal/artifacts/dsl/dependencies/DependencyFactory$ClassPathNotation #1309

Closed
nfrohmueller opened this issue Dec 4, 2023 · 4 comments

Comments

@nfrohmueller
Copy link

Describe the bug
When running ./dtcw previewSite or ./dtcw docker previewSite the build fails in task :jettyRun throwing the exception

Caused by: java.lang.NoClassDefFoundError: org/gradle/api/internal/artifacts/dsl/dependencies/DependencyFactory$ClassPathNotation
        at org.akhikhl.gretty.DefaultLauncher.getCurrentGroovy(DefaultLauncher.groovy:44)
        at org.akhikhl.gretty.DefaultLauncher$getCurrentGroovy$0.callStatic(Unknown Source)
        at org.akhikhl.gretty.DefaultLauncher.getRunnerClassPath(DefaultLauncher.groovy:37)
        at org.akhikhl.gretty.DefaultLauncher$getRunnerClassPath.callStatic(Unknown Source)
        at org.akhikhl.gretty.DefaultLauncher.beforeLaunch(DefaultLauncher.groovy:69)
        at org.akhikhl.gretty.LauncherBase.launch(LauncherBase.groovy:141)

To Reproduce
Steps to reproduce the behavior:

  1. In a clean project dir, install the arc42 template following the guidelines https://doctoolchain.org/docToolchain/v2.0.x/010_manual/20_install.html#_installation_overview and run the previewSite-task. (It also fails in a real project, no relation to the chosen template).
curl -Lo dtcw https://doctoolchain.org/dtcw
chmod +x dtcw
./dtcw install doctoolchain
./dtcw docker downloadTemplate
./dtcw docker generateSite
./dtcw docker previewSite
  1. Error:
❯ ./dtcw docker previewSite
dtcw 0.50 - ##DTCW_GIT_HASH##
docToolchain 3.1.2
OS/arch: Darwin/x86_64
Available docToolchain environments: local sdk docker
Environments with docToolchain [3.1.2]: local docker
Using environment: docker
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/8.1.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build
> Task :core:compileJava NO-SOURCE
> Task :core:compileGroovy
> Task :core:processResources NO-SOURCE
> Task :core:classes
> Task :core:jar
> Task :previewSite
> Task :prepareInplaceWebAppFolder NO-SOURCE
> Task :createInplaceWebAppFolder
> Task :compileJava NO-SOURCE
> Task :compileGroovy NO-SOURCE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
> Task :prepareInplaceWebAppClasses UP-TO-DATE
> Task :prepareInplaceWebApp
> Task :jettyRun FAILED
FAILURE: Build failed with an exception.


* What went wrong:
Execution failed for task ':jettyRun'.
> org/gradle/api/internal/artifacts/dsl/dependencies/DependencyFactory$ClassPathNotation

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 31s
5 actionable tasks: 5 executed

Expected behavior
The `previewSite task should finish without throwing an error

Configuration

  • docToolchain 3.1.2
  • OS: macOS (docker / java)
  • Relevant JDK 17, gradle 8.1.1
@rdmueller
Copy link
Member

verified as bug.

but shouldn't be a blocker. call open build/microsite/output/index.html instead. No server needed anymore.

@PacoVK
Copy link
Collaborator

PacoVK commented Dec 4, 2023

Could we get rid of the Webserver dependency then? @rdmueller ? Afaik this dependency is quite old due to lack of Java 8 support in newer versions but since we dropped 8 in v3.x we may now decide to get rid at all

@rdmueller
Copy link
Member

yes, good idea. let's replace it with a hint that you can view build/microsite/output/index.html directly in the browse, or, if you want a server, use python -m http.server.
Who wants to create this PR?

@PacoVK
Copy link
Collaborator

PacoVK commented Jan 2, 2024

won't resolve since #1310 deprecated the previewSite task

@PacoVK PacoVK closed this as completed Jan 2, 2024
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

3 participants