0 Replies Latest reply on Jul 8, 2003 7:00 PM by pkrishna

    ] Failed to access a SRPServerInterface instance

    pkrishna

      I am trying to port an application I down loaded from the web from JBoss 2.x to JBoss 3.x. When I the JUnit tests, I always get an exception as follows:


      [junit] Testcase: testValidInventoryAccess took 0.114 sec
      [junit] Caused an ERROR
      [junit] Failed to access a SRPServerInterface instance
      [junit] javax.security.auth.login.LoginException: Failed to access a SRPServ
      rInterface instance
      [junit] at org.jboss.security.srp.jaas.SRPLoginModule.login(SRPLoginModu
      e.java:171)
      [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
      orImpl.java:39)
      [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
      odAccessorImpl.java:25)
      [junit] at javax.security.auth.login.LoginContext.invoke(LoginContext.ja
      a:675)
      [junit] at javax.security.auth.login.LoginContext.access$000(LoginContex
      .java:129)
      [junit] at javax.security.auth.login.LoginContext$4.run(LoginContext.jav
      :610)
      [junit] at java.security.AccessController.doPrivileged(Native Method)
      [junit] at javax.security.auth.login.LoginContext.invokeModule(LoginCont
      xt.java:607)
      [junit] at javax.security.auth.login.LoginContext.login(LoginContext.jav
      :534)
      [junit] at com.ociweb.client.unittest.UT_CatalogMgr.testValidInventoryAc
      ess(UT_CatalogMgr.java:25)
      [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
      orImpl.java:39)
      [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
      odAccessorImpl.java:25)

      [junit] Testcase: testValidInventoryAccess

      Here are the contents of the client's auth.conf:


      srp {
      org.jboss.security.srp.jaas.SRPLoginModule required
      principalClassName="org.jboss.security.SimplePrincipal"

      srpServerJndiName="srp/SRPServerInterface"
      ;

      org.jboss.security.ClientLoginModule required
      password-stacking="useFirstPass"
      multi-threaded=true
      ;
      };

      THe login-config.xml on the server has the following entry:



      <application-policy name = "OciSRP">

      <login-module code = "org.jboss.security.srp.jaas.SRPCacheLoginModule"
      flag = "required">
      <module-option name = "cacheJndiName">srp/AuthenticationCache</module-option>
      </login-module>
      <login-module code = "com.ociweb.jmx.jaas.srp.DatabaseRoleLoginModule"
      flag = "required">
      <module-option name = "dsJndiName">java:/security</module-option>
      <module-option name = "rolesQuery">"SELECT TRIM(Roles.name), 'Roles' FROM Roles,GroupRoles,Groups,UserGroups,Users WHERE Roles.id=GroupRoles.roleID AND GroupRoles.groupID=Groups.id AND UserGroups.groupID=Groups.ID AND UserGroups.userID=Users.id AND Users.username=?"</module-option>
      </login-module>


      </application-policy>

      JBoss-service.xml has entry for 2 MBeans:



      srp/OCIVerifierStore
      java:/security
      SELECT TRIM(password) FROM users WHERE username=?



      srp/OCIVerifierStore
      srp/AuthenticationCache
      srp/SRPServerInterface



      The jndi name srp/SRPServerInterface in auth.conf is supposed to map to srp/SRPServerInterface in JBoss-service.xml.

      When I ran the jmx-console, I did see SRPService mapped to srp/SRPServerInterface.

      So I am not sure why I am getting the above exeption. Could somebody help me out?