Quantcast

CXF v2.7.14 JAXB blocked threads and degraded performance

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

CXF v2.7.14 JAXB blocked threads and degraded performance

venkatesham nalla
degraded performance with CXF v2.7.14 with bunch of threads in BLOCKED state  waiting to lock <0x0000000685890f28> (a com.sun.xml.bind.v2.runtime.reflect.opt.Injector) with the following stacktrace, teh thread that is holding the lock is in Runnable state. Is this a bug or how do get around this performance issue?


"pool-11-thread-163" #4455 prio=5 os_prio=0 tid=0x00007f736c089000 nid=0x8335 waiting for monitor entry [0x00007f72e01f1000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.find(Injector.java:202)
        - waiting to lock <0x0000000685890f28> (a com.sun.xml.bind.v2.runtime.reflect.opt.Injector)
        at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.find(Injector.java:96)
        at com.sun.xml.bind.v2.runtime.reflect.opt.AccessorInjector.prepare(AccessorInjector.java:77)
        at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:165)
        at com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Accessor.java:256)
        at com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.<init>(SingleElementLeafProperty.java:81)
        at sun.reflect.GeneratedConstructorAccessor115.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
        at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.<init>(ArrayElementProperty.java:108)
        at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(ArrayElementNodeProperty.java:58)
        at sun.reflect.GeneratedConstructorAccessor117.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
        at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.<init>(ArrayElementProperty.java:108)
        at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(ArrayElementNodeProperty.java:58)
        at sun.reflect.GeneratedConstructorAccessor117.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
        at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.<init>(SingleElementNodeProperty.java:101)
        at sun.reflect.GeneratedConstructorAccessor116.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
        at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.<init>(SingleElementNodeProperty.java:101)
        at sun.reflect.GeneratedConstructorAccessor116.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
        at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.<init>(SingleElementNodeProperty.java:101)
        at sun.reflect.GeneratedConstructorAccessor116.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:316)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1111)
        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
        at sun.reflect.GeneratedMethodAccessor341.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:211)
        at javax.xml.bind.ContextFinder.find(ContextFinder.java:392)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:618)
        at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:345)
        at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:343)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.cxf.common.jaxb.JAXBContextCache.createContext(JAXBContextCache.java:343)
        at org.apache.cxf.common.jaxb.JAXBContextCache.getCachedContextAndSchemas(JAXBContextCache.java:244)
        at org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:484)
        at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:339)
        - locked <0x000000069ce6ad38> (a org.apache.cxf.jaxb.JAXBDataBinding)
        at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
        at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:446)
        at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:548)
        at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:265)
        - locked <0x00000006df01ed90> (a org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean)
        at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:215)
        at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)
        at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91)
        at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:157)
        - locked <0x00000006d7509a98> (a org.apache.cxf.jaxws.JaxWsProxyFactoryBean)
        at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142)
        - locked <0x00000006d7509a98> (a org.apache.cxf.jaxws.JaxWsProxyFactoryBean)
        at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:478)
        at org.jboss.wsf.stack.cxf.client.ProviderImpl$JBossWSServiceImpl.createPort(ProviderImpl.java:558)
        at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:345)
        at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:336)
        at javax.xml.ws.Service.getPort(Service.java:99)

...


thanks,

Venkat

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CXF v2.7.14 JAXB blocked threads and degraded performance

Daniel  Kulp
Administrator

This stack trace looks like it’s during creating a client proxy.  Is that something you do a lot?  If so, you really should either pool the proxies or use them in some other thread safe manner to avoid creating them all the time.  Creating them is expensive and involves several locks.    In this particular case, it’s creating a JAXB context.   In theory, the context cache can hold onto and share the JAXB contexts between multiple client proxies, but if the proxies are discarded and not held onto, the cache would clear as well and contexts would need to be re-created.  

Dan



> On May 1, 2017, at 11:35 AM, venkatesham nalla <[hidden email]> wrote:
>
> degraded performance with CXF v2.7.14 with bunch of threads in BLOCKED state  waiting to lock <0x0000000685890f28> (a com.sun.xml.bind.v2.runtime.reflect.opt.Injector) with the following stacktrace, teh thread that is holding the lock is in Runnable state. Is this a bug or how do get around this performance issue?
>
>
> "pool-11-thread-163" #4455 prio=5 os_prio=0 tid=0x00007f736c089000 nid=0x8335 waiting for monitor entry [0x00007f72e01f1000]
>   java.lang.Thread.State: BLOCKED (on object monitor)
>        at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.find(Injector.java:202)
>        - waiting to lock <0x0000000685890f28> (a com.sun.xml.bind.v2.runtime.reflect.opt.Injector)
>        at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.find(Injector.java:96)
>        at com.sun.xml.bind.v2.runtime.reflect.opt.AccessorInjector.prepare(AccessorInjector.java:77)
>        at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:165)
>        at com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Accessor.java:256)
>        at com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.<init>(SingleElementLeafProperty.java:81)
>        at sun.reflect.GeneratedConstructorAccessor115.newInstance(Unknown Source)
>        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
>        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
>        at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.<init>(ArrayElementProperty.java:108)
>        at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(ArrayElementNodeProperty.java:58)
>        at sun.reflect.GeneratedConstructorAccessor117.newInstance(Unknown Source)
>        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
>        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
>        at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.<init>(ArrayElementProperty.java:108)
>        at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(ArrayElementNodeProperty.java:58)
>        at sun.reflect.GeneratedConstructorAccessor117.newInstance(Unknown Source)
>        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
>        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
>        at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.<init>(SingleElementNodeProperty.java:101)
>        at sun.reflect.GeneratedConstructorAccessor116.newInstance(Unknown Source)
>        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
>        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
>        at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.<init>(SingleElementNodeProperty.java:101)
>        at sun.reflect.GeneratedConstructorAccessor116.newInstance(Unknown Source)
>        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
>        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
>        at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.<init>(SingleElementNodeProperty.java:101)
>        at sun.reflect.GeneratedConstructorAccessor116.newInstance(Unknown Source)
>        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
>        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:316)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1111)
>        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
>        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
>        at sun.reflect.GeneratedMethodAccessor341.invoke(Unknown Source)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>        at java.lang.reflect.Method.invoke(Method.java:497)
>        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:211)
>        at javax.xml.bind.ContextFinder.find(ContextFinder.java:392)
>        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:618)
>        at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:345)
>        at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:343)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at org.apache.cxf.common.jaxb.JAXBContextCache.createContext(JAXBContextCache.java:343)
>        at org.apache.cxf.common.jaxb.JAXBContextCache.getCachedContextAndSchemas(JAXBContextCache.java:244)
>        at org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:484)
>        at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:339)
>        - locked <0x000000069ce6ad38> (a org.apache.cxf.jaxb.JAXBDataBinding)
>        at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
>        at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:446)
>        at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:548)
>        at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:265)
>        - locked <0x00000006df01ed90> (a org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean)
>        at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:215)
>        at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)
>        at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91)
>        at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:157)
>        - locked <0x00000006d7509a98> (a org.apache.cxf.jaxws.JaxWsProxyFactoryBean)
>        at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142)
>        - locked <0x00000006d7509a98> (a org.apache.cxf.jaxws.JaxWsProxyFactoryBean)
>        at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:478)
>        at org.jboss.wsf.stack.cxf.client.ProviderImpl$JBossWSServiceImpl.createPort(ProviderImpl.java:558)
>        at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:345)
>        at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:336)
>        at javax.xml.ws.Service.getPort(Service.java:99)
>
> ...
>
>
> thanks,
>
> Venkat
>

--
Daniel Kulp
[hidden email] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CXF v2.7.14 JAXB blocked threads and degraded performance

venkatesham nalla
Thanks Daniel.


Are CXF client proxies thread safe?


thanks,

Venkat

________________________________
From: Daniel Kulp <[hidden email]>
Sent: Monday, May 1, 2017 6:16:19 PM
To: [hidden email]; venkatesham nalla
Subject: Re: CXF v2.7.14 JAXB blocked threads and degraded performance


This stack trace looks like it’s during creating a client proxy.  Is that something you do a lot?  If so, you really should either pool the proxies or use them in some other thread safe manner to avoid creating them all the time.  Creating them is expensive and involves several locks.    In this particular case, it’s creating a JAXB context.   In theory, the context cache can hold onto and share the JAXB contexts between multiple client proxies, but if the proxies are discarded and not held onto, the cache would clear as well and contexts would need to be re-created.

Dan



> On May 1, 2017, at 11:35 AM, venkatesham nalla <[hidden email]> wrote:
>
> degraded performance with CXF v2.7.14 with bunch of threads in BLOCKED state  waiting to lock <0x0000000685890f28> (a com.sun.xml.bind.v2.runtime.reflect.opt.Injector) with the following stacktrace, teh thread that is holding the lock is in Runnable state. Is this a bug or how do get around this performance issue?
>
>
> "pool-11-thread-163" #4455 prio=5 os_prio=0 tid=0x00007f736c089000 nid=0x8335 waiting for monitor entry [0x00007f72e01f1000]
>   java.lang.Thread.State: BLOCKED (on object monitor)
>        at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.find(Injector.java:202)
>        - waiting to lock <0x0000000685890f28> (a com.sun.xml.bind.v2.runtime.reflect.opt.Injector)
>        at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.find(Injector.java:96)
>        at com.sun.xml.bind.v2.runtime.reflect.opt.AccessorInjector.prepare(AccessorInjector.java:77)
>        at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:165)
>        at com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Accessor.java:256)
>        at com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.<init>(SingleElementLeafProperty.java:81)
>        at sun.reflect.GeneratedConstructorAccessor115.newInstance(Unknown Source)
>        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
>        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
>        at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.<init>(ArrayElementProperty.java:108)
>        at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(ArrayElementNodeProperty.java:58)
>        at sun.reflect.GeneratedConstructorAccessor117.newInstance(Unknown Source)
>        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
>        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
>        at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.<init>(ArrayElementProperty.java:108)
>        at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(ArrayElementNodeProperty.java:58)
>        at sun.reflect.GeneratedConstructorAccessor117.newInstance(Unknown Source)
>        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
>        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
>        at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.<init>(SingleElementNodeProperty.java:101)
>        at sun.reflect.GeneratedConstructorAccessor116.newInstance(Unknown Source)
>        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
>        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
>        at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.<init>(SingleElementNodeProperty.java:101)
>        at sun.reflect.GeneratedConstructorAccessor116.newInstance(Unknown Source)
>        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
>        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
>        at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.<init>(SingleElementNodeProperty.java:101)
>        at sun.reflect.GeneratedConstructorAccessor116.newInstance(Unknown Source)
>        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
>        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:316)
>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1111)
>        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
>        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
>        at sun.reflect.GeneratedMethodAccessor341.invoke(Unknown Source)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>        at java.lang.reflect.Method.invoke(Method.java:497)
>        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:211)
>        at javax.xml.bind.ContextFinder.find(ContextFinder.java:392)
>        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:618)
>        at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:345)
>        at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:343)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at org.apache.cxf.common.jaxb.JAXBContextCache.createContext(JAXBContextCache.java:343)
>        at org.apache.cxf.common.jaxb.JAXBContextCache.getCachedContextAndSchemas(JAXBContextCache.java:244)
>        at org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:484)
>        at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:339)
>        - locked <0x000000069ce6ad38> (a org.apache.cxf.jaxb.JAXBDataBinding)
>        at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
>        at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:446)
>        at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:548)
>        at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:265)
>        - locked <0x00000006df01ed90> (a org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean)
>        at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:215)
>        at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)
>        at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91)
>        at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:157)
>        - locked <0x00000006d7509a98> (a org.apache.cxf.jaxws.JaxWsProxyFactoryBean)
>        at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142)
>        - locked <0x00000006d7509a98> (a org.apache.cxf.jaxws.JaxWsProxyFactoryBean)
>        at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:478)
>        at org.jboss.wsf.stack.cxf.client.ProviderImpl$JBossWSServiceImpl.createPort(ProviderImpl.java:558)
>        at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:345)
>        at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:336)
>        at javax.xml.ws.Service.getPort(Service.java:99)
>
> ...
>
>
> thanks,
>
> Venkat
>

--
Daniel Kulp
[hidden email] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CXF v2.7.14 JAXB blocked threads and degraded performance

Daniel  Kulp
Administrator

> On May 2, 2017, at 5:33 PM, venkatesham nalla <[hidden email]> wrote:
>
> Thanks Daniel.
>
> Are CXF client proxies thread safe?


http://cxf.apache.org/faq.html#FAQ-AreJAX-WSclientproxiesthreadsafe?


Dan


>
>
> thanks,
>
> Venkat
>
> ________________________________
> From: Daniel Kulp <[hidden email]>
> Sent: Monday, May 1, 2017 6:16:19 PM
> To: [hidden email]; venkatesham nalla
> Subject: Re: CXF v2.7.14 JAXB blocked threads and degraded performance
>
>
> This stack trace looks like it’s during creating a client proxy.  Is that something you do a lot?  If so, you really should either pool the proxies or use them in some other thread safe manner to avoid creating them all the time.  Creating them is expensive and involves several locks.    In this particular case, it’s creating a JAXB context.   In theory, the context cache can hold onto and share the JAXB contexts between multiple client proxies, but if the proxies are discarded and not held onto, the cache would clear as well and contexts would need to be re-created.
>
> Dan
>
>
>
>> On May 1, 2017, at 11:35 AM, venkatesham nalla <[hidden email]> wrote:
>>
>> degraded performance with CXF v2.7.14 with bunch of threads in BLOCKED state  waiting to lock <0x0000000685890f28> (a com.sun.xml.bind.v2.runtime.reflect.opt.Injector) with the following stacktrace, teh thread that is holding the lock is in Runnable state. Is this a bug or how do get around this performance issue?
>>
>>
>> "pool-11-thread-163" #4455 prio=5 os_prio=0 tid=0x00007f736c089000 nid=0x8335 waiting for monitor entry [0x00007f72e01f1000]
>>  java.lang.Thread.State: BLOCKED (on object monitor)
>>       at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.find(Injector.java:202)
>>       - waiting to lock <0x0000000685890f28> (a com.sun.xml.bind.v2.runtime.reflect.opt.Injector)
>>       at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.find(Injector.java:96)
>>       at com.sun.xml.bind.v2.runtime.reflect.opt.AccessorInjector.prepare(AccessorInjector.java:77)
>>       at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:165)
>>       at com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Accessor.java:256)
>>       at com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.<init>(SingleElementLeafProperty.java:81)
>>       at sun.reflect.GeneratedConstructorAccessor115.newInstance(Unknown Source)
>>       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>>       at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>>       at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
>>       at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
>>       at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
>>       at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
>>       at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.<init>(ArrayElementProperty.java:108)
>>       at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(ArrayElementNodeProperty.java:58)
>>       at sun.reflect.GeneratedConstructorAccessor117.newInstance(Unknown Source)
>>       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>>       at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>>       at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
>>       at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
>>       at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
>>       at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
>>       at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.<init>(ArrayElementProperty.java:108)
>>       at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(ArrayElementNodeProperty.java:58)
>>       at sun.reflect.GeneratedConstructorAccessor117.newInstance(Unknown Source)
>>       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>>       at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>>       at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
>>       at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
>>       at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
>>       at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
>>       at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.<init>(SingleElementNodeProperty.java:101)
>>       at sun.reflect.GeneratedConstructorAccessor116.newInstance(Unknown Source)
>>       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>>       at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>>       at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
>>       at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
>>       at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
>>       at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
>>       at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.<init>(SingleElementNodeProperty.java:101)
>>       at sun.reflect.GeneratedConstructorAccessor116.newInstance(Unknown Source)
>>       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>>       at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>>       at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
>>       at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
>>       at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
>>       at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
>>       at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.<init>(SingleElementNodeProperty.java:101)
>>       at sun.reflect.GeneratedConstructorAccessor116.newInstance(Unknown Source)
>>       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>>       at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>>       at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
>>       at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:175)
>>       at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:490)
>>       at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:316)
>>       at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1111)
>>       at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
>>       at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
>>       at sun.reflect.GeneratedMethodAccessor341.invoke(Unknown Source)
>>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>       at java.lang.reflect.Method.invoke(Method.java:497)
>>       at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:211)
>>       at javax.xml.bind.ContextFinder.find(ContextFinder.java:392)
>>       at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:618)
>>       at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:345)
>>       at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:343)
>>       at java.security.AccessController.doPrivileged(Native Method)
>>       at org.apache.cxf.common.jaxb.JAXBContextCache.createContext(JAXBContextCache.java:343)
>>       at org.apache.cxf.common.jaxb.JAXBContextCache.getCachedContextAndSchemas(JAXBContextCache.java:244)
>>       at org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:484)
>>       at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:339)
>>       - locked <0x000000069ce6ad38> (a org.apache.cxf.jaxb.JAXBDataBinding)
>>       at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
>>       at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:446)
>>       at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:548)
>>       at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:265)
>>       - locked <0x00000006df01ed90> (a org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean)
>>       at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:215)
>>       at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)
>>       at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91)
>>       at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:157)
>>       - locked <0x00000006d7509a98> (a org.apache.cxf.jaxws.JaxWsProxyFactoryBean)
>>       at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142)
>>       - locked <0x00000006d7509a98> (a org.apache.cxf.jaxws.JaxWsProxyFactoryBean)
>>       at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:478)
>>       at org.jboss.wsf.stack.cxf.client.ProviderImpl$JBossWSServiceImpl.createPort(ProviderImpl.java:558)
>>       at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:345)
>>       at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:336)
>>       at javax.xml.ws.Service.getPort(Service.java:99)
>>
>> ...
>>
>>
>> thanks,
>>
>> Venkat
>>
>
> --
> Daniel Kulp
> [hidden email] - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
>

--
Daniel Kulp
[hidden email] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Loading...