Hi Adobe,
We are trying to integrate CQ with CXF to consume webservices. As per recommendation by CQ from one of the posts, switching classloader makes the OSGI container aware of the class. We tried that option and were successful in integrating the webservice. But the classloader switching is causing a memory leak. With multiple deploys like around 5, the server is coming down. I am surprised that no one else faced this issue with classloader switching. Any help is greatly appreciated. Please see the code below,
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(BusFactory.class.getClassLoader()); JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(new OsgiAwareClientFactoryBean()); factory.setServiceClass(pClass); factory.setAddress(pPortUrl); factory.setUsername(pUsername); factory.setPassword(pPassword); //This is where it blows up return (T) factory.create(); } Finally{ Switch back to the oldclass }
Solved! Go to Solution.
Views
Replies
Total Likes
I have used same mechanism with multiple server and deployment but never had any issue with memory. What application server are you using ?
Can you try BusFactory.getDefaultBus().setProperty("set-jaxb-validation-event-handler", "false"); before setting context ?
Yogesh
Views
Replies
Total Likes
I have used same mechanism with multiple server and deployment but never had any issue with memory. What application server are you using ?
Can you try BusFactory.getDefaultBus().setProperty("set-jaxb-validation-event-handler", "false"); before setting context ?
Yogesh
Views
Replies
Total Likes
Hi Yogesh,
Thanks for the reply.
This happens even on my local machine. I run quick start, do multiple deploys, the permgen space increases up-to 10% for each deploy. I have analyzed the heap and looked at the classes getting loaded. For each deploy the cxf related classes are getting loaded , (sun.xml classes are getting loaded multiple times as well) and they are not getting unloaded. that is causing the increase in permgen.
On A Side note: I am using two-way ssl handshake authentication, i am sure that is not related to anything above, but just wanted to mention if you have run into something like with twoway ssl. Thanks.
Views
Replies
Total Likes