1 Reply Latest reply: Nov 13, 2012 9:52 PM by 959967 RSS

    ADF Security Exception When running Junit test cases via ANT

    Indrajith
      Hi all

      I am trying to run the Junit Test cases from Ant (OutSide JDeveloper).
      ADF Security is enabled in my appliaction.
      While running i am getting a ADF Security Exception.
      Iam getting this error only when i run via ANT.In

      Below is the stack Trace

      15:18:09,425 ERROR [AppConfiguration] Error occured when loading configuration from AllConfigurationsView
      JBO-30003: Application pool com.rk.model.appmodules.AppSharedServicesAppModuleUnitTest fails to check out an application module due to the following exception:
      oracle.adf.share.security.ADFSecurityAuthenticationException: EXC_NO_AUTHENTICATION_SERVICE
           at oracle.adf.share.security.authentication.AuthenticationServiceUtil.getAuthenticationService(AuthenticationServiceUtil.java:68)
           at oracle.jbo.common.UserAznUtil.authenticate(UserAznUtil.java:60)
           at oracle.jbo.common.UserAznUtil.authenticateUser(UserAznUtil.java:28)
           at oracle.jbo.server.ApplicationModuleImpl.prepareSession(ApplicationModuleImpl.java:6844)
           at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolMessage(ApplicationPoolMessageHandler.java:174)
           at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:8942)
           at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:4602)
           at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2532)
           at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareResource(ApplicationPoolImpl.java:3776)
           at oracle.jbo.pool.ResourcePool.useResource(ResourcePool.java:334)
           at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2338)
           at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2377)
           at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3241)
           at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:571)
           at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:504)
           at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:499)
           at com.rk.model.configuration.AppConfiguration.reloadConfigurationFromDatabase(AppConfiguration.java:128)
           at com.rk.model.configuration.AppConfiguration.initInstance(AppConfiguration.java:119)
           at com.rk.model.configuration.AppConfiguration.<init>(AppConfiguration.java:93)
           at com.rk.model.configuration.AppConfiguration.newInstance(AppConfiguration.java:156)
           at com.rk.test.AppTestContext.<init>(AppTestContext.java:48)
           at com.rk.test.AppTestContext.<init>(AppTestContext.java:37)
           at com.rk.test.AppTestContext.getCurrentInstance(AppTestContext.java:55)
           at com.rk.test.AppTestCase.<init>(AppTestCase.java:10)
           at com.rk.test.AppModuleTestCase.<init>(AppModuleTestCase.java:77)
           at com.rk.test.AppAppModuleTestCase.<init>(AppAppModuleTestCase.java:17)
           at com.rk.test.AppBatchAppModuleTestCase.<init>(AppBatchAppModuleTestCase.java:26)
           at com.rk.integration.input.process.ProcessRelationSlagteSoTest.<init>(ProcessRelationSlagteSoTest.java:31)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
           at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
           at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:171)
           at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:216)
           at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
           at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:213)
           at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
           at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
           at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
           at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
           at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
           at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
           at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
           at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
           at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
           at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:518)
           at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JUnitTask.java:1420)
           at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:848)
           at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue(JUnitTask.java:1899)
           at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:800)
           at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
           at org.apache.tools.ant.Task.perform(Task.java:348)
           at org.apache.tools.ant.Target.execute(Target.java:390)
           at org.apache.tools.ant.Target.performTasks(Target.java:411)
           at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
           at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
           at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
           at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
           at org.apache.tools.ant.Main.runBuild(Main.java:809)
           at org.apache.tools.ant.Main.startAnt(Main.java:217)
           at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
           at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)


      Please help me out to solve this issue.

      Thanks
      Ranjith
        • 1. Re: ADF Security Exception When running Junit test cases via ANT
          959967
          This issue usually comes when there is a problem with the ADF security.

          just go to adf-config.xml change the options from

          ----------

          <sec:adf-security-child xmlns="http://xmlns.oracle.com/adf/security/config">
          <CredentialStoreContext credentialStoreClass="oracle.adf.share.security.providers.jps.CSFCredentialStore"
          credentialStoreLocation="../../src/META-INF/jps-config.xml"/>
          <sec:JaasSecurityContext initialContextFactoryClass="oracle.adf.share.security.JAASInitialContextFactory"
          jaasProviderClass="oracle.adf.share.security.providers.jps.JpsSecurityContext"
          authorizationEnforce="true"
          authenticationRequire="true"/>
          </sec:adf-security-child>
          ---------
          to


          ----------

          <sec:adf-security-child xmlns="http://xmlns.oracle.com/adf/security/config">
          <CredentialStoreContext credentialStoreClass="oracle.adf.share.security.providers.jps.CSFCredentialStore"
          credentialStoreLocation="../../src/META-INF/jps-config.xml"/>
          <sec:JaasSecurityContext initialContextFactoryClass="oracle.adf.share.security.JAASInitialContextFactory"
          jaasProviderClass="oracle.adf.share.security.providers.jps.JpsSecurityContext"
          authorizationEnforce="false"
          authenticationRequire="false"/>
          </sec:adf-security-child>
          ---------

          It worked for me hopefully will work for you too. by this we are disabling the security in our application.

          Thanks
          Vipin