This content has been marked as final.
Show 1 reply
-
1. Re: Arqullian starting embedded Wildfly incorrectly: not logging hibenate sql
mrazjava Apr 23, 2015 9:25 AM (in response to b1102)I'm on AS 7.1.0 but my setup is very similar to yours and does work. Perhaps try first running against 7.1.0 if you get the same error compare with setup below. Note that I'm not pulling manually any libs (inluding log) since they're commin off of maven resolver.
package myapp.ejb.api.test; import javax.inject.Inject; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.transaction.UserTransaction; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.shrinkwrap.api.ArchivePaths; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.resolver.api.maven.Maven; /** * Base for all persistance tests that require full ear. * * @author Adam Zimowski (mrazjava) */ public abstract class ArquillianPersistenceTest { @PersistenceContext protected EntityManager em; @Inject protected UserTransaction utx; @Deployment public static EnterpriseArchive createDeployment() { final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "myapp-ejb-test.jar") .addPackages(true, "myapp.ejb") .addAsManifestResource("test-persistence.xml", ArchivePaths.create("persistence.xml")) .addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")); return ShrinkWrap.create(EnterpriseArchive.class, "myapp-test.ear") .addAsModule(jar) .addAsLibraries(Maven.resolver().resolve("org.gnu:gnu-crypto:2.0.1").withTransitivity().asFile()) .addAsLibraries(Maven.resolver().resolve("org.hibernate:hibernate-entitymanager:4.3.8.Final").withTransitivity().asFile()); } protected void startTransaction() throws Exception { utx.begin(); em.joinTransaction(); } protected void commitTransaction() throws Exception { utx.commit(); } }
For maven resolver you need this in your pom.xml:
<dependency> <groupId>org.jboss.shrinkwrap.resolver</groupId> <artifactId>shrinkwrap-resolver-impl-maven</artifactId> <scope>test</scope> </dependency>
Again, not sure about wildfly but in 7.1x I don't even bother defining my log config. Simply edit jboss standalone.xml to define your logger there and hibernate log will show in your console or wherever you redirect it to.
Hope this helps.