Notice
Recent Posts
Recent Comments
Link
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Archives
Today
Total
관리 메뉴

한바다

깃 브랜치 add 오류 본문

카테고리 없음

깃 브랜치 add 오류

한바다진화 2024. 6. 27. 21:35

☑️      깃 브랜치 업로드 시 오류  금일 깃 브랜치 똑똑 두드리는데 아래와 같은 오류 가 떳다 우선 명령어는 

C:\Users\user1\hanbatang>git checkout jinhwa2-register Already on 'jinhwa2-register' Your branch is ahead of 'origin/jinhwa2-register' by 1 commit. (use "git push" to publish your local commits) C:\Users\user1\hanbatang>

 

C:\Users\user1\hanbatang>git push To https://github.com/jaewon0123/hanbatang.git ! [rejected] jinhwa2-register -> jinhwa2-register (fetch first) error: failed to push some refs to 'https://github.com/jaewon0123/hanbatang.git' hint: Updates were rejected because the remote contains work that you do not hint: have locally. This is usually caused by another repository pushing to hint: the same ref. If you want to integrate the remote changes, use hint: 'git pull' before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. C:\Users\user1\hanbatang>

 

위 오류 내용 확인 시

 

  • git push를 했지만, 원격 저장소에 로컬에 없는 변경사항이 있어서 push가 거부되었으며
  • 해결 방법은 git pull 명령어를 사용해서 원격 저장소의 변경사항을 로컬 저장소로 가져와서 통합한 후에 다시
  • git push를 시도
  • 그리고 git pull origin jinhwa2-register 입력 시

또다른 에러가 생겼다.

C:\Users\user1\hanbatang>git push origin jinhwa2-register
To https://github.com/jaewon0123/hanbatang.git
 ! [rejected]        jinhwa2-register -> jinhwa2-register (non-fast-forward)
error: failed to push some refs to 'https://github.com/jaewon0123/hanbatang.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. If you want to integrate the remote changes,
hint: use 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

C:\Users\user1\hanbatang>

 

깃은 역시 어렵다. 해당오류에 대해서는 월요일 선생님에게 문의를 해보고 다시 깃을 올리도록 해야 겠다

 

[마븐 인스톨시 발생한 오류]

BUILD FAILURE
[ERROR] Please refer to C:\Users\user1\hanbatang\hanbatang\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] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.481 s <<< FAILURE! -- in com.hanbatang.HanbatangApplicationTests
[ERROR] com.hanbatang.HanbatangApplicationTests.contextLoads -- Time elapsed: 0.010 s <<< ERROR!
[ERROR] Errors: 
[ERROR]   HanbatangApplicationTests.contextLoads » IllegalState Failed to load ApplicationContext for [WebMergedContextConfiguration@530ee28b testClass = com.hanbatang.HanbatangApplicationTests, locations = [], classes = [com.hanbatang.HanbatangApplication], contextInitializerClasses = [], activeProfiles = [], propertySourceDescriptors = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@4426bff1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@336f1079, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@3c9c0d96, org.springframework.boot.test.autoconfigure.actuate.observability.ObservabilityContextCustomizerFactory$DisableObservabilityContextCustomizer@1f, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizer@1fde5d22, org.springframework.boot.test.context.SpringBootTestAnnotation@1f250589], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null]
->IllegalState Failed
->애플리케이션 컨텍스트 로드 실패: IllegalStateException이 발생
[참조 블로그]
https://velog.io/@jinjubae/%EC%98%A4%EB%A5%98%ED%95%B4%EA%B2%B0-Caused-by-java.lang.IllegalStateException-Ambiguous-mapping.-Cannot-map-Controller-method
->원인 @GetMapping이 두개 있어서 발생한 오류 , 오류에 'IllegalState'에 있을 경우 이 경우를 생각해보자
두개로 생성된 메일컨트롤러와 멤버컨트롤러에 겟매핑이 중복으로 쓰여져 있었다. 방안은 기능이 같으면 지원주고 기능이 다르면
한쪽으로 몰아줘야 한다.

*메일컨트롤러에 적힌 겟메핑은
@GetMapping("/")
public String MailPage() {
return "index";
*멤버컨트롤러에 적힌 겟매핑은
@GetMapping("/")
public String registerForm(Model model) {
model.addAttribute("mem", new Member());
return "index";
▶ 따라서 기능이 없는 메일 컨트롤러 겟메핑은 지워준다

#두번째 에러 이메일인증을 추가하고 서버가 정상 실행되어 html화면에 정상 노출되었고
이메일인증번호는 정상 발송되었고 인증번호 기능은 구현되었으나
f12를 눌렀을때 인풋 태그에서 어떤 번호를 발송 했는지 봐야 하는데 아래와 같은 에러가 떳다
->에러가 뜨면 콘솔을 누르고 상세보기 누르면 됨