0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

JBoss、GlassfishにデプロイしたWebアプリケーションをリモートからEclipseでデバッグ

Posted at

JBoss、Glassfishともに、もともとリモートデバッグ用にオプションが用意されている。

確認した環境

  • Glassfish4.1.2
  • JBoss7.4
  • Java1.8

GlassFishの場合

--debugオプションをつけて起動

asadmin start-domain --debug

9009がデバッグ用のポート
image.png

JBoss(standalone)の場合

standalone.confファイルの以下のコメントをはずす。以下は、address=8787なので8787がデバッグ用のポート。

# Sample JPDA settings for remote socket debugging
JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"

起動時には、localhost以外からも起動できるようbindアドレスを指定する。

standalone.sh -b 0.0.0.0

Eclipse側の設定

プログラムを停止したいところで、ブレークポイントを設定したのち、Eclipseのデバッグ設定画面を開き、「Remote Java Application」の設定を行います。以下のEclipse側の設定と同じ。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?