Posts tagged with: restful

2013-02-28

Tutorial: exposing RESTful web services using EJB and Hibernate/JPA under JBoss AS

Some people think that Enterprise Java Beans (EJBs) deployed on EJB containers (Glassfish, JBoss, etc...) are “complicated” whereas RESTful web services deployed on servlet containers (e.g. Tomcat) are “simple”, and the two things cannot go together.

Actually, you can take the best of the two worlds, by exposing your EJBs with a REST interface. This allows you to exploit all the capabilities of an Enterprise Application Server (dependency injection, container-managed distributed transactions, etc...) while making life simpler for your clients, and without the need of shipping tons of libraries (e.g. Jersey, Hibernate, etc...) with your WAR.

In this tutorial we’ll create a web application interfaced with a MySQL database via Hibernate/JPA that runs in a EJB container (JBoss AS 7.1) and exposes a RESTful web service. Read more...

Fork me on GitHub