title: Does Apache Karaf handle hot deployments of any JAR or WAR?
body: <p>I am trying to see if I can refactor the architecture of a project I inherited, and am interested in Apache Karaf as a possible solution.</p>
  
  <p>Currently, we build an executable JAR for every single (non-profit) client that we have, and cron the JARs to run at different times.  Each "client JAR" uses several "commons" JARs amongst them, and contains client-specific logic inside of it. In all, there are several hundred client JARs and about a dozen common JARs.</p>
  
  <p>The problems with this architecture are numerous:</p>
  
  <ol>
  <li>Since the commons JARs are just meant to be libraries, there's no common <strong>platform</strong> for the client JARs to run on. Many of them use Apache Camel and use routes that are just local to those JARs, and there is enormous amounts of Camel code being duplicated across all the JARs. It would be nice to have a solution where all the client JARs can share the same Camel routes.</li>
  <li>It places the business logic of when to run each client JAR in the hands of cron, which is fine, but this being Java, I'd prefer to have a master Quartz "Scheduler" controlling when all JARs run.</li>
  <li>Every time I need to add a dependency to one of the commons JARs, I need to go through every crontab entry for every client JAR and modify the classpath argument to pick up the extra dependency.</li>
  <li>The list goes on and on...</li>
  <li>I just don't like the idea of cronning executable client JARs when they could work so much more cohesively if they were deployed to the same container.</li>
  </ol>
  
  <p>So basically, I need a solution that:</p>
  
  <ul>
  <li>Allows me to deploy/undeploy and re-deploy new versions of client JARs at any time without disrupting the rest of the system</li>
  <li>Deploy/undeploy any of the commons JARs so that any new client JARs that get started pick up the new versions of the commons JARs</li>
  <li>Allows me to deploy/undeploy a Quartz Scheduler (WAR or JAR) that can cron/schedule each of the client JARs to run at different times throughout the week</li>
  <li>Allows me to deploy/undeploy a message broker and perhaps an ESB such as Camel or Mule so that each of my client JARs can use the same queues and routes</li>
  <li>Allows me to deploy/undeploy a single logging JAR (log4j, commons logging, etc.) and a single JPA implementation JAR (Hibernate, MyBatis, etc.) and have it be universally used/usable for all client JARs</li>
  </ul>
  
  <p><strong>Can all of the above be accomplished with Karaf?</strong> If not, do I have any options here (Felix, Equinox, etc.)? Or am I chasing a dream?  Given my problem domain, are there any caveats or reasons why I should stick with the current solution? Thanks in advance!</p>
  
  <p>Please note: if anyone thinks that EJB3 is a good solution for me instead of OSGi, I'm certainly open to hearing your arguments, but my project manager <em>detests</em> EJBs (bad taste in his mouth leftover from the heavy EJB2 days) and will not likely approve such a solution.</p>