• Post Reply Bookmark Topic Watch Topic
  • New Topic

Does the JVM load multiple copies of Apache CXF?  RSS feed

 
Carl Miller
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have 8 "services" (Java Servlets) that are currently configured in one war file. All the services are endpoints in an Apache CXF framework.

Every time there is a code update to one services, all 8 services must be undeployed and re-deployed.

If we put each service in a separate war file, will one instance of the Java Virtual Machine load 8 copies of CXF?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, ifthe CXF libraries are kept in the WEB-INF of each war. The only way around that would be to keep CXF as part of servlet container's shared libraries (or the JVM's shared libraries), which for any given library may or may not work well. No idea if CXF is writtten for that kind of scenario.

But I don't understand this, and that may just be a reflection of my almost non-existent knowledge of CXF:
Every time there is a code update to one services, all 8 services must be undeployed and re-deployed.
Is that how CXF works in general? For example, using Axis2 each service is deployed as a separate ".aar" file that can be undeployed and redeployed as needed, independent of other services. But if each service is actually a servlet as you say, a restart of the web app may be unavoidable.
 
Carl Miller
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Ulf.

I will look into using the servlet container's folder (directory) for shared application resources.

"HP [Hewlett-Packard] recommends that all application-specific resources be bundled with the application and not be placed in the shared folder. This is to ensure that the application resources are independent of the container."
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it's generally recommended not to store shared libs in the servlet container's libs directory, especially given that hard disk space and server memory are so cheap, thus reducing the point of doing so. For something like the JSTL libraries I also think it's entirely uncritical. For other libraries it depends on the library; many work that way, some may not.

Keeping the libs with each web app also lets you use different library versions for each web app. That may or may not be a consideration in your case..
 
Carl Miller
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. I appreciate your perspective and insights.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!