title: springboot api's not working ..neither it showing any error in eclipse's console
body: <p><a href="https://i.stack.imgur.com/ywhUl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ywhUl.png" alt="enter image description here" /></a>here is my UserController class</p>
  <pre><code>package ritu.login;
  
  import java.util.List;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.DeleteMapping;
  import org.springframework.web.bind.annotation.GetMapping;
  import org.springframework.web.bind.annotation.PathVariable;
  import org.springframework.web.bind.annotation.PostMapping;
  import org.springframework.web.bind.annotation.PutMapping;
  import org.springframework.web.bind.annotation.RequestBody;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RestController;
  
  @RestController
  @Configuration  
  @RequestMapping(&quot;/vs1&quot;)
  public class UserController {
  
      @Autowired
      UserService userService;
  
      @GetMapping(&quot;/users&quot;)
      public List&lt;User&gt; getAllUsers() {
          return userService.getAllUsers();
      }
  
      @GetMapping(&quot;/user/{id}&quot;)
      private User getUser(@PathVariable(&quot;id&quot;) long id) {
          return userService.getUserById(id);
      }
  
      @DeleteMapping(&quot;/user/{id}&quot;)
      public void deleteUser(@PathVariable(&quot;id&quot;) long id) {
          userService.delete(id);
      }
  
      @PostMapping(&quot;/users&quot;)
      public long saveUser(@RequestBody User user) {
          userService.saveOrUpdate(user);
          return user.getId();
      }
  
      @PutMapping(&quot;/users&quot;)
      public User Update(@RequestBody User users) {
          userService.saveOrUpdate(users);
          return users;
      }
  }
  </code></pre>
  <p>Here is UserService class</p>
  <pre><code>package ritu.login;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Service;
  
  @Service
  public class UserService {
  
      @Autowired
      UserRepository userRepository;
  
      public List&lt;User&gt; getAllUsers() {
          List&lt;User&gt; users = new ArrayList&lt;User&gt;();
          userRepository.findAll().forEach(user1 -&gt; users.add(user1));
          return users;
      }
  
      public User getUserById(long id) {
          return userRepository.findById(id).get();
      }
  
      public void saveOrUpdate(User users) {
          userRepository.save(users);
      }
  
      public void delete(long id) {
          userRepository.deleteById(id);
      }
  
      public void update(User users, long id) {
          userRepository.save(users);
      }
  }
  </code></pre>
  <p>here is my pom.xml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
      xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.6.3&lt;/version&gt;
          &lt;relativePath /&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
      &lt;groupId&gt;ritu.login&lt;/groupId&gt;
      &lt;artifactId&gt;login-register&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;login-register&lt;/name&gt;
      &lt;description&gt;login example&lt;/description&gt;
      &lt;properties&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
          &lt;maven-jar-plugin.version&gt;3.1.1&lt;/maven-jar-plugin.version&gt;
      &lt;/properties&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
              &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-devtools&lt;/artifactId&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
              &lt;optional&gt;true&lt;/optional&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.faces&lt;/groupId&gt;
              &lt;artifactId&gt;jsf-api&lt;/artifactId&gt;
              &lt;version&gt;2.2.10&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.faces&lt;/groupId&gt;
              &lt;artifactId&gt;jsf-impl&lt;/artifactId&gt;
              &lt;version&gt;2.2.10&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;jstl&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
              &lt;version&gt;2.5&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;
              &lt;artifactId&gt;jsp-api&lt;/artifactId&gt;
              &lt;version&gt;2.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/org.apache.tomcat/tomcat-jasper --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.tomcat&lt;/groupId&gt;
              &lt;artifactId&gt;tomcat-jasper&lt;/artifactId&gt;
              &lt;version&gt;9.0.30&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax&lt;/groupId&gt;
              &lt;artifactId&gt;javaee-web-api&lt;/artifactId&gt;
              &lt;version&gt;7.0&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
              &lt;type&gt;jar&lt;/type&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.primefaces&lt;/groupId&gt;
              &lt;artifactId&gt;primefaces&lt;/artifactId&gt;
              &lt;version&gt;6.1&lt;/version&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  <p>here is my url in postman</p>
  <pre><code>http://localhost:8080/vs1/users
  </code></pre>
  <p>It gives error of 404 Not found..what should i do?
  here is Pojo class</p>
  <pre><code>package ritu.login;
  
  import java.io.Serializable;
  import java.sql.Connection;
  import java.sql.DriverManager;
  import java.sql.PreparedStatement;
  import java.sql.ResultSet;
  
  import javax.faces.application.FacesMessage;
  import javax.faces.bean.ManagedBean;
  import javax.faces.bean.SessionScoped;
  import javax.faces.context.FacesContext;
  import javax.persistence.Entity;
  import javax.persistence.Id;
  
  import org.springframework.context.annotation.Configuration;
  import org.springframework.stereotype.Component;
  @Entity
  @ManagedBean(name = &quot;loginBean&quot;)
  @SessionScoped
  @Component  
  public class User implements Serializable{
      
      private static final long serialVersionUID = -7250065889869767422L;
  
      @Id
      private Long id;
      private String name;
  
      public Long getId() {
          return id;
      }
  
      public void setId(Long id) {
          this.id = id;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
      
      public String validate(Long id,String name) {
          try {
              Class.forName(&quot;com.mysql.jdbc.Driver&quot;);
              Connection con = DriverManager.getConnection(&quot;jdbc:mysql://localhost:3306/any&quot;, &quot;root&quot;, &quot;jaygurudev1@&quot;);
              PreparedStatement ps = con.prepareStatement(&quot;Select id,name from user where id=? and name=?&quot;);
              ps.setLong(1, id);
              ps.setString(2, name);
              ResultSet rs = ps.executeQuery();
  
              if (rs.next()) {
                  return &quot;hello.xhtml&quot;;
              } else {
                  FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN,
                          &quot;Incorrect Username and Passowrd&quot;, &quot;Please enter correct username and Password&quot;));
                  return  &quot;index&quot;;
              }
  
          } catch (Exception e) {
              System.out.println(&quot;in exception&quot;);
          }
          return null;
      }
  }
  </code></pre>
  <p>i saw some tutorial on javatpoint and other website but still the issue can't get solved.
  what am i missing in the code or any version related issues?
  <strong>IT GIVES 404 ERROR,WHILE HITTING URL</strong></p>