Topic
  • 2 replies
  • Latest Post - ‏2013-07-29T15:38:16Z by c.high
JayantaP.Mukherjee
JayantaP.Mukherjee
1 Post

Pinned topic How to cache JAXBContext in JAX-WS 2.2 Web Services

‏2013-07-28T15:08:05Z |

Hello

We have developer a Web-Service using JAX-WS 2.2 JAXB 2.x over SOAP 1.1. The services are running on WebSphere Application Server 8.0.0.4 on z/OS. They are fully functional but we see even a simple operation is taking huge amount of CPU. 

We could see from profiling tools like Dynatrace or JProfiler that JAXBContext creation (newInstance) and IBM API classes of JAXB is chewing up 90% of the CPU. 10% is business logic. 

We need to tune the service on z/OS and bring down the CPU usage:

Based on our research it seems JAXBContext creation is very costly and we can create JAXBContext under application scope in the first request and then cache it for successive calls. Seen the annotation on JAX-WS @Usesjaxbcontext. 

Any help/sample code snippet on how to cache the JAXBContext and use @usesjaxbcontext annotation will be much appreciated. Or if you have any suggestions on how to tune CPU usage of the service on z/OS WAS-8.x will help. 

Thanks Jayanta