Ich habe nichts Besonderes, bis jetzt getan, bekam aber diese lästige Ausnahme:Warum sind in meiner Spring Boot Rest Data-Anwendung zweideutige Handlermethoden für den HTTP-Pfad zugeordnet?
java.lang.IllegalStateException: Mehrdeutige Behandlermethoden für HTTP-Pfad zugeordnet 'http://localhost:8080/directoryWatches': {public org.springframework.http.ResponseEntity org. springframework.data.rest.webmvc.RepositoryEntityController.headCollectionResource (org.springframework.data.rest.webmvc.RootResourceInformation, org.springframework.data.rest.webmvc.support.DefaultedPageable) löst org.springframework.web.HttpRequestMethodNotSupportedException, public org. springframework.hateoas.Resources org.springframework.data.rest.webmvc.RepositoryEntityController.getCollectionResource (org.springframework.data.rest.webmvc.RootResourceInformation, org.springframework.data.rest.webmvc.support.DefaultedPa tauschbare, org.springframework.data.domain.Sort, org.springframework.data.rest.webmvc.PersistentEntityResourceAssembler) wirft org.springframework.data.rest.webmvc.ResourceNotFoundException, org.springframework.web.HttpRequestMethodNotSupportedException}
Hier ist meine Einheit:
@Entity
public class DirectoryWatch {
@Id
@GeneratedValue
private long id;
@Column(unique = true)
private String name;
//setters, getters and default constructor...
}
und mein DirectoryWatchRepository:
@RepositoryRestResource
public interface DirectoryWatchRepository extends PagingAndSortingRepository<DirectoryWatch, Long> {
}
die Ausnahme tritt, wenn ich den HAL-Browser öffnen und versuchen, die NON-GET zu öffnen HTTP M ethoden:
Snippets meiner pom-Datei:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.M2</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
Dependencies:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator-docs</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-rest-hal-browser</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-remote-shell</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-mockmvc</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.11.0</version>
</dependency>
</dependencies>
Hat jemand eine helfende Idee?
Danke, Christian
Bitte fügen Sie relevante Snippets Ihres POM hinzu oder geben Sie die Versionen der verwendeten Artefakte an. – Thomas
Hallo Thomas. Pom Deps hinzugefügt. – Chrisposure
@Chrisposure können Sie Ihren Controller-Code hinzufügen? – cralfaro