RESTEasy Tutorial Part-1: Basics

RESTEasy Tutorial Series

RESTEasy Tutorial Part-1: Basics

RESTEasy Tutorial Part-2: Spring Integration

RESTEasy Tutorial Part 3 – Exception Handling

RESTEasy is a JAX-RS implementation from JBoss/RedHat and is in-built in JBoss 6 onwards.
Here I am going to show you how to develop a Simple RESTful Web Services application using RESTEasy and JBossAS7.1.1.FINAL.

Step#1: Configure RESTEasy dependencies using Maven.

Step#2: Configure RESTEasy in web.xml

Step#3: Create User domain class, MockUserTable class to store User objects in-memory for testing purpose and UserResource class to expose CRUD operations on User as RESTful webservices.

Step#6: JUnit TestCase to test the REST Webservice.

Step#7: To test the REST service we can use the REST Client Tool. 
You can download REST Client Tool at

Important Things to Keep in mind:
1. org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap Listener should be registered before any other listener.

2. You should configure resteasy.servlet.mapping.prefix <context-param> if the HttpServletDispatcher servlet url-pattern is anything other than /*

3. Keep visiting my blog :-)


  1. Anonymous
      June 8, 2012

    Nice! Thanks.

  2. Bernd Rottmann
      September 12, 2012

    Hi Siva,

    thank you for your nice tutorial.
    Could you say something about deploment issues.
    I try to deploy the war file on JBoss 7.1.1 but a ClassNotFoundException is raised for the classes:




    which are defined in the web.xml file.

    Greetings from Berlin


  3. siva
      September 12, 2012

    Hi Bernd,
    Those classes should be part of JBoss-7.1.1 Server.

    org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher class can be found in jboss-as-7.1.1.Finalmodulesorgjbossresteasyresteasy-jaxrsmainasync-http-servlet-3.0-2.3.2.Final.jar.

    org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap class can be found in jboss-as-7.1.1.Finalmodulesorgjbossresteasyresteasy-jaxrsmainresteasy-jaxrs-2.3.2.Final.jar.

  4. Yogesh Kumar
      February 5, 2013

    Hi Siva,
    Thank you 4 this example, could you say something about the conversion of JSON to java & JAVA to JSON . It will be very nice if explain it via example.

  5. Unknown
      September 21, 2014

    Hi, Siva, thank you for this example. What do you think about adding an interface to the UserResource service and moving JAX-RS annotations to the interface? This way you can use this interface in clients to create a service proxy.

Leave a Reply

Your email address will not be published. Required fields are marked *