title: Spring boot 404 not found
body: <p>Hello I am struggling to figure out what is my issue. Teacher did this in eclipse. I am on Intelleji. I made a project with Java 17 and the SDK 17 too. Spring boot 3.0.0 m1</p>
  <p>It is basic code but when I try to get it working i get error 404. Driving me nuts. If anyone sees something that I am not seeing i would be extremely grateful.</p>
  <p>the link i try in postman is as follow: localhost:8081/restws/services/patientservice/patients</p>
  <p>which is what the teacher did in eclipse or string tool suite.
  I am in intelleji ultimate.</p>
  <p>thank you for any help.</p>
  <p>my structure goes as follow:</p>
  <pre><code>.
  └── restws
      ├── PatientService.java
      ├── PatientServiceImpl.java
      ├── RestwsApplication.java
      └── model
          └── Patient.java
  </code></pre>
  <p>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;3.0.0-M1&lt;/version&gt;
      &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
  &lt;/parent&gt;
  &lt;groupId&gt;com.slinky&lt;/groupId&gt;
  &lt;artifactId&gt;restws&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;restws&lt;/name&gt;
  &lt;description&gt;restws&lt;/description&gt;
  &lt;properties&gt;
      &lt;java.version&gt;17&lt;/java.version&gt;
  &lt;/properties&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
          &lt;artifactId&gt;cxf-spring-boot-starter-jaxrs&lt;/artifactId&gt;
          &lt;version&gt;3.3.7&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-validation&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-starter&lt;/artifactId&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;/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;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;spring-milestones&lt;/id&gt;
          &lt;name&gt;Spring Milestones&lt;/name&gt;
          &lt;url&gt;https://repo.spring.io/milestone&lt;/url&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;false&lt;/enabled&gt;
          &lt;/snapshots&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  &lt;pluginRepositories&gt;
      &lt;pluginRepository&gt;
          &lt;id&gt;spring-milestones&lt;/id&gt;
          &lt;name&gt;Spring Milestones&lt;/name&gt;
          &lt;url&gt;https://repo.spring.io/milestone&lt;/url&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;false&lt;/enabled&gt;
          &lt;/snapshots&gt;
      &lt;/pluginRepository&gt;
  &lt;/pluginRepositories&gt;
  </code></pre>
  
  <p>PatientService.java</p>
  <pre><code>    package com.slinky.restws;
  
  import com.slinky.restws.model.Patient;
  import jakarta.ws.rs.GET;
  import jakarta.ws.rs.Path;
  
  import java.util.List;
  
  @Path(&quot;/patientservice&quot;)
  public interface PatientService {
      @Path(&quot;/patients&quot;)
      @GET
      List&lt;Patient&gt; getPatient();
  }
  </code></pre>
  <p>Patient.java from com.slinky.restws.model</p>
  <pre><code>  package com.slinky.restws.model;
  
  import jakarta.xml.bind.annotation.XmlRootElement;
  
  @XmlRootElement(name = &quot;Patient&quot;)
  public class Patient {
      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;
      }
  }
  </code></pre>
  <p>application.properties</p>
  <pre><code>cxf.jaxrs.classes-scan=true
  cxf.jaxrs.classes-scan-packages=org.codehaus.jackson.jaxrs, com.slinky.restws
  server.servlet.context-path=/restws
  server.port=8081
  </code></pre>
  <p>PatientServiceImpl.java</p>
  <pre><code>package com.slinky.restws;
  
  import com.slinky.restws.model.Patient;
  import org.springframework.stereotype.Service;
  
  import java.util.*;
  
  @Service
  public class PatientServiceImpl implements PatientService{
      Map&lt;Long, Patient&gt; patients = new HashMap&lt;&gt;();
      long currentId = 123;
  
      public PatientServiceImpl() {
          init();
      }
  
      public void init() {
          Patient patient = new Patient();
          patient.setId(currentId);
          patient.setName(&quot;John&quot;);
          patients.put(patient.getId(), patient);
      }
  
      @Override
      public List&lt;Patient&gt; getPatient() {
          Collection&lt;Patient&gt; results = patients.values();
          List&lt;Patient&gt; response = new ArrayList&lt;&gt;(results);
          return response;
      }
  }
  </code></pre>
  <p>main which was created automatically</p>
  <pre><code>package com.slinky.restws;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  
  @SpringBootApplication
  public class RestwsApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(RestwsApplication.class, args);
      }
  
  }
  </code></pre>