0 Replies Latest reply on Jun 9, 2011 4:36 PM by Eliram Aharon

    Consume Resteasy integrated with EJB

    Eliram Aharon Newbie



      I'm new to Restful web services.

      After spending lots of hours understaing how to build a simple server exposes an EJB through Resteasy, I finnaly got JBoss to deploy my app without any error.


      Now, I simply don't understand how to consume my service.

      I'm using IntelliJ 10.0.2 Rest Client for that. My project is here.


      I have GroupService interface:

      public interface GroupService
          public String getGroupShapes(@PathParam("groupName")String groupName);

      And GroupServiceBean:

      public class GroupServiceBean implements GroupService
          Map<String,WhiteBoardGroup> groups;
          public GroupServiceBean()
              groups = new HashMap<String, WhiteBoardGroup>();
              WhiteBoardGroup group = new WhiteBoardGroup("Yariv");
              Oval o = new Oval(-65536, new Point(5,5), new Point(20,20), true);
              Line l = new Line(-65536, new Point(60,60), new Point(90,90));
              groups.put(group.getName(), group);        
          public String getGroupShapes(@PathParam("groupName") String groupName)
              WhiteBoardGroup group = groups.get(groupName);
              ObjectMapper mapper = new ObjectMapper();
              try {
                  return mapper.writeValueAsString(group.getBorad());
              } catch (IOException e) {
              return "";


      And a web.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
         <display-name>Archetype Created Web Application</display-name>


      I tried:


      but I get HTTP 404.

      Does it mean that after all I did not build my ear correctly?