728x90
1. 오류 내용
더보기
java.lang.IllegalArgumentException: Invalid character found in method name [0x160x030x010x000xf70x010x000x000xf30x030x030x19|0x920xbb(G0x86p0xc40xc90xff0x040xa1Q0x1eP0x17h0xab0xfe0xa7&0x000xa26D0xf90x99%0xe10x8f2 ]. HTTP method names must be tokens
2. 기존 MemberController
@RestController
@RequestMapping("/api")
@RequiredArgsConstructor
public class MemberController {
private final MemberMapper mapper;
private final MemberService memberService;
// 이메일 중복 체크
@GetMapping("email/{email}")
public ResponseEntity<Object> emailCheck(@PathVariable(value = "email") String email) {
try {
return new ResponseEntity(memberService.existEmail(email), HttpStatus.OK);
} catch(Exception e) {
e.printStackTrace();
return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST);
}
}
}
3. 기존 Postman 요청 url
https://localhost:8080/api/email/springboot@naver.com
4. 문제점 및 해결방법
첫 번째 문제점
MemberController에서 @GetMapping(email/{email})이라고 적은 것이 문제였다.
제대로 된 url이 아니기 때문에 문제가 생긴 것이었다.
email 앞에 슬래쉬를 붙여서
@GetMapping(/email/{email})로 수정해주었다.
두 번째 문제점
Postman에서 요청을 보내는 url을 https라고 적은 것이 문제였다.
https를 통해 요청을 보내려면 토큰이 존재해야 하는데,
현재는 토큰 설정을 해두지 않은 상태이기 때문에 http로 수정을 해주었다.
728x90
'Trouble Shooting' 카테고리의 다른 글
[SpringBoot] cannot find symbol method builder() 해결 (0) | 2024.11.02 |
---|---|
[Spring Security] AccessDeniedException: Access Denied (0) | 2024.07.02 |
[NCP] Server 생성 시 잘못된 IP입니다. 해결 방법 (1) | 2024.05.28 |
[SpringBoot] SpringBoot 3 버전 Querydsl build.gradle 설정 오류 및 해결 (0) | 2024.05.07 |
[Spring] beancreationexception 오류 해결 (0) | 2024.05.03 |