Results 1 to 2 of 2
  1. #1
    handro1104 is offline Member
    Join Date
    Feb 2011
    Posts
    7
    Rep Power
    0

    Default 404 error on REST with Tocat

    I created a REST web service with STS, and deployed the war file in Tomcat 8, But when i try to acces it froma client I get a 404 ERROR. My client is
    public static void main(String[] args) {
    RestTemplate restTemplate = new RestTemplate();
    Employee employee = restTemplate.getForObject("http://localhost:8080/rest", Employee.class);
    int id = employee.getId();
    String name = employee.getName();
    Date date = employee.getCreatedDate();
    String result = "Id: " + id + " Name: " + name + " Date: " + date;
    System.out.println(result);
    }
    On the other hand, if I create the web service in NetBeans it works. Is there a particular way to create a war file in STS?

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: 404 error on REST with Tocat

    Not sure what STS is, but the first thing I would do is see what has actually been deployed to Tomcat.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Requested resource is not available (REST)
    By infamousKTF in forum New To Java
    Replies: 0
    Last Post: 09-12-2014, 04:32 PM
  2. Rest
    By gayathrikven in forum New To Java
    Replies: 4
    Last Post: 12-14-2012, 09:44 AM
  3. Coordinating GUI and Rest of Program
    By BAL in forum New To Java
    Replies: 1
    Last Post: 01-29-2012, 02:31 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •