【问题标题】:Grails/Groovy string errorGrails/Groovy 字符串错误
【发布时间】:2014-07-19 02:57:25
【问题描述】:

我收到以下我似乎无法理解的错误:

| Error 2014-07-19 02:31:31,563 [http-bio-8080-exec-5] ERROR errors.GrailsExceptionResolver  - MissingMethodException occurred when processing request: [POST] /FatcaOne_0/customer/upload - parameters:
dataTypegrp: 3
fileTypegrp: 1
No signature of method: java.lang.String.negative() is applicable for argument types: () values: []
Possible solutions: notify(), next(), normalize(), next(), normalize(). Stacktrace follows:
Message: No signature of method: java.lang.String.negative() is applicable for argument types: () values: []
Possible solutions: notify(), next(), normalize(), next(), normalize()
    Line | Method
->>  238 | doCall                         in com.twc.fatcaone.FileImportService$_$tt__excelIndividualFileUpload_closure16$$EOkQLTQ0
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    162 | $tt__excelIndividualFileUpload in com.twc.fatcaone.FileImportService$$EOkQLTQ0
|    147 | upload . . . . . . . . . . . . in com.twc.fatcaone.CustomerController
|    198 | doFilter                       in grails.plugin.cache.web.filter.PageFragmentCachingFilter
|     63 | doFilter . . . . . . . . . . . in grails.plugin.cache.web.filter.AbstractFilter
|   1145 | runWorker                      in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . . . . . . . . . . .  in java.util.concurrent.ThreadPoolExecutor$Worker
^    744 | run                            in java.lang.Thread

这个错误指向的代码行读作:

def (redFlags, yellowFlags) = processExistingIndividualRecordFlags(incomingRecord, recordThatAlreadyExists, params)

我在一个循环中反复调用这条线,之前几次调用它并没有造成任何问题。所以我很困惑我对String 做了什么/在哪里,这似乎导致了这个与String 相关的错误。

【问题讨论】:

  • processExistingIndividualRecordFlags的内容是什么?
  • FileImportService 正在尝试对不存在的字符串调用negative()。 238 号线附近发生了什么?
  • 正如@MartinHauner 所说,我认为您在参数上使用 - ,假设传入值是数字类型。

标签: grails groovy


【解决方案1】:

当我试图从列表中删除一个字符串并将我的“-”和“=”倒退时,我曾经遇到过这个错误:

listOfStrings =- stringTobeRemoved

【讨论】:

  • 有趣的是,运行时并没有深入研究包含错误行的函数,而是选择了调用包含错误行的函数的行。这就是难以导航到错误的原因。
猜你喜欢
  • 2019-03-04
  • 1970-01-01
  • 2012-05-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-01-03
  • 2016-04-25
  • 1970-01-01
相关资源
最近更新 更多