vetController 부분에서 오류가 납니다. - 처음 Maven 실행 부분 입니다.
773
작성한 질문수 1
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] VetControllerTests.testShowResourcesVetList:75 Status expected:<200> but was:<406>
[ERROR] Errors:
[ERROR] PetclinicIntegrationTests.testFindAll » IllegalState Failed to load Applicatio...
[INFO]
[ERROR] Tests run: 40, Failures: 1, Errors: 1, Skipped: 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.446 s
[INFO] Finished at: 2020-12-10T00:09:20+09:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project spring-petclinic: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/username/IdeaProjects/spring-petclinic/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
안녕하세요 선생님,
git 으로부터 소스코드 다운받고, 1.8 버전의 jdk 로 했습니다.
그런다음에 maven
--> mvnw package
의 명령어를 터미널 켜서 쳤는데, 이러한 오류가 발생했습니다.
제가 스프링 코드를 아예 볼 줄 몰라서 구글링을 해 봤는데..
찾은 코드를 어디에 넣어야 할지 몰라서 이렇게 질문 남기게 되었습니다.
위는 오류 메세지 입니다.
혹시 몰라서 VetController 코드도 올려 보겠습니다.
package org.springframework.samples.petclinic.vet;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Map;
/**
* @author Juergen Hoeller
* @author Mark Fisher
* @author Ken Krebs
* @author Arjen Poutsma
*/
@Controller
class VetController {
private final VetRepository vets;
public VetController(VetRepository clinicService) {
this.vets = clinicService;
}
@GetMapping("/vets.html")
public String showVetList(Map<String, Object> model) {
// Here we are returning an object of type 'Vets' rather than a collection of Vet
// objects so it is simpler for Object-Xml mapping
Vets vets = new Vets();
vets.getVetList().addAll(this.vets.findAll());
model.put("vets", vets);
return "vets/vetList";
}
@GetMapping({ "/vets" })
public @ResponseBody Vets showResourcesVetList() {
// Here we are returning an object of type 'Vets' rather than a collection of Vet
// objects so it is simpler for JSon/Object mapping
Vets vets = new Vets();
vets.getVetList().addAll(this.vets.findAll());
return vets;
}
}
답변 1
0
로그를 읽어보시면 showResourcesVetList 테스트 케이스가 실패해서 빌드가 실패했다는 것을 알 수 있을 겁니다. 그러면 이제 해당 테스트를 실행해서 왜 실패하는지 알아내야겠죠?
지금 제공해 주신 정보로는 여기까지고.. 그 뒤에는 말씀드린대로 테스트 실행하면서 디버깅하고 왜 200 응답 대신 406이 나오는지 찾아보세요.
jar 안되는 분들 참고하세요
0
359
1
mvnw 오류
0
462
1
./mvnw package 오류
0
420
2
java -jar target/*.jar 명령어 오류..
0
446
2
./mvnw package 오류
0
278
0
./mvnw package 오류
0
210
1
실행 상태에서 변경내용이 바로 반영되나요 ??
0
225
1
도와주세용 ㅜㅜ
0
205
1
./mvnw package 오류
0
318
1
클론 받은 내용과 수업내용이
0
399
1
./mvnw package 오류
0
1143
2
순환참조와 bean 주입에 대한 질문입니다!
0
407
1
jdk 버전이 자꾸 낮다면서 오류가 발생합니다.
0
890
1
age가 화면에 표시가 안됩니다.
0
394
0
에러가 뜨는데 어떻게 해야할지 도저히 모르겠어요
0
1640
1
PetClinicApplication() 함수에서 run 을 하고 싶습니다...
0
519
0
h2와 hsqldb가 어떤차이가 있는건지 궁금합니다
0
1244
0
예제가 이전과 다르네요
0
369
0
메이븐으로 설정했는데 그래들이 같이 보일수 있나요?
0
572
1
LogAspect
0
325
1
구현체가 2개 이상일때 생성자 주입
0
365
1
의존성 주입 방법들 장단점
0
492
1
인스턴스의 생명주기와 제어권
0
309
1
IoC 컨테이너 안에 있는 객체들끼리만 의존성 주입
0
370
1





