You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by David Jencks <da...@yahoo.com> on 2005/11/24 00:10:32 UTC

This appears to have broken configs build: Re: svn commit: r348552 - in /geronimo/trunk/modules/kernel/src: java/org/apache/geronimo/kernel/basic/ java/org/apache/geronimo/kernel/proxy/ test/org/apache/geronimo/kernel/

On Nov 23, 2005, at 12:34 PM, dain@apache.org wrote:

> Author: dain
> Date: Wed Nov 23 12:33:58 2005
> New Revision: 348552
>
> URL: http://svn.apache.org/viewcvs?rev=348552&view=rev
> Log:
> GERONIMO-1064 change proxy generation to always use an explicit class  
> loader
>
> Added:
>      
> geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/ 
> proxy/ProxyCreationException.java   (with props)
> Modified:
>      
> geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/ 
> basic/BasicProxyManager.java
>      
> geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/ 
> basic/BasicProxyMap.java
>      
> geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/ 
> proxy/ProxyManager.java
>      
> geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/ 
> GBeanTest.java
> +    /**
> +     * Creates a proxy factory for GBeans of the specified type.  The  
> proxy class will be created within the class
> +     * loader from which the specified type was loaded, or from the  
> system class loader if the specified type has
> +     * a null class loader.
> +     *
> +     * @param type the type of the proxies this factory should create
> +     * @return the proxy factory
> +     */
> +    public ProxyFactory createProxyFactory(Class type) {
> +        if (type == null) throw new NullPointerException("type is  
> null");
> +
> +        ClassLoader classLoader = type.getClassLoader();
> +        if(classLoader == null) {
> +            classLoader = ClassLoader.getSystemClassLoader();
> +        }
> +
> +        return createProxyFactory(new Class[] {type}, classLoader);
> +    }
> +
>
I don't think the system classloader can ever be correct, at least it  
seems to break the configs-based build.  The enhancer needs to be able  
to load cglib classes from the classloader you use, and it can't from  
the system classloader (or whatever was being returned from  
ClassLoader.getSystemClassLoader()).  If I change this to

classLoader = this.getClass().getClassLoader();

my build works.  Do you see any problem with this?

thanks
david jencks


Re: This appears to have broken configs build: Re: svn commit: r348552 - in /geronimo/trunk/modules/kernel/src: java/org/apache/geronimo/kernel/basic/ java/org/apache/geronimo/kernel/proxy/ test/org/apache/geronimo/kernel/

Posted by Dain Sundstrom <da...@iq80.com>.
Fixed.

svn commit
Sending        trunk/modules/kernel/src/java/org/apache/geronimo/ 
kernel/basic/BasicProxyManager.java
Transmitting file data .
Committed revision 348797.

-dain

On Nov 24, 2005, at 11:56 AM, Dain Sundstrom wrote:

> Sorry.  I didn't even know how to run packing build, but I'm  
> working on it.
>
> -dain
>
> On Nov 23, 2005, at 5:10 PM, David Jencks wrote:
>
>>
>> On Nov 23, 2005, at 12:34 PM, dain@apache.org wrote:
>>
>>> Author: dain
>>> Date: Wed Nov 23 12:33:58 2005
>>> New Revision: 348552
>>>
>>> URL: http://svn.apache.org/viewcvs?rev=348552&view=rev
>>> Log:
>>> GERONIMO-1064 change proxy generation to always use an explicit  
>>> class loader
>>>
>>> Added:
>>>     geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/ 
>>> kernel/proxy/ProxyCreationException.java   (with props)
>>> Modified:
>>>     geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/ 
>>> kernel/basic/BasicProxyManager.java
>>>     geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/ 
>>> kernel/basic/BasicProxyMap.java
>>>     geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/ 
>>> kernel/proxy/ProxyManager.java
>>>     geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/ 
>>> kernel/GBeanTest.java
>>> +    /**
>>> +     * Creates a proxy factory for GBeans of the specified  
>>> type.  The proxy class will be created within the class
>>> +     * loader from which the specified type was loaded, or from  
>>> the system class loader if the specified type has
>>> +     * a null class loader.
>>> +     *
>>> +     * @param type the type of the proxies this factory should  
>>> create
>>> +     * @return the proxy factory
>>> +     */
>>> +    public ProxyFactory createProxyFactory(Class type) {
>>> +        if (type == null) throw new NullPointerException("type  
>>> is null");
>>> +
>>> +        ClassLoader classLoader = type.getClassLoader();
>>> +        if(classLoader == null) {
>>> +            classLoader = ClassLoader.getSystemClassLoader();
>>> +        }
>>> +
>>> +        return createProxyFactory(new Class[] {type}, classLoader);
>>> +    }
>>> +
>>>
>> I don't think the system classloader can ever be correct, at least  
>> it seems to break the configs-based build.  The enhancer needs to  
>> be able to load cglib classes from the classloader you use, and it  
>> can't from the system classloader (or whatever was being returned  
>> from ClassLoader.getSystemClassLoader()).  If I change this to
>>
>> classLoader = this.getClass().getClassLoader();
>>
>> my build works.  Do you see any problem with this?
>>
>> thanks
>> david jencks


Re: This appears to have broken configs build: Re: svn commit: r348552 - in /geronimo/trunk/modules/kernel/src: java/org/apache/geronimo/kernel/basic/ java/org/apache/geronimo/kernel/proxy/ test/org/apache/geronimo/kernel/

Posted by Dain Sundstrom <da...@iq80.com>.
Sorry.  I didn't even know how to run packing build, but I'm working  
on it.

-dain

On Nov 23, 2005, at 5:10 PM, David Jencks wrote:

>
> On Nov 23, 2005, at 12:34 PM, dain@apache.org wrote:
>
>> Author: dain
>> Date: Wed Nov 23 12:33:58 2005
>> New Revision: 348552
>>
>> URL: http://svn.apache.org/viewcvs?rev=348552&view=rev
>> Log:
>> GERONIMO-1064 change proxy generation to always use an explicit  
>> class loader
>>
>> Added:
>>     geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/ 
>> kernel/proxy/ProxyCreationException.java   (with props)
>> Modified:
>>     geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/ 
>> kernel/basic/BasicProxyManager.java
>>     geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/ 
>> kernel/basic/BasicProxyMap.java
>>     geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/ 
>> kernel/proxy/ProxyManager.java
>>     geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/ 
>> kernel/GBeanTest.java
>> +    /**
>> +     * Creates a proxy factory for GBeans of the specified type.   
>> The proxy class will be created within the class
>> +     * loader from which the specified type was loaded, or from  
>> the system class loader if the specified type has
>> +     * a null class loader.
>> +     *
>> +     * @param type the type of the proxies this factory should  
>> create
>> +     * @return the proxy factory
>> +     */
>> +    public ProxyFactory createProxyFactory(Class type) {
>> +        if (type == null) throw new NullPointerException("type is  
>> null");
>> +
>> +        ClassLoader classLoader = type.getClassLoader();
>> +        if(classLoader == null) {
>> +            classLoader = ClassLoader.getSystemClassLoader();
>> +        }
>> +
>> +        return createProxyFactory(new Class[] {type}, classLoader);
>> +    }
>> +
>>
> I don't think the system classloader can ever be correct, at least  
> it seems to break the configs-based build.  The enhancer needs to  
> be able to load cglib classes from the classloader you use, and it  
> can't from the system classloader (or whatever was being returned  
> from ClassLoader.getSystemClassLoader()).  If I change this to
>
> classLoader = this.getClass().getClassLoader();
>
> my build works.  Do you see any problem with this?
>
> thanks
> david jencks