3 Replies Latest reply on Oct 21, 2013 6:18 AM by Dinabandhu Mitra

    Arquillian Persistence Not working with Tomcat Managed

    Dinabandhu Mitra Newbie

      Hi,

       

      I have been trying to setup arquillian, arquillian-persistence, CDI for various platforms. I have set it up for Jboss successfully but having problem with Tomcat. My tests fail with a exception. The details are below.

       

      The stack trace

       

      java.lang.RuntimeException: Unable to start transaction

          at org.jboss.arquillian.transaction.jta.provider.JtaTransactionProvider.beginTransaction(JtaTransactionProvider.java:62)

          at org.jboss.arquillian.transaction.impl.lifecycle.TransactionHandler.startTransactionBeforeTest(TransactionHandler.java:92)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

          at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

          at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.before(EventTestRunnerAdaptor.java:95)

          at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:222)

          at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

          at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

          at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240)

          at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)

          at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)

          at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)

          at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

          at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

          at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

          at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

          at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

          at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185)

          at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

          at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

          at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)

          at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

          at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)

          at org.junit.runner.JUnitCore.run(JUnitCore.java:157)

          at org.junit.runner.JUnitCore.run(JUnitCore.java:136)

          at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:65)

          at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.executeTest(ServletTestRunner.java:160)

          at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.execute(ServletTestRunner.java:126)

          at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:90)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

          at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)

          at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)

          at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)

          at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)

          at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)

          at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)

          at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)

          at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)

          at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)

          at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)

          at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)

          at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)

          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)

          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)

          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)

          at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)

          at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

          at java.lang.Thread.run(Thread.java:722)

      Caused by: java.lang.RuntimeException: Failed obtaining transaction.

          at org.jboss.arquillian.transaction.jta.provider.JtaTransactionProvider.getUserTransaction(JtaTransactionProvider.java:118)

          at org.jboss.arquillian.transaction.jta.provider.JtaTransactionProvider.beginTransaction(JtaTransactionProvider.java:56)

          ... 88 more

      Caused by: javax.naming.NamingException: Cannot create resource instance

          at org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:116)

          at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)

          at org.apache.naming.NamingContext.lookup(NamingContext.java:843)

          at org.apache.naming.NamingContext.lookup(NamingContext.java:154)

          at org.apache.naming.NamingContext.lookup(NamingContext.java:831)

          at org.apache.naming.NamingContext.lookup(NamingContext.java:168)

          at org.apache.naming.SelectorContext.lookup(SelectorContext.java:158)

          at javax.naming.InitialContext.lookup(InitialContext.java:411)

          at org.jboss.arquillian.transaction.jta.provider.JtaTransactionProvider.getUserTransaction(JtaTransactionProvider.java:115)

          ... 89 more

      testSecuredAccessFail(com.enhancesys.cerberus.testing.AuthorizationTest)  Time elapsed: 4.226 sec  <<< ERROR!

      java.lang.Exception: Unexpected exception, expected<com.enhancesys.cerberus.extension.exception.AuthorizationException> but was<java.lang.RuntimeException>

          at org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:28)

          at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:226)

          at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

          at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

          at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240)

          at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)

          at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)

          at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)

          at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

          at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

          at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

          at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

          at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

          at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185)

          at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

          at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

          at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)

          at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

          at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)

          at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)

          at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)

          at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)

          at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)

          at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)

          at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)

          at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)

      Caused by: java.lang.RuntimeException: Unable to start transaction

          at org.jboss.arquillian.transaction.jta.provider.JtaTransactionProvider.beginTransaction(JtaTransactionProvider.java:62)

          at org.jboss.arquillian.transaction.impl.lifecycle.TransactionHandler.startTransactionBeforeTest(TransactionHandler.java:92)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

          at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

          at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.before(EventTestRunnerAdaptor.java:95)

          at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:222)

          at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

          at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

          at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240)

          at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)

          at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)

          at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)

          at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

          at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

          at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

          at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

          at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

          at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185)

          at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

          at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

          at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)

          at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

          at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)

          at org.junit.runner.JUnitCore.run(JUnitCore.java:157)

          at org.junit.runner.JUnitCore.run(JUnitCore.java:136)

          at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:65)

          at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.executeTest(ServletTestRunner.java:160)

          at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.execute(ServletTestRunner.java:126)

          at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:90)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

          at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)

          at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)

          at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)

          at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)

          at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)

          at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)

          at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)

          at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)

          at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)

          at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)

          at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)

          at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)

          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)

          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)

          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)

          at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)

          at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

          at java.lang.Thread.run(Thread.java:722)

      Caused by: java.lang.RuntimeException: Failed obtaining transaction.

          at org.jboss.arquillian.transaction.jta.provider.JtaTransactionProvider.getUserTransaction(JtaTransactionProvider.java:118)

          at org.jboss.arquillian.transaction.jta.provider.JtaTransactionProvider.beginTransaction(JtaTransactionProvider.java:56)

          ... 88 more

      Caused by: javax.naming.NamingException: Cannot create resource instance

          at org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:116)

          at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)

          at org.apache.naming.NamingContext.lookup(NamingContext.java:843)

          at org.apache.naming.NamingContext.lookup(NamingContext.java:154)

          at org.apache.naming.NamingContext.lookup(NamingContext.java:831)

          at org.apache.naming.NamingContext.lookup(NamingContext.java:168)

          at org.apache.naming.SelectorContext.lookup(SelectorContext.java:158)

          at javax.naming.InitialContext.lookup(InitialContext.java:411)

          at org.jboss.arquillian.transaction.jta.provider.JtaTransactionProvider.getUserTransaction(JtaTransactionProvider.java:115)

          ... 89 more

       

       

       

      The Arquillian.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

      <arquillian xmlns="http://jboss.org/schema/arquillian"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

          <!-- <defaultProtocol type="Servlet 3.0"/> -->

       

          <engine>

              <property name="deploymentExportPath">target/jar</property>     

          </engine>

       

          <container default="true" qualifier="tomcat-remote">

              <configuration>

                  <property name="user">admin</property>

                  <property name="pass">admin</property>

              </configuration>

          </container>     

         

          <extension qualifier="persistence">

              <property name="defaultDataSource">java:/comp/env/jdbc/cerberus</property>

              <property name="scriptsToExecuteBeforeTest">SET REFERENTIAL_INTEGRITY FALSE</property>

              <property name="defaultDataSeedStrategy">CLEAN_INSERT</property>

          </extension>

       

       

          <extension qualifier="persistence-dbunit">

              <property name="datatypeFactory">org.dbunit.ext.postgresql.PostgresqlDataTypeFactory</property>

          </extension>

       

      </arquillian>

       

       

      The context.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

       

      <Context>

          <Resource  name="BeanManager"

                     auth="Container"

                     type="javax.enterprise.inject.spi.BeanManager"

                     factory="org.jboss.weld.resources.ManagerObjectFactory" />

                    

          <Resource name="jdbc/cerberus" auth="Container"

                    type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"

                    url="jdbc:postgresql://localhost:5432/cerberus"

                    username="postgres" password="root" maxActive="20" maxIdle="10"

                    maxWait="-1"/>              

      </Context>

       

      The web.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">

        <listener>

          <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>

        </listener>

        <filter>

          <filter-name>ShiroFilter</filter-name>

          <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>

        </filter>

        <filter-mapping>

          <filter-name>ShiroFilter</filter-name>

          <url-pattern>/*</url-pattern>

          <dispatcher>REQUEST</dispatcher>

          <dispatcher>FORWARD</dispatcher>

          <dispatcher>INCLUDE</dispatcher>

          <dispatcher>ERROR</dispatcher>

        </filter-mapping>

       

       

          <listener>

              <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>

          </listener>

         

          <resource-env-ref>

              <resource-env-ref-name>BeanManager</resource-env-ref-name>

              <resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>

          </resource-env-ref>

          <resource-ref>

              <description>postgreSQL Datasource example</description>

              <res-ref-name>jdbc/postgres</res-ref-name>

              <res-type>javax.sql.DataSource</res-type>

              <res-auth>Container</res-auth>

          </resource-ref>

      </web-app>

       

       

      I would appreciate any help or pointers.

       

      Regards,

      Dinabandhu