Details
Description
Whe xfire performs a SOAP request where the binding of XML to Java and vice versa is done by using JAXB 2.0 the JaxbContext is created on every request. Creating a JaxbContext is a very long running function, particular with large schema's and a large Java codebase where annotations defining the JAXB binding is descibed.
The method getJAXBContext of the type "org.codehaus.xfire.jaxb2.JaxbType" should cache the JaxbContext for later use to avoid paying the performance overhead of creating a new JaxbContext.
A similar issue is reported on CXF: https://issues.apache.org/jira/browse/CXF-850
The fix could look something like this:
if (cachedContexts.containsKey(pckg) == false)
{
synchronized(cachedContexts)
{
if (cachedContexts.containsKey(pckg) == false)
}
context = cachedContexts.get(pckg);
}