cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jakobsen, Dennis \(Dennis\)" <jakob...@avaya.com>
Subject RE: Problems embedding CXF in Eclipse
Date Wed, 21 Feb 2007 19:22:05 GMT
I tried executing 
	Bus b = new ExtensionManagerBus();
and that alone takes 4 min to execute.

I traces where the long loop starts when just doing a 

	
DynamicClientFactory.newInstance().createClient(wsdlURL.toString());

It happens on the bac.refresh(); in the following function:

   public Bus createBus(String cfgFile, boolean includeDefaults) {
        BusApplicationContext bac = null;
        try {      
            bac = new BusApplicationContext(cfgFile, includeDefaults,
context);           
        } catch (BeansException ex) {
            LogUtils.log(LOG, Level.WARNING,
"APP_CONTEXT_CREATION_FAILED_MSG", ex, (Object[])null);
            throw new RuntimeException(ex);
        }
        
        bac.refresh();
        Bus bus = (Bus)bac.getBean(DEFAULT_BUS_ID);
       
        Configurer configurer = new ConfigurerImpl(bac);
        bus.setExtension(configurer, Configurer.class);

        possiblySetDefaultBus(bus);
        return bus;
    }
    
Thanks
Dennis


-----Original Message-----
From: Dan Diephouse [mailto:dan@envoisolutions.com] 
Sent: Wednesday, February 21, 2007 10:18
To: cxf-dev@incubator.apache.org
Subject: Re: Problems embedding CXF in Eclipse

I'm wondering if it might be this line in BusApplicationContext:

                PathMatchingResourcePatternResolver resolver = new
PathMatchingResourcePatternResolver(Thread
                    .currentThread().getContextClassLoader());

                Collections.addAll(resources, resolver.getResources
(DEFAULT_CXF_CFG_FILE));
                Collections.addAll(resources, resolver.getResources
(DEFAULT_CXF_EXT_CFG_FILE));
                Collections.addAll(resources, resolver.getResources
(CXF_PROPERTY_EDITORS_CFG_FILE));

Any chance you can pop in the debugger and see if this long loop is
coming
from calling resolver.getResource() on line 84 in BusApplicationContext?

I just thought of one possible workaround. It might work if you tell CXF
not
to use Spring internall:

Bus b = new ExtensionManagerBus(); (a version of CXF that doesn't use
Spring)
BusFactory.setDefaultBus(b);

Client c = DynamicClientFactory.newInstance()....;

Cheers,

- Dan


On 2/21/07, Jakobsen, Dennis (Dennis) <jakobsen@avaya.com> wrote:
>
> I see this behavior and it actually looks like it is not a looping.
If
> I let it sit for 6 - 7 minutes it will eventually succeed, but it
seems
> to be going through a very long phase where it "Overrides bean
> definitions".  Do anyone have an idea why it enterers this phase?
>
>
>
> Thanks
>
> Dennis
>
>
>
>
>
>
>
> 21/02/2007 09:21:32  INFO - JDK 1.4+ collections available
>
> Feb 21, 2007 9:22:07 AM
org.apache.cxf.bus.spring.BusApplicationContext
> getConfigResources
>
> INFO: Could not find the configuration file cxf.xml on the classpath.
>
> 21/02/2007 09:22:07  INFO - Loading XML bean definitions from class
path
> resource [META-INF/cxf/cxf.xml]
>
> 21/02/2007 09:22:10  INFO - Loading XML bean definitions from URL
> [bundleresource://1855/META-INF/cxf/cxf-property-editors.xml]
>
> 21/02/2007 09:22:11  INFO - Loading XML bean definitions from URL
> [bundleresource://1855:1/META-INF/cxf/cxf-property-editors.xml]
>
> 21/02/2007 09:22:12  INFO - Loading XML bean definitions from URL
> [bundleresource://1855:2/META-INF/cxf/cxf-property-editors.xml]
>
> 21/02/2007 09:22:13  INFO - Loading XML bean definitions from URL
> [bundleresource://1855:3/META-INF/cxf/cxf-property-editors.xml]
>
> 21/02/2007 09:22:15  INFO - Loading XML bean definitions from URL
> [bundleresource://1855:4/META-INF/cxf/cxf-property-editors.xml]
>
> 21/02/2007 09:22:16  INFO - Overriding bean definition for bean
> 'org.apache.cxf.configuration.security.customEditorConfigurer':
> replacing [Root bean: class
> [org.springframework.beans.factory.config.CustomEditorConfigurer];
> scope=singleton; abstract=false; lazyInit=false;
autowireCandidate=true;
> autowireMode=0; dependencyCheck=0; factoryBeanName=null;
> factoryMethodName=null; initMethodName=null; destroyMethodName=null;
> defined in URL
> [bundleresource://1855/META-INF/cxf/cxf-property-editors.xml]] with
> [Root bean: class
> [org.springframework.beans.factory.config.CustomEditorConfigurer];
> scope=singleton; abstract=false; lazyInit=false;
autowireCandidate=true;
> autowireMode=0; dependencyCheck=0; factoryBeanName=null;
> factoryMethodName=null; initMethodName=null; destroyMethodName=null;
> defined in URL
> [bundleresource://1855:4/META-INF/cxf/cxf-property-editors.xml]]
>
> 21/02/2007 09:22:16  INFO - Loading XML bean definitions from URL
> [bundleresource://1855:5/META-INF/cxf/cxf-property-editors.xml]
>
> 21/02/2007 09:22:17  INFO - Overriding bean definition for bean
> 'org.apache.cxf.jaxws.javaee.customEditorConfigurer': replacing [Root
> bean: class
> [org.springframework.beans.factory.config.CustomEditorConfigurer];
> scope=singleton; abstract=false; lazyInit=false;
autowireCandidate=true;
> autowireMode=0; dependencyCheck=0; factoryBeanName=null;
> factoryMethodName=null; initMethodName=null; destroyMethodName=null;
> defined in URL
> [bundleresource://1855:1/META-INF/cxf/cxf-property-editors.xml]] with
> [Root bean: class
> [org.springframework.beans.factory.config.CustomEditorConfigurer];
> scope=singleton; abstract=false; lazyInit=false;
autowireCandidate=true;
> autowireMode=0; dependencyCheck=0; factoryBeanName=null;
> factoryMethodName=null; initMethodName=null; destroyMethodName=null;
> defined in URL
> [bundleresource://1855:5/META-INF/cxf/cxf-property-editors.xml]]
>
> 21/02/2007 09:22:17  INFO - Loading XML bean definitions from URL
> [bundleresource://1855:6/META-INF/cxf/cxf-property-editors.xml]
>
> 21/02/2007 09:22:18  INFO - Overriding bean definition for bean
> 'org.apache.cxf.management.customEditorConfigurer': replacing [Root
> bean: class
> [org.springframework.beans.factory.config.CustomEditorConfigurer];
> scope=singleton; abstract=false; lazyInit=false;
autowireCandidate=true;
> autowireMode=0; dependencyCheck=0; factoryBeanName=null;
> factoryMethodName=null; initMethodName=null; destroyMethodName=null;
> defined in URL
> [bundleresource://1855:2/META-INF/cxf/cxf-property-editors.xml]] with
> [Root bean: class
> [org.springframework.beans.factory.config.CustomEditorConfigurer];
> scope=singleton; abstract=false; lazyInit=false;
autowireCandidate=true;
> autowireMode=0; dependencyCheck=0; factoryBeanName=null;
> factoryMethodName=null; initMethodName=null; destroyMethodName=null;
> defined in URL
> [bundleresource://1855:6/META-INF/cxf/cxf-property-editors.xml]]
>
> 21/02/2007 09:22:18  INFO - Loading XML bean definitions from URL
> [bundleresource://1855:7/META-INF/cxf/cxf-property-editors.xml]
>
> 21/02/2007 09:22:19  INFO - Overriding bean definition for bean
> 'org.apache.cxf.ws.rm.customEditorConfigurer': replacing [Root bean:
> class
[org.springframework.beans.factory.config.CustomEditorConfigurer];
> scope=singleton; abstract=false; lazyInit=false;
autowireCandidate=true;
> autowireMode=0; dependencyCheck=0; factoryBeanName=null;
> factoryMethodName=null; initMethodName=null; destroyMethodName=null;
> defined in URL
> [bundleresource://1855:3/META-INF/cxf/cxf-property-editors.xml]] with
> [Root bean: class
> [org.springframework.beans.factory.config.CustomEditorConfigurer];
> scope=singleton; abstract=false; lazyInit=false;
autowireCandidate=true;
> autowireMode=0; dependencyCheck=0; factoryBeanName=null;
> factoryMethodName=null; initMethodName=null; destroyMethodName=null;
> defined in URL
> [bundleresource://1855:7/META-INF/cxf/cxf-property-editors.xml]]
>
> 21/02/2007 09:22:19  INFO - Loading XML bean definitions from URL
> [bundleresource://1855:8/META-INF/cxf/cxf-property-editors.xml]
>
> 21/02/2007 09:22:21  INFO - Overriding bean definition for bean
> 'org.apache.cxf.configuration.security.customEditorConfigurer':
> replacing [Root bean: class
> [org.springframework.beans.factory.config.CustomEditorConfigurer];
> scope=singleton; abstract=false; lazyInit=false;
autowireCandidate=true;
> autowireMode=0; dependencyCheck=0; factoryBeanName=null;
> factoryMethodName=null; initMethodName=null; destroyMethodName=null;
> defined in URL
> [bundleresource://1855:4/META-INF/cxf/cxf-property-editors.xml]] with
> [Root bean: class
> [org.springframework.beans.factory.config.CustomEditorConfigurer];
> scope=singleton; abstract=false; lazyInit=false;
autowireCandidate=true;
> autowireMode=0; dependencyCheck=0; factoryBeanName=null;
> factoryMethodName=null; initMethodName=null; destroyMethodName=null;
> defined in URL
> [bundleresource://1855:8/META-INF/cxf/cxf-property-editors.xml]]
>
> 21/02/2007 09:22:21  INFO - Loading XML bean definitions from URL
> [bundleresource://1855:9/META-INF/cxf/cxf-property-editors.xml]
>
> 21/02/2007 09:22:22  INFO - Overriding bean definition for bean
> 'org.apache.cxf.jaxws.javaee.customEditorConfigurer': replacing [Root
> bean: class
> [org.springframework.beans.factory.config.CustomEditorConfigurer];
> scope=singleton; abstract=false; lazyInit=false;
autowireCandidate=true;
> autowireMode=0; dependencyCheck=0; factoryBeanName=null;
> factoryMethodName=null; initMethodName=null; destroyMethodName=null;
> defined in URL
> [bundleresource://1855:5/META-INF/cxf/cxf-property-editors.xml]] with
> [Root bean: class
> [org.springframework.beans.factory.config.CustomEditorConfigurer];
> scope=singleton; abstract=false; lazyInit=false;
autowireCandidate=true;
> autowireMode=0; dependencyCheck=0; factoryBeanName=null;
> factoryMethodName=null; initMethodName=null; destroyMethodName=null;
> defined in URL
> [bundleresource://1855:9/META-INF/cxf/cxf-property-editors.xml]]
>
> 21/02/2007 09:22:22  INFO - Loading XML bean definitions from URL
> [bundleresource://1855:10/META-INF/cxf/cxf-property-editors.xml]
>
> 21/02/2007 09:22:23  INFO - Overriding bean definition for bean
> 'org.apache.cxf.management.customEditorConfigurer': replacing [Root
> bean: class
> [org.springframework.beans.factory.config.CustomEditorConfigurer];
> scope=singleton; abstract=false; lazyInit=false;
autowireCandidate=true;
> autowireMode=0; dependencyCheck=0; factoryBeanName=null;
> factoryMethodName=null; initMethodName=null; destroyMethodName=null;
> defined in URL
> [bundleresource://1855:6/META-INF/cxf/cxf-property-editors.xml]] with
> [Root bean: class
> [org.springframework.beans.factory.config.CustomEditorConfigurer];
> scope=singleton; abstract=false; lazyInit=false;
autowireCandidate=true;
> autowireMode=0; dependencyCheck=0; factoryBeanName=null;
> factoryMethodName=null; initMethodName=null; destroyMethodName=null;
> defined in URL
> [bundleresource://1855:10/META-INF/cxf/cxf-property-editors.xml]]
>
> 21/02/2007 09:22:23  INFO - Loading XML bean definitions from URL
> [bundleresource://1855:11/META-INF/cxf/cxf-property-editors.xml]
>
>
>
> -----Original Message-----
> From: Oisin Hurley [mailto:ohurley@iona.com]
> Sent: Wednesday, February 21, 2007 09:26
> To: cxf-dev@incubator.apache.org
> Subject: Re: Problems embedding CXF in Eclipse
>
>
>
> > I know there have been several others who have worked with CXF
inside
>
> > Eclipse plugins, so I am hoping you can shed insight into this
issue.
>
> > Basically Spring seems to loop forever when it is loading resources
>
> > off the
>
> > classpath when inside the Eclipse plugin. It works fine outside of
the
>
> > plugin though. I'm guessing that this is something to do with the
way
>
> > classloaders work inside Eclipse. Anyone know what the particular
>
> > remedy for
>
> > this is?
>
>
>
> It's probably to do with the way classloaders work in Eclipse
>
> alright. Each
>
> eclipse plugin is an OSGi bundle and gets a fresh classloader that is
>
> configured
>
> by the manifest for the bundle. If the code
>
> in the plugin attempts to load stuff that is not configured within
>
> the manifest
>
> file as a dependency, then you should see a failure of the load.
>
> Also, if you
>
> try to inject class definitions into the classloader (as the JAXB
>
> impl attempts
>
> to do by default) then you can get duplicate class defs.
>
>
>
> This particular behaviour - the looping - I haven't seen before.
>
> Perhaps you
>
> might find something at [0] that would be useful, it looks like they
>
> have got
>
> OSGi'ified bundles of Spring functionality.
>
>
>
>   best of luck
>
>     --oh
>
>
>
> [0] http://www.springframework.org/osgi
>
>


-- 
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog


Mime
View raw message