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.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:881) at org.apache.cxf.bus.spring.SpringBeanLocator.loadBeansOfType(SpringBeanLocator.java:72) at org.apache.cxf.transport.TransportFinder.loadAll(TransportFinder.java:138) at org.apache.cxf.transport.TransportFinder.findTransportForURI(TransportFinder.java:84) at org.apache.cxf.transport.DestinationFactoryManagerImpl.getDestinationFactoryForUri(DestinationFactoryManagerImpl.java:133) at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpointInfo(AbstractJAXRSFactoryBean.java:102) at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpoint(AbstractJAXRSFactoryBean.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 > > -- View this message in context: http://www.nabble.com/WARNING%3A-very-big-commit-coming-later-today....-tp25134475p25238886.html Sent from the cxf-dev mailing list archive at Nabble.com.