[jboss-jira] [JBoss JIRA] Updated: (JBTEST-13) JBossTestServices.login cannot let flushAuthCache fail

Scott M Stark (JIRA) jira-events at lists.jboss.org
Thu Jul 23 17:58:29 EDT 2009


     [ https://jira.jboss.org/jira/browse/JBTEST-13?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott M Stark updated JBTEST-13:
--------------------------------

    Workaround Description: 
You can use a class specific delegate that overrides the login methods, for example:

   public static AbstractTestDelegate getDelegate(Class clazz) throws Exception
   {
      AbstractTestDelegate delegate = new JBossTestServices(clazz)
      {
         @Override
         public void login() throws Exception
         {
            String confName = System.getProperty("conf.name", "profileservice");
            AppCallbackHandler handler = new AppCallbackHandler(PROFILE_SERVICE_PRINCIPAL, PROFILE_SERVICE_CREDENTIALS.toCharArray());
            LoginContext loginContext = new LoginContext(confName, handler);
            loginContext.login();
            System.err.println("login as: "+PROFILE_SERVICE_PRINCIPAL);
         }
         
      };
      return delegate;
   }

                Workaround: [Workaround Exists]


> JBossTestServices.login cannot let flushAuthCache fail
> ------------------------------------------------------
>
>                 Key: JBTEST-13
>                 URL: https://jira.jboss.org/jira/browse/JBTEST-13
>             Project: JBoss Test
>          Issue Type: Bug
>    Affects Versions: 1.1.4.GA
>            Reporter: Scott M Stark
>            Assignee: Scott M Stark
>
> I created a test setup that set jbosstest.secure to true:
>    public static Test suite() throws Exception
>    {
>       System.setProperty("jbosstest.secure", "true");
>       System.setProperty("jbosstest.username", PROFILE_SERVICE_PRINCIPAL);
>       System.setProperty("jbosstest.username", PROFILE_SERVICE_CREDENTIALS);
>       
>       TestSuite suite = new TestSuite();
>       suite.addTest(new ProfileServiceUnitTestCase("testNonAdminProfileKeys"));
>       suite.addTest(new ProfileServiceUnitTestCase("testProfileKeys"));
>       return getDeploySetup(ProfileServiceUnitTestCase.class, suite, "testSecureProxies.beans");
>    }
> but this fails because the JBossTestServices.login fails because of a call to flushAuthCache before the login information has been set:
> 10132 [main] DEBUG org.jboss.test.profileservice.testsecure.ProfileServiceUnitTestCase  - args=[other]
> java.lang.SecurityException: Failed to authenticate principal=null, securityDomain=jmx-console
> 	at org.jboss.jmx.connector.invoker.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:88)
> 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
> 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
> 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
> 	at org.jboss.invocation.jrmp.server.JRMPProxyFactory.invoke(JRMPProxyFactory.java:180)
> 	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:585)
> 	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
> 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
> 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
> 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
> 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
> 	at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:855)
> 	at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:422)
> 	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:585)
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
> 	at java.lang.Thread.run(Thread.java:613)
> 	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
> 	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
> 	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> 	at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(JRMPInvoker_Stub.java:44)
> 	at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:133)
> 	at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:365)
> 	at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:197)
> 	at org.jboss.jmx.connector.invoker.client.InvokerAdaptorClientInterceptor.invoke(InvokerAdaptorClientInterceptor.java:66)
> 	at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:68)
> 	at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:74)
> 	at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:101)
> 	at $Proxy0.invoke(Unknown Source)
> 	at org.jboss.test.JBossTestServices.invoke(JBossTestServices.java:239)
> 	at org.jboss.test.JBossTestServices.invoke(JBossTestServices.java:228)
> 	at org.jboss.test.JBossTestServices.flushAuthCache(JBossTestServices.java:367)
> 	at org.jboss.test.JBossTestServices.login(JBossTestServices.java:313)
> 	at org.jboss.test.JBossTestCase$1.setUp(JBossTestCase.java:301)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:20)
> This needs to be caught and ignored.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list