DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Coding
  3. Java
  4. Debugging Using Wildfly and Arquillian

Debugging Using Wildfly and Arquillian

Sumith Puri user avatar by
Sumith Puri
·
May. 02, 15 · Tutorial
Like (3)
Save
Tweet
Share
13.07K Views

Join the DZone community and get the full member experience.

Join For Free

This should be most useful for those starting out with Arquillian! I spent quite some time before finding out the solution.


The arquillian.xmlshould include the following contents:

 <engine>  
     <property name="deploymentExportPath">target/</property>  
   </engine>  
   <container qualifier="jbossas-managed-wildfly-8" default="true">  
        <protocol type="jmx-as7">  
       <property name="executionType">REMOTE</property>  
     </protocol>  
     <configuration>  
          <property name="allowConnectingToRunningServer">true</property>  
       <property name="jbossHome">C:\Program Files (x86)\PSL\RCA\ApplicationServer</property>  
       <property name="modulePath">C:\Program Files (x86)\PSL\RCA\ApplicationServer\modules</property>  
       <property name="javaVmArguments">-Xrunjdwp=transport=dt_socket,address=8000,server=y,suspend=n -Djava.util.logging.manager=org.jboss.logmanager.LogManager</property>  
     </configuration>  
   </container>  



Include the following profile in your Maven pom.xml:

  <profile>  
   <id>arquillian-wildfly-managed</id>  
   <activation>  
        <activeByDefault>true</activeByDefault>  
        </activation>    
   <dependencies>  
      <dependency>  
        <groupId>org.jboss.spec</groupId>  
        <artifactId>jboss-javaee-6.0</artifactId>  
        <version>3.0.1.Final</version>  
        <type>pom</type>  
        <scope>test</scope>  
      </dependency>  
      <!-- Required by jboss-javaee-6.0:3.0.2.Final (https://issues.jboss.org/browse/JBBUILD-708) -->  
      <dependency>  
        <groupId>xalan</groupId>  
        <artifactId>xalan</artifactId>  
        <version>2.7.1</version>  
        <scope>test</scope>  
      </dependency>  
      <dependency>  
        <groupId>org.wildfly</groupId>  
        <artifactId>wildfly-arquillian-container-managed</artifactId>  
        <version>8.1.0.Final</version>  
        <scope>test</scope>  
      </dependency>  
      </dependencies>  
   </profile>  

When we use Arquillian, there are three VM's that are involved:


1. Arquillian (Source) > Remote/Managed Server


Start the Remote/Managed Server with the following line added to standalone.conf.bat

 set "JAVA_OPTS=%JAVA_OPTS% -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n"  

In Eclipse, Right Click on your project and Click on "Debug" and under "Connect" - Select your "Host" and "Port". Click on "Apply" and "Debug". This will connect the Debugger to the Remote VM inside Wildfly. 


2. Test > Remote/Managed Server


Now, Right Click on your Arquillian Test and Click on "Debug As.." or "Debug Configurations". Then select either "TestNG" or "JUnit".

 

Now, you will be able to hit the breakpoint. Happy Debugging!


WildFly

Published at DZone with permission of Sumith Puri. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Streamlining Your Workflow With the Jenkins HTTP Request Plugin: A Guide to Replacing CURL in Scripts
  • Spring Cloud: How To Deal With Microservice Configuration (Part 1)
  • Automated Performance Testing With ArgoCD and Iter8
  • Kubernetes vs Docker: Differences Explained

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: