无法解析类groovy.json.JsonSlurpe

时间:2017-08-24 08:08:44

标签: groovy soapui ready-api

我收到以下错误消息:

    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script3.groovy: 1: unable to resolve class groovy.json.JsonSlurpe @ line 1, column 1. import groovy.json.JsonSlurpe ^ 
    org.codehaus.groovy.syntax.SyntaxException: unable to resolve class groovy.json.JsonSlurpe @ line 1, column 1. at 
    org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:149) at 
    org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1225) at 
    org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:178) at 
    org.codehaus.groovy.control.CompilationUnit$11.call(CompilationUnit.java:651) at 
    org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:931) at 
    org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:593) at 
    org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:542) at 

2 个答案:

答案 0 :(得分:7)

尝试更改第一行。琐碎的错字。

来自:

import groovy.json.JsonSlurpe

收件人:

import groovy.json.JsonSlurper

答案 1 :(得分:0)

你的第一行应该是这样的...

导入 net.sf.json.groovy.JsonSlurper

这对我有用。