본문으로 건너뛰기
cccskills
무료GitHub에 공개한국어 소개

java-debugging

재현 가능한 확인과 가설 검증으로 Java 예외, 예상 밖 동작, 테스트 실패를 조사합니다. 로그, 스택 추적, 디버거 연결로 원인을 좁히고 재발 방지 테스트를 추가합니다.

원문원문 설명 보기

Debug Java applications systematically: JDWP remote debugging, jdb, VS Code and IntelliJ attach, debugging Maven/Gradle tests, Spring Boot and Quarkus dev mode, containers, breakpoints/logpoints, and reading stack traces. Use when the user needs to find the cause of a Java bug, exception, wrong behavior, or failing test, or asks how to attach a debugger.

연동 도구Kubernetes

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Java 예외나 예상 밖 동작 조사
  • Maven 또는 Gradle 테스트 실패 추적
  • VS Code나 IntelliJ IDEA에서 디버거 연결
  • 개발 컨테이너의 Java 앱 디버깅

한국어 소개

할 수 있는 일

java-debugging은 Java 애플리케이션의 문제를 재현하고 가설을 하나씩 검증해 원인을 좁히도록 돕습니다. 예외가 발생했을 때의 호출 기록인 스택 추적을 읽고, 로그와 로그 포인트를 활용하며, 필요하면 중단점으로 실행 상태를 살펴보는 방법을 다룹니다. jdb, VS Code, IntelliJ IDEA를 통한 디버거 연결과 Maven 및 Gradle 테스트, Spring Boot, Quarkus, 컨테이너의 조사 절차도 안내합니다.

이럴 때 유용합니다

예외의 원인을 알기 어렵거나 테스트가 실패할 때, 로그만으로 처리 흐름을 따라가기 힘들 때 사용할 수 있습니다. 문제를 작은 단위로 재현하고 원인을 확인한 뒤 재발 방지 테스트를 추가하며, 임시 로그와 디버그 설정을 제거하는 흐름을 안내합니다.

사용 예시

  • “이 NullPointerException의 원인을 찾아 주세요.”
  • “실패하는 Maven 테스트를 디버거로 추적하고 싶습니다.”
  • “개발 컨테이너의 Java 앱에 IntelliJ IDEA를 연결하는 방법을 알려 주세요.”

주의 사항

연결하려면 적절한 JDK와 사용할 IDE 또는 도구가 필요합니다. 디버그 포트를 외부에 공개하지 말고, 원격 연결에는 터널을 사용해야 합니다. 운영 환경 연결은 명시적으로 요청된 경우에만 진행합니다. 설정은 JDK 및 Gradle 버전에 따라 다르며, 실행을 일시 정지하면 타이밍이나 시간 초과에 영향을 줄 수 있습니다.

이 소개문은 공개된 SKILL.md를 바탕으로 AI(OpenAI Codex)가 작성했습니다. 정확한 사양은 아래 원문을 확인하세요.

문서 점검

AI가 SKILL.md의 내용에서 주의가 필요한 작업과 도입 전제를 확인했습니다. 점수는 실제로 실행한 결과(실행 검증)만으로 매깁니다.

안전성전송·삭제·명령 실행 등을 명시하고 있는가
A양호로컬 루프백 바인딩과 터널을 요구하며 운영 환경 연결 조건도 명시합니다.
도입의 용이성필요한 도구나 API 키가 적고 적혀 있는가
B일부 부족JDK와 IDE 등이 필요하지만 설치 절차는 자료에 없습니다.

점수에는 넣지 않았습니다. 2026년 10월 25일 기준으로 AI(OpenAI Codex)가 판정했습니다. 참고용이므로 설치 전에 원문도 확인해 주세요.

평가가 다르다고 생각되면 재검토를 요청하기

어느 항목이 왜 다르다고 생각하는지 적어 주세요. 로그인은 필요 없습니다. SKILL.md와 대조해 평가를 다시 만들고 이곳에 반영합니다.

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

포함된 파일(2)

  • SKILL.md8.3 KB
  • references/stack-traces.md1.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Java Debugging

Find the root cause of a Java defect with a reproducible, hypothesis-driven loop, and attach a debugger safely when logs are not enough.

Safety rules

  • Bind JDWP to loopback only (127.0.0.1). Never bind *:5005 on a reachable network; use an SSH tunnel or kubectl port-forward for remote hosts.
  • Use suspend=n for running applications. suspend=y is acceptable only for short local test runs bound to loopback (waiting for the IDE to attach). Never leave a debug agent enabled on production; JDWP gives full code execution to whoever connects.
  • Do not attach a debugger to production without explicit user instruction. Prefer reproducing locally or use read-only diagnostics (see the java-diagnostics skill).
  • JAVA_TOOL_OPTIONS is picked up by every JVM started in that environment (build tools, forked test JVMs, child processes), causing Address already in use clashes. Prefer scoping the flag to the one process you want to debug.

Method

Reproduce deterministically, minimize, read the evidence (stack traces), test one falsifiable hypothesis with the least intrusive tool (log line or logpoint before breakpoints), then add a regression test and remove debug flags and temporary logging.

Version-dependent behavior (verified)

  • Helpful NullPointerException messages (JEP 358) are off by default in JDK 14 (-XX:+ShowCodeDetailsInExceptionMessages) and on by default from JDK 15 (JEP 358 documents the message format). Source: https://openjdk.org/jeps/358.
  • JDWP bare address=5005 binds all interfaces before JDK 9 and loopback from JDK 9 (see below).
  • Gradle --debug-jvm passes a bare address, so on JDK 8 it listens on all interfaces.

Attach a debugger (JDWP)

Start the JVM:

java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:5005 -jar app.jar

Always write the explicit 127.0.0.1:5005 on every JDK version: a bare address=5005 listens on all interfaces before JDK 9 and only on loopback from JDK 9. On JDK 8 and older, the host:port form may not be honored, so also restrict access with a firewall or tunnel.

Attach with jdb:

jdb -attach 127.0.0.1:5005
# stop in com.example.OrderService.place | stop at com.example.OrderService:42
# cont | next | step | locals | print order | where | catch java.lang.NullPointerException

VS Code (Extension Pack for Java)

.vscode/launch.json:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "java",
      "name": "Attach to JVM",
      "request": "attach",
      "hostName": "127.0.0.1",
      "port": 5005
    }
  ]
}

IntelliJ IDEA

Run | Edit Configurations | + | Remote JVM Debug; host 127.0.0.1, port 5005, debugger mode Attach. The dialog shows the matching JVM argument string.

Debug tests and frameworks

ScenarioCommand (port 5005)
Maven Surefire unit testmvn test -Dmaven.surefire.debug -Dtest=OrderServiceTest
Maven Failsafe ITmvn verify -Dmaven.failsafe.debug -Dit.test=OrderIT
Gradle testgradle test --debug-jvm --tests '*OrderServiceTest'
Spring Boot (Maven)mvn spring-boot:run -Dspring-boot.run.jvmArguments="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:5005"
Spring Boot (Gradle)Configure bootRun as below, then gradle bootRun (loopback, no suspend)
Quarkus dev modemvn quarkus:dev (debug port 5005 open by default; -Ddebug=5006 changes it, -Ddebug=false disables)

Surefire/Failsafe debug mode and --debug-jvm suspend until a debugger attaches, which is fine for a local run. Surefire and Failsafe accept a custom agent string instead of the bare flag, e.g. -Dmaven.surefire.debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=127.0.0.1:5005". Verified listeners on 127.0.0.1 (via lsof -nP -iTCP:5005 -sTCP:LISTEN) for Gradle 9.7 --debug-jvm, Maven Surefire 3.5 -Dmaven.surefire.debug and Quarkus 3.40 dev mode on JDK 26; Gradle 7.6.4, 8.0.2 (JDK 17), 8.5 (JDK 21) and 8.14.3 also listened on 127.0.0.1. Gradle passes a bare address=5005 (no host), so the bind address comes from the JDK: loopback on JDK 9+, but all interfaces (0.0.0.0:5005, checked in an eclipse-temurin:8-jdk container with Gradle 7.6.4 and 8.14.3) on JDK 8. Older Gradle/plugin versions were not tested; run the same lsof check and use an explicit loopback agent on shared networks or JDK 8.

Explicit Gradle configuration (Gradle 7.6+; debugOptions.host was added in 7.6; Kotlin DSL):

tasks.withType<Test> {
    debugOptions { enabled.set(true); host.set("127.0.0.1"); port.set(5005); server.set(true); suspend.set(true) }
}

// BootRun extends JavaExec, not Test; configure it separately when the Boot plugin is applied.
tasks.named<JavaExec>("bootRun") {
    debugOptions { enabled.set(true); host.set("127.0.0.1"); port.set(5005); server.set(true); suspend.set(false) }
}

Then run gradle test --tests '*OrderServiceTest' or gradle bootRun, without --debug-jvm (which enables suspension). Configure only the task you are debugging; do not run both listeners on port 5005 at once. For Gradle before 7.6, use jvmArgs("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:5005") on the target task instead (suspend=y for local tests), without also enabling debugOptions or --debug-jvm. On JDK 8 and older, retain the firewall/tunnel precaution above.

Containers

Publish the port to loopback only and let the JVM listen inside the container:

docker run --rm -p 127.0.0.1:5005:5005 \
  -e JAVA_TOOL_OPTIONS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005" my-app

Inside the container the agent must bind * for the port mapping to work, so JDWP (full code execution) is reachable by every other container on the same Docker network; the 127.0.0.1: mapping only blocks access from other hosts. Use this only on a developer machine where no untrusted containers share the network: run it on a dedicated user-defined network (not the shared default bridge) containing only this container, or keep the agent on 127.0.0.1 inside the container and reach it with docker exec/kubectl port-forward style forwarding instead of publishing it. For Kubernetes use kubectl port-forward pod/<name> 5005:5005 against a dev/staging pod only.

Common pitfalls

  • Hot code replace only swaps method bodies; adding/removing methods or fields or changing signatures needs a restart (or Quarkus dev mode / Spring DevTools).
  • Missing debug info: code compiled without -g shows unavailable variables (Maven and Gradle include it by default). In lambdas, step into the lambda body.
  • Heisenbugs/races: pausing changes timing. Prefer logpoints, thread dumps, or JFR; suspend only the current thread, not all threads.
  • Async and reactive code: stack traces show scheduler frames, not the caller. Use IDE async stack traces, correlation IDs, or Reactor Hooks.onOperatorDebug() in dev only.
  • Virtual threads (JDK 21+): there can be thousands; use jcmd <pid> Thread.dump_to_file -format=json file.json for an overview.
  • Timeouts: long pauses can trip HTTP, DB, or heartbeat timeouts; raise them locally.
  • toString() side effects: debugger evaluation calls toString(), which may trigger lazy loading or mutate state.

Optional code-navigation aid

If the Copilot CLI lsp tool is configured (see the lsp-setup skill), go-to-definition, find-references, and call hierarchy help trace the execution path. It is optional; grep and reading code work as well.

References

  • Reading stack traces
  • For runtime symptoms (CPU, memory, deadlocks, slow startup) use the java-diagnostics skill.

Official tool docs (prefer them over this skill for the JDK in use; change 21 to your version): jcmd https://docs.oracle.com/en/java/javase/21/docs/specs/man/jcmd.html, JDK troubleshooting guide https://docs.oracle.com/en/java/javase/21/troubleshoot/.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

acquire-codebase-knowledge

무료요약 있음

기존 프로젝트의 코드와 설정을 조사해 기술 구성, 구조, 아키텍처, 규칙, 연동, 테스트, 우려 사항을 다루는 문서 7개를 작성합니다. 근거 파일을 연결하고 미확인 항목을 표시하며, 계획과 실제 구현의 차이를 드러냅니다.

  • 익숙하지 않은 코드베이스 파악하기
  • 프로젝트 인수인계 문서 준비하기
  • 설계 문서와 실제 구현 비교하기
github/awesome-copilot4만2026년 10월 24일 업데이트

acreadiness-assess

무료요약 있음

AgentRC로 저장소의 AI 에이전트 활용 준비도를 평가하고 독립 실행형 HTML 보고서를 생성합니다. 9개 영역의 점수와 우선순위별 개선안을 확인하고, 조직에 맞춘 채점 정책도 적용할 수 있습니다.

  • AI 에이전트 도입 전 준비도 확인
  • 평가 결과에 따라 개선 우선순위 결정
  • 조직별 정책으로 점수 산정
github/awesome-copilot4만2026년 10월 24일 업데이트

프로젝트의 실제 코드에서 언어, 프레임워크, 개발 관례를 파악해 AI 코딩 에이전트용 지침 파일을 생성하거나 갱신합니다. 하나의 파일에 모으거나 주제와 프로젝트 영역별로 나누며, 쓰기 전에 변경 내용을 미리 볼 수 있습니다.

  • VS Code Copilot용 지침 만들기
  • 바뀐 개발 규칙을 지침에 반영
  • 모노레포 영역별 규칙 정리
github/awesome-copilot4만2026년 10월 24일 업데이트

acreadiness-policy

무료요약 있음

AgentRC 준비도 평가를 팀이나 조직의 기준에 맞게 조정합니다. JSON 정책에서 검사 중요도와 수준을 바꾸고, 불필요한 검사를 끄며, 통과율을 설정해 CI 자동 검사에도 적용할 수 있습니다.

  • 조직 공통 평가 기준 만들기
  • AI 관련 준비 상태만 평가
  • 검사 항목의 중요도 조정
github/awesome-copilot4만2026년 10월 24일 업데이트

ad-campaign-analyzer

무료요약 있음

제공한 광고 성과 데이터를 분석해 낭비되는 지출과 성과가 좋은 광고를 찾고, 중단·예산 증액·추가 테스트 후보를 정리합니다. 여러 플랫폼을 비교하고 A/B 테스트의 차이를 평가해 예산 재배분 방안도 제시합니다.

  • 중단할 광고나 키워드 찾기
  • 예산을 늘릴 캠페인과 대상 찾기
  • A/B 테스트 결과의 유의성 확인
github/awesome-copilot4만2026년 10월 24일 업데이트

add-educational-comments

무료요약 있음

지정한 코드 파일에 학습용 주석을 추가해 문법, 프로그래밍 개념, 설계 선택의 이유를 설명합니다. 독자의 지식에 맞춰 설명의 깊이와 반복 정도를 조절하며 파일 구조와 형식을 유지합니다.

  • 기존 코드에 초보자용 설명 추가
  • 문법이나 설계 방식을 선택한 이유 설명
  • 독자의 경험에 맞춰 주석 조정
github/awesome-copilot4만2026년 10월 24일 업데이트

github의 스킬 모두 보기

이 스킬의 문제 신고