EAR files are optional for Java EE development.
This is not either / or: if you are deploying a Java EE application, you need some kind of container.
I have deployed Spring applications on Tomcat and WebLogic. I think WebLogic is the best Java EE application server on the market. My decision about whether it will be deployed or not will be based solely on availability.
You saw that Spring has its own Java EE container. He deploys Tomcat and marries him with OSGi and Spring. I have not tried it yet, but if the quality is similar to their framework, it will be very promising.
You really ask: "When will I write the application using Spring? When should I choose EJB3?"
Nowadays, Spring is preferred. I can do perseverance, transactions, messaging, web services and everything I need.
source share