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

asset-pipeline-gradle:5.0.0: java.lang.NoSuchMethodError: 'void groovy.lang.IntRange.<init>(boolean, boolean, int, int)' #349

Open
jamesfredley opened this issue Sep 12, 2024 · 2 comments

Comments

@jamesfredley
Copy link

Sample Grails 7 app: https://github.com/jamesfredley/grails-website-test/tree/7.0.0-SNAPSHOT

This Grails app is very rough and early

it will start with gradle bootRun, but many other things are not functioning and should not be expected to work other than returning some html.

running gradle build or gradle assemble results in the following exception. This appears to be due to Gradle using Groovy 3, which does not have this method signature. It was added in Groovy 4.


* What went wrong:
Execution failed for task ':assetCompile'.
> java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: 'void groovy.lang.IntRange.<init>(boolean, boolean, int, int)'

* Try:
> 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/.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':assetCompile'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:130)
	at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:293)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:128)
	...
	at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:48)
Caused by: java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: 'void groovy.lang.IntRange.<init>(boolean, boolean, int, int)'
	at asset.pipeline.AssetCompiler.compile(AssetCompiler.groovy:308)
	at asset.pipeline.AssetCompiler$compile.call(Unknown Source)
	at asset.pipeline.gradle.AssetCompile.compile(AssetCompile.groovy:138)
	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 org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
	... 145 more
Caused by: java.lang.NoSuchMethodError: 'void groovy.lang.IntRange.<init>(boolean, boolean, int, int)'
	at asset.pipeline.GenericAssetFile.getParentPath(GenericAssetFile.groovy:57)
	at asset.pipeline.processors.AbstractUrlRewritingProcessor.replacementUrl(AbstractUrlRewritingProcessor.groovy:92)
	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 asset.pipeline.processors.CssProcessor$_process_closure1.doCall$original(CssProcessor.groovy:54)
	at asset.pipeline.processors.CssProcessor$_process_closure1.doCall(CssProcessor.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 asset.pipeline.processors.CssProcessor.process(CssProcessor.groovy:47)
	at asset.pipeline.AbstractAssetFile.processedStream(AbstractAssetFile.groovy:181)
	at asset.pipeline.AbstractAssetFile.processedStream(AbstractAssetFile.groovy)
	at asset.pipeline.DirectiveProcessor.fileContents(DirectiveProcessor.groovy:320)
	at asset.pipeline.DirectiveProcessor.loadContentsForTree(DirectiveProcessor.groovy:142)
	at asset.pipeline.DirectiveProcessor.compile(DirectiveProcessor.groovy:71)
	at asset.pipeline.AssetCompiler$_compile_closure4.doCall$original(AssetCompiler.groovy:160)
	at asset.pipeline.AssetCompiler$_compile_closure4.doCall(AssetCompiler.groovy)
	at jdk.internal.reflect.GeneratedMethodAccessor411.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)```
@codeconsole
Copy link
Contributor

One line command to replicate the issue:

git clone https://github.com/codeconsole/website.git -b 7.0.0-SNAPSHOT website7 && cd website7 && ./gradlew bootJar

@jamesfredley
Copy link
Author

PR to resolve #350

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

2 participants