groovy.lang.MissingMethodException: No signature of method: $Proxy0.doIt() is applicable for argument types: () values: {}

Apache's JIRA Issue Tracker | Martin Mavrov | 9 years ago
  1. 0

    [GROOVY-2583] "object is not an instance of declaring class" thrown invoking a method on Groovy class, wrapped in a Spring proxy - ASF JIRA

    apache.org | 1 year ago
    groovy.lang.MissingMethodException: No signature of method: $Proxy0.doIt() is applicable for argument types: () values: {}
  2. 0

    [GROOVY-2583] "object is not an instance of declaring class" thrown invoking a method on Groovy class, wrapped in a Spring proxy - ASF JIRA

    apache.org | 12 months ago
    groovy.lang.MissingMethodException: No signature of method: $Proxy0.doIt() is applicable for argument types: () values: {}
  3. 0

    I suspect this is connected with GROOVY-2006, here is the case: I have two Spring-loaded groovy scripts, marked with refresh-check-delay, which loads them as CGLIB proxies. Invoking a method on the proxy instance, I get {code:none} Exception in thread "main" java.lang.IllegalArgumentException: object is not an instance of declaring class at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740) at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:777) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:757) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0(ScriptBytecodeAdapter.java:195) at X.doIt(script1.groovy]:5) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy1.doIt(Unknown Source) at TestMe.main(TestMe.java:20) {code} {code:title=script1.groovy} class X implements Doable { def prop void doIt() { println prop.getClass().getName(); prop.doIt(); } } {code} {code:title=script2.groovy} class Y { void doIt() { println "OK"; } } {code} {code:title=Doable.java} public interface Doable { void doIt(); } {code} {code:xml|title=spring.xml} <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lang="http://www.springframework.org/schema/lang" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd"> <lang:groovy id="y" script-source="classpath:groovy/script2.groovy" refresh-check-delay="1000"/> <lang:groovy id="x" script-source="classpath:groovy/script1.groovy" refresh-check-delay="1000"> <lang:property name="prop" ref="y"/> </lang:groovy> </beans> {code} {code:title=TestMe.java} import org.springframework.context.support.ClassPathXmlApplicationContext; public class TestMe { public static void main(String[] args) { ClassPathXmlApplicationContext ctxt = new ClassPathXmlApplicationContext("spring.xml"); Doable o = (Doable)ctxt.getBean("x"); o.doIt(); } } {code}

    Apache's JIRA Issue Tracker | 9 years ago | Martin Mavrov
    groovy.lang.MissingMethodException: No signature of method: $Proxy0.doIt() is applicable for argument types: () values: {}
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I suspect this is connected with GROOVY-2006, here is the case: I have two Spring-loaded groovy scripts, marked with refresh-check-delay, which loads them as CGLIB proxies. Invoking a method on the proxy instance, I get {code:none} Exception in thread "main" java.lang.IllegalArgumentException: object is not an instance of declaring class at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740) at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:777) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:757) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0(ScriptBytecodeAdapter.java:195) at X.doIt(script1.groovy]:5) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy1.doIt(Unknown Source) at TestMe.main(TestMe.java:20) {code} {code:title=script1.groovy} class X implements Doable { def prop void doIt() { println prop.getClass().getName(); prop.doIt(); } } {code} {code:title=script2.groovy} class Y { void doIt() { println "OK"; } } {code} {code:title=Doable.java} public interface Doable { void doIt(); } {code} {code:xml|title=spring.xml} <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lang="http://www.springframework.org/schema/lang" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd"> <lang:groovy id="y" script-source="classpath:groovy/script2.groovy" refresh-check-delay="1000"/> <lang:groovy id="x" script-source="classpath:groovy/script1.groovy" refresh-check-delay="1000"> <lang:property name="prop" ref="y"/> </lang:groovy> </beans> {code} {code:title=TestMe.java} import org.springframework.context.support.ClassPathXmlApplicationContext; public class TestMe { public static void main(String[] args) { ClassPathXmlApplicationContext ctxt = new ClassPathXmlApplicationContext("spring.xml"); Doable o = (Doable)ctxt.getBean("x"); o.doIt(); } } {code}

    Apache's JIRA Issue Tracker | 9 years ago | Martin Mavrov
    groovy.lang.MissingMethodException: No signature of method: $Proxy0.doIt() is applicable for argument types: () values: {}
  6. 0

    [groovy-user] MissingMethodException

    Google Groups | 9 years ago | Eric Kolotyluk
    groovy.lang.MissingMethodException: No signature of method: org.apache.log4j.Logger.isTraceEnabled() is applicable for argument types: () values: {}

  1. Luka 2 times, last 2 months ago
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. groovy.lang.MissingMethodException

    No signature of method: $Proxy0.doIt() is applicable for argument types: () values: {}

    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap()
  2. Groovy
    ScriptBytecodeAdapter.invokeMethod0
    1. org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:54)
    2. org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:169)
    3. org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0(ScriptBytecodeAdapter.java:195)
    3 frames