![](/img/trans.png)
[英]Jenkins groovy MissingMethodException No signature of method
[英]MissingMethodException in Groovy: No signature of method
在Groovy中使用以下代碼時...
def printDocument(deviceName, document, resolution, documentName, creatorName, xOffset, yOffset, startPage, endPage, numCopies) {
// do stuff...
)
printDocument(
'Printer name',
'C:/temp/test.pdf',
600,
'My document',
'John Doe',
0,
0,
0,
0,
1)
...我得到以下異常:
捕獲:groovy.lang.MissingMethodException:方法printDocument()的簽名不適用於參數類型(java.lang.String,java.lang.String,java.lang.Integer,java.lang.String,java.lang.String ,java.lang.Integer,java.lang.Integer,java.lang.Integer,java.lang.Integer,java.lang.Integer)
據我所知,參數數目是正確的。 任何想法為何此方法調用失敗?
您用)
而不是}
關閉方法,然后在groovy控制台中可以正常工作
應該:
def printDocument(deviceName, document, resolution, documentName, creatorName, xOffset, yOffset, startPage, endPage, numCopies) {
// do stuff...
}
當然,除非您錯誤地粘貼了一些對問題有用的東西?
如果那不能解決您的問題,您是否可以查找/編寫一些在遇到問題的上下文中能夠解決問題的代碼?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.