inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

스프링 시큐리티

디버깅 오류 관련 질문 드립니다.

534

Heesun Choi

작성한 질문수 2

0

안녕하세요 최근에 수강 시작한 비전공자 학생입니다!

상세히 설명해주셔서 잘 따라가며 듣고있습니다!

그런데 아주 기초적인 부분에서 안되는 부분이 있어서 질문드립니다.

디버깅이 익숙치 않아서 그부분에서 조금 애를 먹고 그냥 코드만 일일이 따라가며 보고있었는데요.

직접 디버깅하며 봐야 더 잘 이해가 갈 것 같아서요..

제가 디버깅을 돌리면 아래와 같이 오류가 뜨고 실행버튼 옆에 있는 디버그 버튼을 눌러서 실행하면 http = null로 나와서

연결되는것 같지 않더라구요. 실제로 breakpoint 걸었던 부분에 대한 내용도 안뜨구요.

/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home/jre/bin/java -cp "/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home/lib/sa-jdi.jar:/Applications/IntelliJ IDEA.app/Contents/plugins/java/lib/sa-jdwp-1.15.jar" com.jetbrains.sa.SaJdwpAttachingServer 3411 Cheryls-MacBook-Pro.local:53406 ERROR: attach: task_for_pid(3411) failed: '(os/kern) failure' (5) Exception in thread "main" sun.jvm.hotspot.debugger.DebuggerException: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process. Could be caused by an incorrect pid or lack of privileges. at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal$BsdDebuggerLocalWorkerThread.execute(BsdDebuggerLocal.java:169) at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.attach(BsdDebuggerLocal.java:287) at sun.jvm.hotspot.HotSpotAgent.attachDebugger(HotSpotAgent.java:671) at sun.jvm.hotspot.HotSpotAgent.setupDebuggerDarwin(HotSpotAgent.java:659) at sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:341) at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:304) at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:140) at com.jetbrains.sa.jdi.VirtualMachineImpl.createVirtualMachineForPID(VirtualMachineImpl.java:159) at com.jetbrains.sa.SaJdwpUtils.createVirtualMachine(SaJdwpUtils.java:29) at com.jetbrains.sa.SaJdwpAttachingServer.main(SaJdwpAttachingServer.java:38) Caused by: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process. Could be caused by an incorrect pid or lack of privileges. at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.attach0(Native Method) at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.access$100(BsdDebuggerLocal.java:65) at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal$1AttachTask.doit(BsdDebuggerLocal.java:278) at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal$BsdDebuggerLocalWorkerThread.run(BsdDebuggerLocal.java:144) /usr/bin/osascript -e "tell current application activate do shell script quoted form of \"/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home/jre/bin/java\" & \" \" & quoted form of \"-cp\" & \" \" & quoted form of \"/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home/lib/sa-jdi.jar:/Applications/IntelliJ IDEA.app/Contents/plugins/java/lib/sa-jdwp-1.15.jar\" & \" \" & quoted form of \"com.jetbrains.sa.SaJdwpAttachingServer\" & \" \" & quoted form of \"3411\" & \" \" & quoted form of \"Cheryls-MacBook-Pro.local:53406\" with prompt \"Please enter your password to attach with su privileges: \" with administrator privileges without altering line endings end tell" 40:721: execution error: ERROR: attach: task_for_pid(3411) failed: '(os/kern) failure' (5) Exception in thread "main" sun.jvm.hotspot.debugger.DebuggerException: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process. Could be caused by an incorrect pid or lack of privileges. at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal$BsdDebuggerLocalWorkerThread.execute(BsdDebuggerLocal.java:169) at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.attach(BsdDebuggerLocal.java:287) at sun.jvm.hotspot.HotSpotAgent.attachDebugger(HotSpotAgent.java:671) at sun.jvm.hotspot.HotSpotAgent.setupDebuggerDarwin(HotSpotAgent.java:659) at sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:341) at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:304) at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:140) at com.jetbrains.sa.jdi.VirtualMachineImpl.createVirtualMachineForPID(VirtualMachineImpl.java:159) at com.jetbrains.sa.SaJdwpUtils.createVirtualMachine(SaJdwpUtils.java:29) at com.jetbrains.sa.SaJdwpAttachingServer.main(SaJdwpAttachingServer.java:38) Caused by: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process. Could be caused by an incorrect pid or lack of privileges. at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.attach0(Native Method) at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.access$100(BsdDebuggerLocal.java:65) at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal$1AttachTask.doit(BsdDebuggerLocal.java:278) at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal$BsdDebuggerLocalWorkerThread.run(BsdDebuggerLocal.java:144) (1)

그리고 breakpoint 걸 때 class 파일이 아닌 -.java 파일에 걸어야 하는 걸로 알고 있는데

저는 필터나 어댑터 등 검색해서 찾거나 cmd + click해서 따라가면 class파일로만 나오는데 그건 왜그런 걸까요 ㅠㅠ

초보적인 질문이지만 답변주시면 많은 도움이 될 것 같습니다.

감사합니다!

------------------------
아 마지막 .class -> .java 부분은 해결했습니다. 소스다운로드가 안되어 있었네요!

디펜던시 추가하고 빌드하면 자연히 다 다운로드 되는줄 알았는데.. 허허

debug spring-boot java Spring Security

답변 2

0

Heesun Choi

답변 감사합니다! 

세팅에 프로젝트와 모듈에 모두 잘 설정되어있고

자바 컴파일러도 잘 잡혀있는데 왜 그러는지 모르겠습니다.. ㅠㅠ 

혹시 보여드린 부분중에 잘못된 부분이 있을까요? 

0

정수원

혹시 인텔리제이에서 실행시킬 때 JDK 를 선택해 주셨나요?

인텔리제이에서 프로젝트 세팅에 가 보시면 JDK 를 선택할 수 있는데 확인해 보시기 바랍니다

위 오류는 인텔리제이와 관련된 것이나 JDK 설정 관련된 오류로 보입니다.
정확한 원인은 실제 개발 환경에서만 파악이 가능한 부분이고 저의 시스템에서 재현 하기가 어려워 해결에 대한 답변을 드리지 못하는점 양해 부탁드립니다.

시큐리티 공부 버전 질문

0

173

1

[해결 방법] MethodSecurityConfig.customMethodSecurityMetadataSource() 호출하지 않는 이슈

0

182

1

AbstractSecurityInterceptor.class.beforeInvocation()를 2번 실행하는 경우

0

172

1

강의 코드가 왜이렇게 뒤죽박죽인가요...

0

246

1

메인 페이지로 접속해도 login url로 리다이렉트가 되지 않습니다..

0

233

1

파라미터값이 넘어가지 않습니다 ....

0

372

1

security filterChain 설정 질문이 있습니다.

0

328

1

소스 부분 질문 드립니다.

0

206

2

섹션4 7번 강의 문제가 있는거 같네요.

0

342

2

파일이 수시로 이름이 바껴있네요 ㄷㄷ

0

302

1

HttpSessionSecurityContextRepository를 사용안하는 문제

0

553

2

error , exception 이 잘 안됩니다.

0

275

2

thymeleaf tag 질문합니다.

0

194

2

버전업하면서 deprecated된 것들이 너무많아요

0

476

1

spring security 패치 관련

0

435

1

모바일을 사용할때 토큰말고 세션

0

843

2

DB 연동한 인가 부분에 대한 질문입니다!

0

262

1

Ajax방식도 똑같이 Session방식을 사용하는건가요?

0

305

1

Config 파일 생성 시 질문이 있습니다.

0

223

1

강사님 몇일동안 구글 검색만 100개 했는데도 이유를 모르겠습니다..

1

427

2

403 에러 뜹니다.

0

808

2

login_proc의 존재에 대한 간략한 설명입니다

0

272

1

top.html에 로그인 링크를 만들어서 로그인을 해봤습니다

0

275

2

안녕하세요. DB에 저장될 때 이해 안 가는 값이 있어서 질문드립니다!

0

186

1