Reputation: 3325
I have three general JavaEE + Tomcat questions:
According to this link (Using Hibernate with Tomcat) running Hibernate in Tomcat is possible (despite Tomcat not supporting JPA). Does anyone know if I'll run into problems with this configuration (Hibernate on Tomcat)?
Can I do something similar to get EJB3.1 support in Tomcat?
For example, by dropping the correct files into WEB-INF/lib
and WEB-INF/classes
could I run EJB3.1 in a standard Tomcat7 container (not TomEE)?
If yes, which EJB3.1 providers are recommended?
Generally, is it possible to run any JavaEE technology from within Tomcat as long as the appropriate libraries and configuration files are placed in WEB-INF/lib
and WEB-INF/classes
?
Or, is it only possible to run the technologies for which Tomcat supports the interfaces?
Thanks in advance for all help!
Upvotes: 2
Views: 3518
Reputation: 692121
You won't run into problems, but you'll have to handle transactions and session handling yourself, unless you use Spring for example.
No.
No.
Tomcat is a servlet and JSP container, and not a full-stack Java EE container. A Java EE container must support EAR files, and Tomcat only deploys WAR files. Stuffing libraries into a WAR file won't make it an EAR file.
Upvotes: 0
Reputation: 3769
Many things that are in Java EE can be added to Tomcat. TomEE is the living proof of that. What TomEE does is mostly what you can also do.
It's really typical to add JPA (Hibernate) and a JTA transaction manager (Atomikos, JoTM, etc) to Tomcat. Next on the list is JSF (Mojarra or MyFaces) and CDI (Weld). JAX-RS (Jersey, RestEasy) can also be added.
At the end you could ask yourself if it isn't easier to just install TomEE or GlassFish though...
Upvotes: 0
Reputation: 24047
Drop-in WARs.
A version of Apache OpenEJB that can be dropped into any Tomcat 7.x install effectively creating your own Apache TomEE Web Profile or Apache TomEE Plus.
Upvotes: 3