Eclipseã§ãªã¢ã¼ããããã°ãããæ¹æ³
Tomcatã使ç¨ããå ´åã¨ãOC4Jã使ç¨ããå ´åã®ä¸¡æ¹ã§è©¦ãã¦ã¿ãã
æå¤ã«ãµã¯ãµã¯åãã
Tomcatã使ç¨ããå ´åã®è¨å®
$ cd $TOMCAT_HOME/bin $ ./catalina.sh jpda start
èµ·åæã«jpda startã¨ããã ãã§åãã
Oracle Application Server(OC4J)ã使ç¨ããå ´åã®è¨å®
$ cd $ORACLE_HOME/opmn $ vi conf/opmn.xml
... <ias-component id="oc4j01" status="enabled"> <process-type id="oc4j01" module-id="OC4J" status="enabled"> <module-data> <category id="start-parameters"> <data id="java-options" value="-server -Djava.security.policy=$ORACLE_HOME/j2ee/oc4j01/config/java2.policy -Djava.awt.headless=true -Dhttp.webdir.enable=false -XX:MaxPermSize=128M -Xms512M -Xmx1024M -XX:AppendRatio=3 -Dcom.sun.management.jmxremote"/> </category> ...
id="java-options"ã®valueã®æå¾ã«ã
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
ã追å ããã
å¤æ´ãããåèµ·åããã
$ bin/opmnctl stopall ... $ bin/opmnctl startall ...
Eclipseã®è¨å®
Menu > Run > Debug Configurationsãéãã
Remote Java Applicationã追å ãã¦ã以ä¸ã®é
ç®ãå
¥åããã
- Project: ãããã°å¯¾è±¡ã®ããã¸ã§ã¯ã
- Connection Type: Standard (Socket Attach)
- Host: æ¥ç¶å ãµã¼ãã®IPã¢ãã¬ã¹
- Port: 8000
Debugãã¿ã³ãæ¼ãã¨ãªã¢ã¼ããããã°ãéå§ãããã
ï¼ãã¼ã«ã«ã§ã®ãããã°ã¨éãããã¼ã¹ãã¯ãã£ããåãæ¿ããã空æ°ã®ããã«å§ã¾ãï¼
ãã¨ã¯ãã¬ã¼ã¯ãã¤ã³ããè¨å®ããå¾ã«ãã©ã¦ã¶ã§ç»é¢ã表示ãããã°ãããã°ã§ããã
ã¨ã©ã¼ãåºãå ´å
以ä¸ã®ãããªã¨ã©ã¼ãåºãå ´åã¯ã以åã®ã³ãã¯ã·ã§ã³ãæ®ã£ãã¾ã¾ã«ãªã£ã¦ã¾ãã
è¤æ°äººã§ä½¿ããµã¼ãã®å ´åãåæã«ã¯ï¼äººã ãããæ¥ç¶ã§ããªãã¨ããç¹ã«æ³¨æã
Failed to connect to remote VM. Connection refused. java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:520) at java.net.Socket.connect(Socket.java:470) at java.net.Socket.<init>(Socket.java:367) at java.net.Socket.<init>(Socket.java:180) at org.eclipse.jdi.internal.connect.SocketTransportService$2.run(SocketTransportService.java:136) at java.lang.Thread.run(Thread.java:595)