Hello, community, After I upgrade one of my grail...
# questions
g
Hello, community, After I upgrade one of my grails 6 project to 7.0.0-M3, I got this error
Copy code
Caused by: java.lang.NoClassDefFoundError: org.grails.web.sitemesh.GroovyPageLayoutFinder
        at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveClass(AsmReferenceResolver.java:46)
        at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveNonArrayType(AsmReferenceResolver.java:79)
        at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveType(AsmReferenceResolver.java:70)
        at org.codehaus.groovy.ast.decompiled.MemberSignatureParser.resolve(MemberSignatureParser.java:172)
        at org.codehaus.groovy.ast.decompiled.MemberSignatureParser.createMethodNode(MemberSignatureParser.java:64)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.lambda$createMethodNode$1(DecompiledClassNode.java:267)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.createMethodNode(DecompiledClassNode.java:273)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.lazyInitMembers(DecompiledClassNode.java:240)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.getFields(DecompiledClassNode.java:218)
        at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:176)
        at org.codehaus.groovy.classgen.VariableScopeVisitor.findVariableDeclaration(VariableScopeVisitor.java:244)
        at org.codehaus.groovy.classgen.VariableScopeVisitor.visitVariableExpression(VariableScopeVisitor.java:600)
        at org.codehaus.groovy.ast.expr.VariableExpression.visit(VariableExpression.java:71)
        at org.codehaus.groovy.ast.CodeVisitorSupport.visitBinaryExpression(CodeVisitorSupport.java:201)
        at org.codehaus.groovy.classgen.VariableScopeVisitor.visitBinaryExpression(VariableScopeVisitor.java:463)
        at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:60)
        at org.codehaus.groovy.classgen.VariableScopeVisitor.visitDeclarationExpression(VariableScopeVisitor.java:543)
        at org.codehaus.groovy.ast.expr.DeclarationExpression.visit(DeclarationExpression.java:89)
        at org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:117)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:204)
        at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:41)
        at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:86)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:168)
        at org.codehaus.groovy.classgen.VariableScopeVisitor.visitBlockStatement(VariableScopeVisitor.java:423)
        at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:72)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:142)
        at org.codehaus.groovy.classgen.VariableScopeVisitor.visitConstructorOrMethod(VariableScopeVisitor.java:412)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:110)
        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.classgen.VariableScopeVisitor.visitClass(VariableScopeVisitor.java:371)
        at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1310)
        at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:258)
        at org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit.lambda$new$0(JavaAwareCompilationUnit.java:82)
        at org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:938)
        ... 34 more
  Caused by: java.lang.NoClassDefFoundError: org.grails.web.sitemesh.GroovyPageLayoutFinder
        at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveClass(AsmReferenceResolver.java:46)
        at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveNonArrayType(AsmReferenceResolver.java:79)
        at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveType(AsmReferenceResolver.java:70)
        at org.codehaus.groovy.ast.decompiled.MemberSignatureParser.resolve(MemberSignatureParser.java:172)
        at org.codehaus.groovy.ast.decompiled.MemberSignatureParser.createMethodNode(MemberSignatureParser.java:64)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.lambda$createMethodNode$1(DecompiledClassNode.java:267)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.createMethodNode(DecompiledClassNode.java:273)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.lazyInitMembers(DecompiledClassNode.java:240)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.getFields(DecompiledClassNode.java:218)
        at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:176)
        at org.codehaus.groovy.classgen.VariableScopeVisitor.findVariableDeclaration(VariableScopeVisitor.java:244)
        at org.codehaus.groovy.classgen.VariableScopeVisitor.visitVariableExpression(VariableScopeVisitor.java:600)
        at org.codehaus.groovy.ast.expr.VariableExpression.visit(VariableExpression.java:71)
        at org.codehaus.groovy.ast.CodeVisitorSupport.visitBinaryExpression(CodeVisitorSupport.java:201)
        at org.codehaus.groovy.classgen.VariableScopeVisitor.visitBinaryExpression(VariableScopeVisitor.java:463)
        at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:60)
        at org.codehaus.groovy.classgen.VariableScopeVisitor.visitDeclarationExpression(VariableScopeVisitor.java:543)
        at org.codehaus.groovy.ast.expr.DeclarationExpression.visit(DeclarationExpression.java:89)
        at org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:117)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:204)
        at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:41)
        at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:86)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:168)
        at org.codehaus.groovy.classgen.VariableScopeVisitor.visitBlockStatement(VariableScopeVisitor.java:423)
        at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:72)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:142)
        at org.codehaus.groovy.classgen.VariableScopeVisitor.visitConstructorOrMethod(VariableScopeVisitor.java:412)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:110)
        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.classgen.VariableScopeVisitor.visitClass(VariableScopeVisitor.java:371)
        at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1310)
        at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:258)
        at org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit.lambda$new$0(JavaAwareCompilationUnit.java:82)
        at org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:938)
        ... 34 more
what could be possibly wrong here?
j
That class does not exist in grails-gsp, so are you referencing an older version of sitemesh plugin? Where is the reference to GroovyPageLayoutFinder in your project?
g
I did not use this class directly at all. It must be from an older version of sitemesh., but I just could find where I refer this sitemesh. Here is my gradle.properties
Copy code
grailsVersion=7.0.0-M3
grailsGradlePluginVersion=7.0.0-M3
gormVersion=9.0.0-M2
groovyVersion=4.0.25
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx2048M
However, under my intelliJ external libraries, I still saw many groovy-xxxx-3.0.22.jar. Could this be related? I also attached my dependencies under org.grails, I can see sitemesh3 is there.
j
Those groovy libs are the ones provided by gradle to execute the build and build plugins and are fine. The project will still use Groovy 4 for nearly everything.
👍 1
The grails dependencies look right. If you can't find the cause, please create an issue on https://github.com/grails/grails-gsp/issues with a simple example.
g
Let me do a bit more investigation to segregate the issue before creating the ticket, Otherwise it wont be too much helpful. Thanks for helping
👍 2
@James Fredley This could be an issue with spring security UI. Now I had removed the spring security UI dependencies, After I remove that, the error is gone
I still could not make my app fully issue free yet. but very promising at this point. I already can tell the performance is a huge boost. Will work during the weekend to try to bring the App up. I would say it is worth the upgrade. Grails 7 is very developer friendly.
j
That is awesome to hear. If it Spring Security UI, that has been merged into https://github.com/grails/grails-spring-security/issues, please create and issue there, to track it.
We have caught all the dependencies up, with the exception of hibernate and jansi and being able to use Java 21 should give it a huge boost.
g
Will do. btw, Thanks for this great work! I still see Grails is a fantastic framework to give the startup team a power to build a decent app I got one question here. For all the JsonObject from JsonSlurper, say, jsonObj[‘att1’][‘sub_attr1’] stopped working with @GrailsCompileStatic. (I believe this is because of Groovy 4) Currently I have to remove the @GrailsCompileStatic from all Groovy code with this function, Do you have a better solution for it?