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

Fix inheritance tests from grails 7 upgrade #599

Merged
merged 3 commits into from
Dec 10, 2024

Conversation

jdaugherty
Copy link
Contributor

No description provided.

@jdaugherty
Copy link
Contributor Author

#597

@jdaugherty
Copy link
Contributor Author

This PR fixes the tests, but there still remains #598

@jdaugherty
Copy link
Contributor Author

I'm assuming the additional failures are unrelated to my change @jamesfredley @matrei

The test run is failing with:

	MarkupViewCompilerSpec > Test MarkupViewCompiler compiles templates correctly FAILED
	 java.util.concurrent.ExecutionException at MarkupViewCompilerSpec.groovy:29
	 Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException at ErrorCollector.java:292
	MarkupViewTemplateEngineSpec > test links in markup engine FAILED
	 grails.views.ViewCompilationException at MarkupViewTemplateEngineSpec.groovy:19
	 Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException at MarkupViewTemplateEngineSpec.groovy:19
	MarkupViewTemplateEngineSpec > Test parse markup template FAILED
	 grails.views.ViewCompilationException at MarkupViewTemplateEngineSpec.groovy:48
	 Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException at MarkupViewTemplateEngineSpec.groovy:48

Running with the --stacktrace flag shows this error:

	rg.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
	General error during canonicalization: java.lang.NoClassDefFoundError: Unable to configure org.grails.web.mime.HttpServletRequestExtension due to missing dependency jakarta/servlet/ServletRequest

	java.lang.RuntimeException: java.lang.NoClassDefFoundError: Unable to configure org.grails.web.mime.HttpServletRequestExtension due to missing dependency jakarta/servlet/ServletRequest
		at org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:972)
		at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:692)
		at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:666)
		at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:647)
		at grails.views.AbstractGroovyTemplateCompiler$_compile_closure1.doCall(AbstractGroovyTemplateCompiler.groovy:95)
		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:569)
		at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
		at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
		at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:279)
		at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1007)
		at groovy.lang.Closure.call(Closure.java:433)
		at groovy.lang.Closure.call(Closure.java:412)
		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
		at java.base/java.lang.Thread.run(Thread.java:840)
	Caused by: java.lang.NoClassDefFoundError: Unable to configure org.grails.web.mime.HttpServletRequestExtension due to missing dependency jakarta/servlet/ServletRequest
		at org.codehaus.groovy.vmplugin.v8.Java8.configureClassNode(Java8.java:451)
		at org.codehaus.groovy.ast.ClassNode.lazyClassInit(ClassNode.java:286)
		at org.codehaus.groovy.ast.ClassNode.getMethods(ClassNode.java:428)
		at org.codehaus.groovy.transform.stc.AbstractExtensionMethodCache.scan(AbstractExtensionMethodCache.java:121)
		at org.codehaus.groovy.transform.stc.AbstractExtensionMethodCache.getMethods(AbstractExtensionMethodCache.java:102)
		at org.codehaus.groovy.transform.stc.AbstractExtensionMethodCache.getMethodsFromClassLoader(AbstractExtensionMethodCache.java:79)
		at org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedCommonCache.java:163)
		at org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:154)
		at org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:115)
		at org.codehaus.groovy.transform.stc.AbstractExtensionMethodCache.get(AbstractExtensionMethodCache.java:57)
		at org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.findDGMMethodsForClassNode(StaticTypeCheckingSupport.java:335)
		at org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.findDGMMethodsForClassNode(StaticTypeCheckingSupport.java:322)
		at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.findMethod(StaticTypeCheckingVisitor.java:5147)
		at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitStaticMethodCallExpression(StaticTypeCheckingVisitor.java:2856)
		at org.codehaus.groovy.ast.expr.StaticMethodCallExpression.visit(StaticMethodCallExpression.java:44)
		at org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:117)
		at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:204)
		at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitExpressionStatement(StaticTypeCheckingVisitor.java:2286)
		at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:41)
		at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:142)
		at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:115)
		at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitConstructorOrMethod(StaticTypeCheckingVisitor.java:2753)
		at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:110)
		at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.startMethodInference(StaticTypeCheckingVisitor.java:2736)
		at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethod(StaticTypeCheckingVisitor.java:2715)
		at org.codehaus.groovy.transform.sc.StaticCompilationVisitor.visitConstructorOrMethod(StaticCompilationVisitor.java:192)
		at org.codehaus.groovy.transform.sc.StaticCompilationVisitor.visitMethod(StaticCompilationVisitor.java:207)
		at org.codehaus.groovy.ast.ClassNode.visitMethods(ClassNode.java:1132)
		at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1125)
		at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:52)
		at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitClass(StaticTypeCheckingVisitor.java:451)
		at org.codehaus.groovy.transform.sc.StaticCompilationVisitor.visitClass(StaticCompilationVisitor.java:154)
		at org.codehaus.groovy.transform.sc.StaticCompileTransformation.visit(StaticCompileTransformation.java:68)
		at org.codehaus.groovy.control.customizers.ASTTransformationCustomizer.call(ASTTransformationCustomizer.groovy:303)
		at org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:938)
		... 20 more

	1 error

@jamesfredley jamesfredley linked an issue Dec 10, 2024 that may be closed by this pull request
@jdaugherty
Copy link
Contributor Author

@jamesfredley mentioned that adding testImplementation libs.jakarta.servlet.api to markup/build.gradle fixes the current error, so i've added it. Looks like we still have failures though:

General error during conversion: The interface Renderer cannot be implemented more than once with different arguments: grails.rest.render.Renderer<C> and grails.rest.render.Renderer<T>
  . At [20:1] 
  
  org.codehaus.groovy.syntax.RuntimeParserException: The interface Renderer cannot be implemented more than once with different arguments: grails.rest.render.Renderer<C> and grails.rest.render.Renderer<T>

@jdaugherty jdaugherty merged commit 0c69330 into 4.0.x Dec 10, 2024
7 checks passed
@jdaugherty jdaugherty deleted the grails-7-inheritance-fix branch December 10, 2024 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Grails 7: grails-views: update domain inheritance tests
3 participants