-
1. Re: How to debug embedded JBoss ?
aslak Feb 16, 2010 6:15 AM (in response to satrapu)1 of 1 people found this helpfulJBoss Embedded is running in the same JavaVM as your unit test, so you have to start your unit test in debug mode.
This all depends on how your actually running it, but;
Eclipse: use "debug as" instead of "run as" to start the test
Maven: mvn -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -Xnoagent -Djava.compiler=NONE" test
-
2. Re: How to debug embedded JBoss ?
satrapu Feb 16, 2010 6:58 AM (in response to aslak)Hi Aslak,
Thanks for your answer.
I am using Netbeans 6.5 - do you have some suggestion regarding this IDE debug configuration ?
-
4. Re: How to debug embedded JBoss ?
satrapu Feb 16, 2010 7:36 AM (in response to aslak)This link, unfortunately, does not help - it's describing NetBeans 4.0 + JUnit, while I am working on NetBeans 6.5 + TestNG.
I have tried using NetBeans 6.8 + TestNG plugin - no success.
The thing is I am trying to perform my tests using Ant and before my TestNG runner starts, some files get compiled and then copied to some folders, so right-clicking the TestNG method does not work ...
-
5. Re: How to debug embedded JBoss ?
satrapu Feb 16, 2010 8:27 AM (in response to aslak)1 of 1 people found this helpfulI've found out how to debug my TestNG test when running on JBoss embedded:added some <jvmarg value="..." /> in my Ant target which started the tests, something like:
<echo>bootstrap dir: ${bootstrap.dir}</echo>
<taskdef resource="testngtasks" classpath="${testng.jar}" />
<testng outputdir="${basedir}/test-report">
<classpath refid="test.classpath" />
<xmlfileset dir="." includes="testng.xml" />
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=6789,server=y,suspend=y"/>
</testng>
</target>After starting this target, inside the NetBeans output window I see:
test:
bootstrap dir: ../../common/builds/../bootstrap
Listening for transport dt_socket at address: 6789In this moment I can attach the NetBeans debugger and I can debug my code.
The most important config params are the ones in bold red.
-
6. Re: How to debug embedded JBoss ?
viggo.navarsete Sep 20, 2011 11:08 AM (in response to aslak)Any updates on this? I would also like to know how to debug a test when running an embedded JBoss container. Description in either Eclipse or Netbeans would be great. "Debug As" doesn't work in Eclipse, it doesn't use the profile:( I've tried to set it as the active profile, but still doesn't work.
-
7. Re: How to debug embedded JBoss ?
aslak Sep 20, 2011 4:38 PM (in response to viggo.navarsete)if you activate the profile using m2eclipse, and just run debug-as should work
-
8. Re: How to debug embedded JBoss ?
viggo.navarsete Sep 21, 2011 5:12 AM (in response to aslak)I tried activating the profile the way you described Aslak, but this is the output in Eclipse when debuggin the test (Debug As-JUnit Test):
Sep 21, 2011 11:10:26 AM org.jboss.arquillian.container.impl.client.container.ContainerRegistryCreator getActivatedConfiguration
INFO: Could not read active container configuration: null
Boot Log available in: /tmp
log4j:WARN No appenders could be found for logger (org.jboss.bootstrap.impl.base.server.AbstractServer).
log4j:WARN Please initialize the log4j system properly.
-
9. Re: How to debug embedded JBoss ?
viggo.navarsete Sep 23, 2011 3:46 AM (in response to viggo.navarsete)According to Aslak you need to set JBOSS_HOME for *each test* when debugging in Eclipse.
Please go to Debug Configurations, pick the test you want to debug, click on Environment, click New, set JBOSS_HOME as name and the path to your JBoss installation as value. Now you should be able to debug your test from Eclipse:)