> On Oct 5, 2015, at 6:12 AM, Jorg Heymans <[email protected]> wrote:
> It seems that jaxb context init is still the culprit. We use the
> com.sun.xml.bind.v2.ContextFactory , switching for example to the
> Eclipselink implementation
> (org.eclipse.persistence.jaxb.JAXBContextFactory) was even slower. Spring's
> lazy init is no good here, makes me wonder if cxf could do a 'true' lazy
> init and defer this expensive init of the service until actual methods are
> called on it. Feasible ?
Not really, no. We need the information from the context to check to make
sure the methods on the clients are even valid.
It’s possible that 15 clients are creating 15 unique JAXB Contexts. One thing
you could TRY is collect ALL the classes that are used by all 15 clients and do
one of:
1) Add @XmlSeeAlso annotations or similar to pull in all the classes
2) Use the “jaxb.additionalContextClasses” property to provide a list of all
the classes
<jaxws:properties>
<entry key="jaxb.additionalContextClasses">
<bean
class="org.apache.cxf.systest.jaxb.util.ClassArrayFactoryBean">
<property name="classNames">
<list>
<value>org.apache.cxf.systest.jaxb.model.ExtendedWidget</value>
</list>
</property>
</bean>
</entry>
</jaxws:properties>
3) Possibly create a list of all the classes and pre-initialize via the
JAXBContextCache.getCachedContextAndSchemas method. I’m not 100% sure this
will work.
Basically, if you can get ONE large JAXBContext serving all the clients, it
might be quicker than 15 smaller. Not really sure though.
Dan
>
> Jorg
>
> On Mon, Oct 5, 2015 at 10:42 AM Jorg Heymans <[email protected]> wrote:
>
>>
>> The wsdlLocation attribute is not specified, and to be honest i have no
>> idea if there is any remote downloading involved during startup. We just
>> specify id and serviceClass attribute and let cxf do its thing. I will
>> try to profile and report back.
>>
>> Jorg
>>
>> On Sun, Oct 4, 2015 at 5:23 PM Andrei Shakirin <[email protected]>
>> wrote:
>>
>>> Hi,
>>>
>>> 2.5 to 3 minutes is quite long even for 15 clients initialization.
>>> Did you specify wsdlLocation attribute in jaxws:client? Can performance
>>> be related to remote WSDL downloading?
>>> Could you bind any profiling tool and discover which operation caused
>>> performance problem?
>>>
>>> Regards,
>>> Andrei.
>>>
>>>> -----Original Message-----
>>>> From: Jorg Heymans [mailto:[email protected]]
>>>> Sent: Donnerstag, 1. Oktober 2015 08:45
>>>> To: [email protected]
>>>> Subject: ReflectionServiceFactoryBean performance
>>>>
>>>> Hi,
>>>>
>>>> We have about 15 jaxws client definitions in our application context
>>> defined
>>>> like this :
>>>>
>>>> <jaxws:client id="myService" serviceClass="my.service.Service"
>>>> address="http://....."/>
>>>>
>>>> Initializing all of these during startup takes on average about 2.5 to
>>> 3 minutes.
>>>> This is already after adding -
>>>> Dcom.sun.xml.bind.v2.runtime.JAXBContextImpl.fastBoot=true , before
>>> that it
>>>> was more like 5-6 minutes.
>>>>
>>>> Is there a way to improve this ? We are going to add more services as
>>> the
>>>> application grows, and already now this cxf init takes up more than
>>> half of our
>>>> deployment time.
>>>>
>>>> Thanks,
>>>> Jorg Heymans
>>>
>>
--
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com