0 Replies Latest reply on Dec 18, 2013 12:50 PM by Unice Gwe Mbuamuh

    Testing secured EJBs with Arquillian

    Unice Gwe Mbuamuh Newbie

      Hi,

       

      I am trying to test a secured EJB and having the error below. Does anyone have an insight into this, or know where i can find some guidelines on how to test a secured ejb with arquillian? Please find my ejb, and test class attached. Thank you.

       

      javax.ejb.EJBAccessException: JBAS014502: Invocation on method: public com.ec.frmw.is.engine.process.entities.TransTagAggregationEntity com.ec.frmw.is.engine.process.ejb.AggServiceHelperEJB.findTranTagAggregationEntity(com.ec.frmw.is.engine.process.ejb.AggServiceEntityPK) of bean: AggServiceHelperEJB is not allowed
          at org.jboss.as.ejb3.security.AuthorizationInterceptor.processInvocation(AuthorizationInterceptor.java:114)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:76)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
          at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165)
          at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
          at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72)
          at com.ec.frmw.is.engine.process.ejb.AggServiceHelperEJB$$$view1.findTranTagAggregationEntity(Unknown Source)
          at com.ec.frmw.is.engine.process.ejb.dataSet.AggServiceHelperEJBDataSetIT.testFindTransTagAggregationEntityById(AggServiceHelperEJBDataSetIT.java:102)
          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:606)
          at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
          at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
          at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
          at org.jboss.arquillian.junit.Arquillian$6$1.invoke(Arquillian.java:270)
          at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.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:606)
          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.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
          at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
          at org.jboss.arquillian.container.test.impl.execution.ContainerTestExecuter.execute(ContainerTestExecuter.java:38)
          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:606)
          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:606)
          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:606)
          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:606)
          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.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111)
          at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:263)
          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.ParentRunner.runLeaf(ParentRunner.java:271)
          at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
          at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
          at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
          at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
          at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
          at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
          at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
          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:309)
          at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)
          at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
          at org.junit.runner.JUnitCore.run(JUnitCore.java:138)
          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:734)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
          at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
          at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
          at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
          at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:389)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920)
          at java.lang.Thread.run(Thread.java:744)