简体   繁体   English

没有方法签名:org.codehaus.groovy.runtime.GStringImpl.split()

[英]No signature of method: org.codehaus.groovy.runtime.GStringImpl.split()

Error Message: 错误信息:

No signature of method: org.codehaus.groovy.runtime.GStringImpl.split() 
is applicable for argument types: (java.lang.String) values: [:]

Possible solutions: split(), split(), split(groovy.lang.Closure), 
plus(java.lang.String), wait(),toList()

Code snippet: 程式码片段:

static getRosterId(def session) {
     session.filter?.split(':')[0]
}
static getSubject(def session) {
    session.filter?.split(':')[1]
}

JDK: JDK:

OpenJDK Runtime Environment (IcedTea6 1.12.6) (6b27-1.12.6-1ubuntu0.12.04.4)OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

Grails Version: Grails版本:

2.0.1

Ubuntu Version: Ubuntu版本:

Ubuntu 12.04.3 LTS (GNU/Linux 3.8.0-29-generic x86_64)

this is doing a split on what should be a normal String... of course it's a GString while in grails, this code works in production, on our local boxes, but does not work on our CI Ubuntu server.... not sure why Grails wouldn't be able to resolve String methods in this particular environment, we are not doing anything special in this class, no String.metaClass manipulation... straight Grails. 这正在对应该是普通String的内容进行拆分...当然,这是GString,而在grails中,此代码可以在生产环境中,在我们的本地机器上使用,但在我们的CI Ubuntu服务器上不可用...。不确定为什么Grails在这种特定环境下无法解析String方法,我们在此类中没有做任何特别的事情,没有String.metaClass的操作……直接Grails。

Any input would be awesome 任何输入都会很棒

Our final fix was 我们的最终解决方法是

static getRosterId(def session) {
     session.filter?.toString().split(':')[0]
}
static getSubject(def session) {
     session.filter?.toString().split(':')[1]
}

This should not be needed in Groovy! 在Groovy中不需要此功能! :( a GStringImpl Object should resolve all GString and java.lang.String methods :/ :( GStringImpl对象应该解析所有GString和java.lang.String方法:/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Grails 3.3.10中的org.codehaus.groovy.runtime.DefaultGroovyMethods错误 - Error for org.codehaus.groovy.runtime.DefaultGroovyMethods in Grails 3.3.10 更新到2.3.9 - 执行脚本RunApp时出错:org / codehaus / groovy / runtime / typehandling / ShortTypeHandling - Update to 2.3.9 - Error executing script RunApp: org/codehaus/groovy/runtime/typehandling/ShortTypeHandling 部署Grails应用程序时出错:java.lang.NoClassDefFoundError:org / codehaus / groovy / runtime / BytecodeInterface8 - Error when deploying Grails app: java.lang.NoClassDefFoundError: org/codehaus/groovy/runtime/BytecodeInterface8 无法解析类org.codehaus.groovy.grails.commons.ApplicationHolder - unable to resolve class org.codehaus.groovy.grails.commons.ApplicationHolder 找不到org.codehaus.groovy.grails.cli.support.GrailsS​​tarter错误 - org.codehaus.groovy.grails.cli.support.GrailsStarter not found error Groovy / Grails没有方法签名 - Groovy/Grails No signature of method 转换期间的一般错误:java.lang.NoClassDefFoundError: org/codehaus/groovy/grails/commons/ApplicationAttributes - General error during conversion: java.lang.NoClassDefFoundError: org/codehaus/groovy/grails/commons/ApplicationAttributes 我该如何解决:“ ClassDefFoundError:org / codehaus / groovy / grails / commons / ConfigurationHolder”? - How do I fix this: “ClassDefFoundError: org/codehaus/groovy/grails/commons/ConfigurationHolder”? 升级到 grails 3,现在无法解析类 org.codehaus.groovy.grails.web.servlet.mvc.GrailsParameterMap - Upgraded to grails 3 and now get unable to resolve class org.codehaus.groovy.grails.web.servlet.mvc.GrailsParameterMap org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException:处理GroovyPageView时出错:找不到模板 - org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: Template not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM