javaintegration-testingjboss7.xjboss-arquillianp6spy

How to setup p6spy driver in Arquillian tests on jBoss 7.x?


Apart from setting up the module in

JBOSS_HOME/modules/com/p6spy/main

adding p6spy.jar and module.xml saying:

<module xmlns="urn:jboss:module:1.0" name="com.p6spy">
  <resources>
    <resource-root path="p6spy.jar"/>
  </resources>
  <dependencies>
    <module name="javax.api"/>
  </dependencies>
</module>

editing standalone-full.xml and adding an entry under datasources/drivers:

<driver name="p6spy" module="com.p6spy">
  <xa-datasource-class>com.p6spy.engine.spy.P6SpyDriver</xa-datasource-class>
</driver>

adding module dependency in jboss-deployment-structure.xml:

<module name="com.p6spy"/>

replacing the original driver in data source definition with p6spy I'm still getting this error:

Caused by: java.lang.Exception:
  {"JBAS014771: Services with missing/unavailable dependencies" => 
    ["jboss.data-source.jboss/datasources/MyDsjboss.jdbc-driver.p6spyMissing
      [jboss.data-source.jboss/datasources/MyDsjboss.jdbc-driver.p6spy]"
    ]}

Solution

  • This is a rather old question, but I answer for the sake of future readers.

    You don't need p6spy, JBoss AS 7 provides spying capabilities out of the box. Two steps are required.

    That is it. You now have all database communication logged in your server.log. Spy log is actually a bit too verbose for my liking, but you do have all the information.