title: Java EE vs Standalone
body: <p>I'm working on a project where we need to build several 'standalone' modules connecting to one database. These modules are mainly background business processes, so not much frontend. Except for one web module showing the data and allowing basic CRUD functions. For this we are planning to use the following techniques:</p>
  
  <ul>
  <li>JPA2 (using hibernate-jpa implementation)</li>
  <li>CDI (using spring implementation)</li>
  <li>JSF2 + primefaces (for our web module)</li>
  </ul>
  
  <p>The initial plan was to just create a jar file (with a main method) per module and install it as a (windows) service via a service wrapper. For our web module we would use Glassfish or JBoss to run it. However, lately Java EE came to our minds. We could run all our modules in a Java EE container like Glassfish or JBoss, not only our web module. Some questions for the case that we go for Java EE:</p>
  
  <ol>
  <li>Can / should we still use CDI with spring? Or should we switch to EJB3?</li>
  <li>What are the consequences for JPA when we use it from within a container instead of standalone modules? Is there any difference?</li>
  <li>Since most of our modules are not web related does it still make sense to run them in a Java EE container?</li>
  </ol>