0 Replies Latest reply on Mar 3, 2011 12:01 PM by Olalekan Ogunleye

    Url Address for RestEasy

    Olalekan Ogunleye Newbie
      Hi All,

      Please, can somebody help me. I am new to reastful services. I have created a restful services and I have made the necessary settings. below is the method and the likes

      import javax.ws.rs.GET;
      import javax.ws.rs.Path;
      import javax.ws.rs.Produces;
      import javax.ws.rs.core.MediaType;

      public class SubscriberTopUpManagerBean implements SubscriberTopUpmanager, Serializable{

      This is the method

      that I am pointing to

           public long reserveUnits(Integer subId, Long requestedUnits) {
                String balInquiry = "select balance from SubTopUp where subscriber_id=:subId";
                Query balInquiryQuery = entityManager.createQuery(balInquiry);
                long allocatedUnits = 0;
                Long bal = (Long) balInquiryQuery.setParameter(balInquiry, subId).getSingleResult();
                if ((bal - requestedUnits) < 0 )
                     FacesMessages.createFacesMessage(FacesMessage.SEVERITY_ERROR, "Insufficient Fund.", "Please, Load some units");
                } else
                     long newBalance = bal-allocatedUnits;
                     subTopUp = new SubTopUp();
                     String balQuery = "Update SubTopUp SET balance = :newBalance";
                     Query query = entityManager.createQuery(balQuery);
                     subTopUp = (SubTopUp) query.setParameter(balQuery, newBalance).getSingleResult();
                     System.out.println("I just got here");
                return allocatedUnits;

      This is my settings in web.xml

        <servlet-name>Seam Resource Servlet</servlet-name>

        <servlet-name>Seam Resource Servlet</servlet-name>

      and this is the settings components.xml

      <resteasy:application resource-path-prefix="/v2">

      When I run the application, I then point my uri address to

      But what I got is HTTP Status 404 - Can someone please tell me what I am doing wrong and how should I do this. Your help is greatly and highly appreciated. Thank you