I haven't really worked on the non-spring case much at all.   I'm going to 
doubt that is going to be able to take advantage of any of what I've done.   
I'll look more into your other failure shortly.

Dan


On Tue September 1 2009 7:59:05 am Sergey Beryozkin wrote:
> Without Spring the exception is different :
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> javax/wsdl/WSDLException
>       at java.lang.Class.getDeclaredConstructors0(Native Method)
>       at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
>       at java.lang.Class.getConstructor0(Unknown Source)
>       at java.lang.Class.getConstructor(Unknown Source)
>       at org.apache.cxf.bus.extension.Extension.load(Extension.java:92)
>       at
> org.apache.cxf.bus.extension.ExtensionManagerImpl.loadAndRegister(Extension
>ManagerImpl.java:164) at
> org.apache.cxf.bus.extension.ExtensionManagerImpl.processExtension(Extensio
>nManagerImpl.java:140) at
> org.apache.cxf.bus.extension.ExtensionManagerImpl.loadFragment(ExtensionMan
>agerImpl.java:133) at
> org.apache.cxf.bus.extension.ExtensionManagerImpl.load(ExtensionManagerImpl
>.java:125) at
> org.apache.cxf.bus.extension.ExtensionManagerImpl.load(ExtensionManagerImpl
>.java:94) at
> org.apache.cxf.bus.extension.ExtensionManagerBus.<init>(ExtensionManagerBus
>.java:123) at
> org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:41) at
> org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:37) at
> org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:33) at
> org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:69)
>       at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:106)
>       at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:97)
>       at
> org.apache.cxf.endpoint.AbstractEndpointFactory.getBus(AbstractEndpointFact
>ory.java:73)
>
>
> sorry if you didn't get a chance to complete this work yet
>
> Sergey
>
> Sergey Beryozkin wrote:
> > Hi Dan
> >
> > Did you finish the part 3 of this refactoring ?
> > I'm setting up a custom JAXRS project in Eclipse and I still have to add
> > a wsdl4j library to the list of dependencies though I've been able to
> > drop quite a few dependencies compared to a similar project I set up
> > earlier...
> >
> > Just in case, here is what I'm seeing :
> >
> > Caused by: org.springframework.beans.factory.BeanCreationException: Error
> > creating bean with name
> > 'org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory' defined
> > in class path resource [META-INF/cxf/cxf-extension-http-jetty.xml]:
> > Initialization of bean failed; nested exception is
> > java.lang.NoClassDefFoundError: javax/wsdl/Port
> >     at
> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> >ory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480) at
> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> >ory$1.run(AbstractAutowireCapableBeanFactory.java:409) at
> > java.security.AccessController.doPrivileged(Native Method)
> >     at
> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> >ory.createBean(AbstractAutowireCapableBeanFactory.java:380) at
> > org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject
> >(AbstractBeanFactory.java:264) at
> > org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.ge
> >tSingleton(DefaultSingletonBeanRegistry.java:221) at
> > org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(A
> >bstractBeanFactory.java:261) at
> > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abs
> >tractBeanFactory.java:185) at
> > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abs
> >tractBeanFactory.java:164) at
> > org.springframework.context.support.AbstractApplicationContext.getBean(Ab
> >stractApplicationContext.java:881) at
> > org.apache.cxf.bus.spring.SpringBeanLocator.loadBeansOfType(SpringBeanLoc
> >ator.java:72) at
> > org.apache.cxf.transport.TransportFinder.loadAll(TransportFinder.java:138
> >) at
> > org.apache.cxf.transport.TransportFinder.findTransportForURI(TransportFin
> >der.java:84) at
> > org.apache.cxf.transport.DestinationFactoryManagerImpl.getDestinationFact
> >oryForUri(DestinationFactoryManagerImpl.java:133) at
> > org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpointInfo(Abstract
> >JAXRSFactoryBean.java:102) at
> > org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpoint(AbstractJAXR
> >SFactoryBean.java:168) at
> > org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean
> >.java:83)
> >
> >
> > cheers, Sergey
> >
> > dkulp wrote:
> >> OK.  "Part 1"  (I have more ideas) is in.   A "default" bus has gone
> >> from over
> >> 55 beans created and initialized down to 12.   Startup time for the
> >> first Bus
> >> has dropped from 2.1 seconds on my machine to 0.9.   After the jit warms
> >> up
> >> and classes loaded and such, subsequent Bus creation has dropped from
> >> 105ms to
> >> about 60.
> >>
> >> Obviously, a default bus isn't much use now as nothing is loaded and
> >> doing
> >> pretty much anything is going to start triggering other parts to load
> >> in. Thus, a "full" startup isn't as dramatic, but it's definitely a good
> >> start.
> >>
> >> Dan
> >>
> >> On Tue August 25 2009 9:40:37 am Daniel Kulp wrote:
> >>> Just a warning, if I can get all the tests passing, I have a big commit
> >>> coming in today (although broken across a couple commits that will all
> >>> come
> >>> at once) that touches a LOT of stuff.
> >>>
> >>> Basically, I'm trying to reduce the startup time.  Specifically, the
> >>> "BusFactory.createDefaultBus()" time.    I've done some investigation
> >>> and
> >>> discovered a few things that are taking a lot of time:
> >>>
> >>> 1) JSR250 processing - this is actually fairly expensive the first
> >>> time. Retrieving annotations is expensive and the JSR250 has to look at
> >>> every field and method.   The second time a class is used it's fast
> >>> (cached), but
> >>> that initial startup sucks.   I've added a NoJSR250Annotations
> >>> annotation
> >>> that can be added to beans loaded from Spring to mark the class as not
> >>> having any JSR250 annotations anywhere on it so the JSR250 processor
> >>> can skip it.   I've added this annotation to a bunch of places where it
> >>> can be
> >>> added.  (not all beans can have it, obviously)   This alone has about a
> >>> 20%
> >>> boost.
> >>>
> >>> 2) JAXB context creations - the JAXB based WSDL extensors are creating
> >>> their JAXB context up front.   If those extensors are never used
> >>> (example:
> >>> never use the CORBA binding) it's a pointless waste of time.   I'm
> >>> changing
> >>> them to create them only if needed for parsing/writing.   ,
> >>>
> >>> 3)  lazy-init="true"  - I'm going through all the cxf-extension-*.xml
> >>> files
> >>> and adding lazy-init="true" to almost everything.   I'm also updating
> >>> other
> >>> code to pull beans "if needed".   This has a huge affect of lower the
> >>> number of beans created at startup.   Right now, a default bus creates
> >>> 57
> >>> beans up front, right away (and every one is run through the JSR250
> >>> processor).    With some changes, I now have this down to 20 beans (and
> >>> I
> >>> think I can get it down closer to 15), with only 6 going through JSR250
> >>> processing.
> >>>
> >>> The major affect of (3) is a lot of stuff doesn't get loaded unless
> >>> it's needed.  If it's needed, you'll take a hit later to get it loaded,
> >>> but if
> >>> it's not needed, it's not loaded.    For example, if you don't use
> >>> WSDL's
> >>> at all (purely code first cases or JAX-RS cases), the WSDLManager is
> >>> never
> >>> loaded and thus none of the WSDL extensors are loaded.
> >>>
> >>> The "downside" of (3) is that a bunch of tests now fail that I'm trying
> >>> to
> >>> fix up.    There are many tests that test if the "count" of registered
> >>> things is a particular number, but now the number is either 0 or much
> >>> less.
> >>>   I need to update the tests to actually ask for things first to make
> >>> sure
> >>> they get loaded.
> >>>
> >>>
> >>> Anyway, it's a pretty big patch that touches a lot of files.  Thus, the
> >>> heads up warning.

-- 
Daniel Kulp
dk...@apache.org
http://www.dankulp.com/blog

Reply via email to