maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Staton (JIRA)" <j...@codehaus.org>
Subject [jira] Created: (MNG-5042) Regression: CloningClassLoader causes StackOverflowError in groovy
Date Mon, 14 Mar 2011 16:32:22 GMT
Regression: CloningClassLoader causes StackOverflowError in groovy
------------------------------------------------------------------

                 Key: MNG-5042
                 URL: http://jira.codehaus.org/browse/MNG-5042
             Project: Maven 2 & 3
          Issue Type: Bug
          Components: Class Loading
    Affects Versions: 3.0.3, 3.0.2, 3.0.1, 3.0
            Reporter: Patrick Staton


I am unable to use a groovy class as a plexus component in maven 3 because groovy's metaclass
mechanism calls Introspector.getBeanInfo() in constructors which in turn calls classloader.loadClass(beanClass.getName()
+ BEANINFO_SUFFIX) (the class name is "FooBar$__plexus2") which in turn causes CloningClassLoader
to create a new clone of the class named "FooBar$__plexus2BeanInfo". When "FooBar$__plexusBeanInfo"
is instantiated groovy's the meta class mechanism again calls 
Introspector.getBeanInfo() on "FooBar$__plexus2".

Example stack trace:
{code}at sis.buildtools.SisMapVersionsPhase.$getStaticMetaClass(VersionsMojo.groovy)
        at sis.buildtools.SisMapVersionsPhase.<init>(VersionsMojo.groovy:692)
        at sis.buildtools.SisMapVersionsPhase$__plexus2BeanInfo.<init>(Unknown Source)
        at sun.reflect.GeneratedConstructorAccessor5.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at java.beans.Introspector.instantiate(Introspector.java:1449)
        at java.beans.Introspector.findExplicitBeanInfo(Introspector.java:431)
        at java.beans.Introspector.<init>(Introspector.java:380)
        at java.beans.Introspector.getBeanInfo(Introspector.java:167)
        at groovy.lang.MetaClassImpl$15.run(MetaClassImpl.java:2940)
        at java.security.AccessController.doPrivileged(Native Method)
        at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:2938)
        at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:2921)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:166)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:182)
        at sis.buildtools.SisMapVersionsPhase.$getStaticMetaClass(VersionsMojo.groovy)
        at sis.buildtools.SisMapVersionsPhase.<init>(VersionsMojo.groovy:692)
        at sis.buildtools.SisMapVersionsPhase$__plexus2BeanInfo.<init>(Unknown Source)
        at sun.reflect.GeneratedConstructorAccessor5.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at java.beans.Introspector.instantiate(Introspector.java:1449)
        at java.beans.Introspector.findExplicitBeanInfo(Introspector.java:431)
        at java.beans.Introspector.<init>(Introspector.java:380)
        at java.beans.Introspector.getBeanInfo(Introspector.java:167)
        at groovy.lang.MetaClassImpl$15.run(MetaClassImpl.java:2940)
        at java.security.AccessController.doPrivileged(Native Method)
        at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:2938)
        at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:2921)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:166)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:182)
        at sis.buildtools.SisMapVersionsPhase.$getStaticMetaClass(VersionsMojo.groovy)
        at sis.buildtools.SisMapVersionsPhase.<init>(VersionsMojo.groovy:692)
        at sis.buildtools.SisMapVersionsPhase$__plexus2BeanInfo.<init>(Unknown Source)
        at sun.reflect.GeneratedConstructorAccessor5.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at java.beans.Introspector.instantiate(Introspector.java:1449)
        at java.beans.Introspector.findExplicitBeanInfo(Introspector.java:431)
        at java.beans.Introspector.<init>(Introspector.java:380)
        at java.beans.Introspector.getBeanInfo(Introspector.java:167)
        at groovy.lang.MetaClassImpl$15.run(MetaClassImpl.java:2940)
        at java.security.AccessController.doPrivileged(Native Method)
        at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:2938)
        at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:2921)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:166)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:182)
        at sis.buildtools.SisMapVersionsPhase.$getStaticMetaClass(VersionsMojo.groovy)
        at sis.buildtools.SisMapVersionsPhase.<init>(VersionsMojo.groovy:692)
        at sis.buildtools.SisMapVersionsPhase$__plexus2BeanInfo.<init>(Unknown Source)
        at sun.reflect.GeneratedConstructorAccessor5.newInstance(Unknown Source){code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message