Как решить groovy.lang.MissingMethodException: Нет сигнатуры метода: methodMissing() применим для типов аргументов:() values: []?Как решить groovy.lang.MissingMethodException?
В моем проекте у меня есть два плагина, и я получаю это исключение при запуске одного из плагинов (все функциональные возможности этого плагина отлично)
У меня есть исключение на этой линии для «findAllByStatus»
def newItemList = Item.findAllByStatus(ItemStatus.NEW)
я импортировал Item.groovy в текущем классе обслуживания, также класс сервиса создается при запуске, когда кварц начинает. Я не уверен, связано ли это с кварцем или нет.
Продукт является классом домена.
class Item implements Serializable {
ItemStatus status
Date dateCreated
Date lastUpdated
def updateLastUpdated(){
lastUpdated = new Date()
}
static hasMany = [itemProperties : ItemProperty]
static mapping = {
table 'xcomms_item'
datasource 'xcomms'
}
static constraints = {
batch nullable:true
}
@Override
public int hashCode() {
return 13 * id.hashCode();
}
@Override
public boolean equals(Object obj) {
if ((obj != null) && (obj instanceof Item) && (((Item)obj).id.equals(this.id))) {
return true;
}
return false;
}
}
Трассировка стека:
groovy.lang.MissingMethodException: No signature of method: xcomms.Item.methodMissing() is applicable for argument types:() values: []
at xcomms.CommunicationBatchProcessService.communicationProcesss(CommunicationBatchProcessService.groovy:53)
at xcomms.AutomatedCommunicationJob.execute(AutomatedCommunicationJob.groovy:16)
at grails.plugin.quartz2.GrailsArtefactJob.execute(GrailsArtefactJob.java:59)
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)
2013-11-14 14:20:00,112 [QuartzJobCluster_Worker-2] ERROR quartz2.JobErrorLoggerListener - Exception thrown in job:xcomms.AutomatedCommunicationJob
org.quartz.JobExecutionException: xcomms.communication.exception.CommunicationProcessException: Error in processing communication batch [See nested exception: xcomms.communication.exception.CommunicationProcessException: Error in processing communication batch]
at grails.plugin.quartz2.GrailsArtefactJob.execute(GrailsArtefactJob.java:66)
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)
Caused by: xcomms.communication.exception.CommunicationProcessException: Error in processing communication batch
at xcomms.AutomatedCommunicationJob.execute(AutomatedCommunicationJob.groovy:19)
at grails.plugin.quartz2.GrailsArtefactJob.execute(GrailsArtefactJob.java:59)
... 2 more
Caused by: groovy.lang.MissingMethodException: No signature of method: xcomms.Item.methodMissing() is applicable for argument types:() values: []
at xcomms.CommunicationBatchProcessService.communicationProcesss(CommunicationBatchProcessService.groovy:53)
at xcomms.AutomatedCommunicationJob.execute(AutomatedCommunicationJob.groovy:16)
... 3 more
ItemStatus является:
public enum ItemStatus {
NEW(0,"New"),BATCHED(1,"Batched"),SENT(2,"Sent")
final int id
final String name
private ItemStatus(int id, String name) { this.id = id; this.name = name;}
static ItemStatus getById(int i){
for(entry in ItemStatus.values()){
if(entry.id == i)
return entry
}
}
}
Где вы вызываете «Item.findAllByStatus» и какова полная трассировка стека? (Или, по крайней мере, 10 или около того строк от вершины) –
@tim_yates Я вызвал «Item.findAllByStatus» в классе службы, который является «xcomms.CommunicationBatchProcessService» –
Является ItemStatus.NEW типа ItemStatus? Когда вы говорите «Item.findAllByStatus», он ожидает что-то типа ItemStatus. Можете ли вы включить код для ItemStatus? –