运行 jsonpath.getInt("element") 时,我遇到错误: java.lang.NoSuchMethodError: org.codehaus.groovy.runtime.memoize.EvictableCache.getAndPut

发布于 2025-01-11 13:20:39 字数 3617 浏览 0 评论 0 原文

我正在研究 REST Assured Automation,并使用 JSONPATH 使用 jsonpath.getInt("id") 获取元素值,但根据错误日志,它似乎是 Groovy 错误,无法解决此问题。任何人都可以参与吗?

    org.codehaus.groovy.transform.stc.AbstractExtensionMethodCache.get(AbstractExtensionMethodCache.java:51)
    org.codehaus.groovy.macro.transform.MacroCallTransformingVisitor.findMacroMethods(MacroCallTransformingVisitor.java:119)
    org.codehaus.groovy.macro.transform.MacroCallTransformingVisitor.visitMethodCallExpression(MacroCallTransformingVisitor.java:90)
    org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:66)
    org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:71)
    org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:196)
    org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
    org.codehaus.groovy.ast.MethodCallTransformation.visit(MethodCallTransformation.java:49)
    org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:321)
    org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:931)
    org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:593)
    org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
    org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
    groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
    groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
    groovy.lang.GroovyShell.parseClass(GroovyShell.java:694)
    groovy.lang.GroovyShell.parse(GroovyShell.java:706)
    groovy.lang.GroovyShell.evaluate(GroovyShell.java:590)
    groovy.lang.GroovyShell.evaluate(GroovyShell.java:629)
    groovy.lang.GroovyShell.evaluate(GroovyShell.java:600)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrap.invoke(PogoMetaMethodSite.java:190)
    org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:71)
    org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    io.restassured.internal.path.json.JSONAssertion.eval(JSONAssertion.groovy:80)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
    org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
    org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:182)
    io.restassured.internal.path.json.JSONAssertion.getAsJsonObject(JSONAssertion.groovy:46)
    io.restassured.internal.path.json.JSONAssertion$getAsJsonObject.callCurrent(Unknown Source)
    io.restassured.internal.path.json.JSONAssertion.getResult(JSONAssertion.groovy:28)
    io.restassured.path.json.JsonPath.get(JsonPath.java:203)
    io.restassured.path.json.JsonPath.getInt(JsonPath.java:237)
    com.ukg.sreautomation.utils.CompareUtils.elementValue(CompareUtils.java:147)

I am working on REST Assured Automation and using JSONPATH to get element values using jsonpath.getInt("id") but asper error logs it seemed to be Groovy Error, Unable to resolve this issue. Can anyone please pitch in.

    org.codehaus.groovy.transform.stc.AbstractExtensionMethodCache.get(AbstractExtensionMethodCache.java:51)
    org.codehaus.groovy.macro.transform.MacroCallTransformingVisitor.findMacroMethods(MacroCallTransformingVisitor.java:119)
    org.codehaus.groovy.macro.transform.MacroCallTransformingVisitor.visitMethodCallExpression(MacroCallTransformingVisitor.java:90)
    org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:66)
    org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:71)
    org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:196)
    org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
    org.codehaus.groovy.ast.MethodCallTransformation.visit(MethodCallTransformation.java:49)
    org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:321)
    org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:931)
    org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:593)
    org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
    org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
    groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
    groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
    groovy.lang.GroovyShell.parseClass(GroovyShell.java:694)
    groovy.lang.GroovyShell.parse(GroovyShell.java:706)
    groovy.lang.GroovyShell.evaluate(GroovyShell.java:590)
    groovy.lang.GroovyShell.evaluate(GroovyShell.java:629)
    groovy.lang.GroovyShell.evaluate(GroovyShell.java:600)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrap.invoke(PogoMetaMethodSite.java:190)
    org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:71)
    org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    io.restassured.internal.path.json.JSONAssertion.eval(JSONAssertion.groovy:80)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
    org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
    org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:182)
    io.restassured.internal.path.json.JSONAssertion.getAsJsonObject(JSONAssertion.groovy:46)
    io.restassured.internal.path.json.JSONAssertion$getAsJsonObject.callCurrent(Unknown Source)
    io.restassured.internal.path.json.JSONAssertion.getResult(JSONAssertion.groovy:28)
    io.restassured.path.json.JsonPath.get(JsonPath.java:203)
    io.restassured.path.json.JsonPath.getInt(JsonPath.java:237)
    com.ukg.sreautomation.utils.CompareUtils.elementValue(CompareUtils.java:147)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文