Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Application servers offer a set of services "out of the box", so they are easier to use <em>if the offered services are the ones you need</em>. You just package and deploy your application and the thing works. Furthermore, most of the technologies are instantiated by the application server, so you avoid a lot of classloader issues.</p> <p>The problem with application servers is that sometimes (quite often, actually), you need to pick and choose particular versions of particular frameworks, services, etc that are incompatible with those which the application server offers. In those cases, you usually need to fiddle with the application server, and in some cases, what you would like to do might not even be possible with your application server.</p> <p>For example, Weblogic 10.x is a Java EE 5 application server and so it will offer by default JSF 1.2 and JPA 1. If you want to use something newer, you need to manually deploy some additional libraries (JSF 2.0), or patch the server (JPA 2.0). </p> <p>Another example: with Glassfish 3.1 I have not been able to use Tomcat EL intead of Glassfish EL. Tomcat EL supports varargs method call while Glassfish EL does not.</p> <p>That rigidness of Java EE application servers makes a lot of people prefer developing for a standalone servlet container such as Tomcat or Jetty, where you have <em>nothing</em> out of the box but the Servlet and JSP APIs, but you can manually put <em>everything</em> inside. You can also package it with your application, which is more comfortable when you are developing, but can give you problems if you deploy more than one application per container (waste of resources, classloading issues, classloader leaks, ...)</p> <p><strong>UPDATE:</strong></p> <p>There are <em>some</em> differences in using JPA in a SE environment (such as Tomcat) when compared to using JPA inside a Java EE container. Basically:</p> <ul> <li>You have to manually manage <code>EntityManagerFactory</code> and <code>EntityManager</code> instances.</li> <li>Tomcat does not do injection so <code>@PersistenceContext</code> annotation and similar ones do not work.</li> </ul> <p>Note that some containers (such as Spring) can be configured to hide these details, so you can work exactly as if you were inside a Java EE container.</p> <p>Read <a href="http://jcp.org/aboutJava/communityprocess/final/jsr317/index.html" rel="nofollow">the JPA spec</a> for details on running in SE environments instead of EE environments.</p> <p>Regarding another libraries, in general you will find some minor differences. For example, JAX-WS requires registering a servlet and a listener for your webapp, but anything else should be identical. Usually you can search the documentation for instructions on how to run the thing inside a standalone servlet container.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload