No signature of method call()?

What does this error in the log mean? How do I figure out what line of code is the offending line, and what do I do about it? I don't really know what the call() method is....

org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: user_driver_dcm_withings_Withings_Sleep_Sensor_682.call() is applicable for argument types: (java.lang.String) values:
.....
Possible solutions: main(java.lang.String), wait(), any(), wait(long), main(java.util.List), main([Ljava.lang.String;) (method call)

THere's a big data object that I'm trying to convert to a string for writing to a local file

1 Like

What does the code that is throwing that error look like?

That's kinda the problem. I can't figure out which line is throwing it... the log doesn't tell me a line number....

I usually get that when I miss a parameter in a function call or get a closure wrong or something. It's usually a code error that parses but doesn't get interpreted correctly at runtime.

I agree, hard to track down. If I can't get into the ballpark from looking at the code, I just do a log print per line in my method to see where it breaks down, then go from there.

This error also happens if your code is calling a function that doesn’t exist. I personally do this on purpose sometimes to determine the data type of a variable since it appears in the error. JavaScript has a “typeof” function that doesn’t work in Groovy.

2 Likes

My suspicion is that it's this line:
dev jsonString = JsonOutput.toJson(detailedData)

where detailedData is a big long data structure received from an API that I think is JSON. Hmmm..

Ah. And there it is. Dang it.

Since when did defining a variable require you to use "def" instead of "dev". Doh. The tricky part here was that there was a variable already called "dev" and so I guess the compiler thought I was trying to reference the "dev" variable rather than trying to define a new variable with a mistakenly typed "def"

This would have been so much easier if the log had told me a line number - is that technically infeasible or an oversight on the hub side?

1 Like

Perhaps we should check in with whoever maintains the JVM bytecode on this platform. Is it @gopher.ny ?

Groovy dynamic method invocation doesn't always produce line numbers. We show them when they are available. MissingMethodExceptionNoStack means no stack trace, meaning no line numbers to work with :frowning:

2 Likes

Moral of the story: Log( ) early and Log( ) often.

3 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.