1 Reply Latest reply on Oct 27, 2001 7:53 PM by Scott Stark

    Can't use DatabaseServerLoginModule .....

    Levent Newbie

      I try to run the JBossSX Example from javaworld (writen by Scott Stark ), but I get the following error Message:

      on server Side I get :
      ----------------------
      [Default] User 'nobody' authenticated.
      [PublicSession] Authentication exception, principal=null
      [Default] User 'nobody' authenticated.
      [PrivateSession] Authentication exception, principal=null
      [PrivateSession] TRANSACTION ROLLBACK EXCEPTION:checkSecurityAssociation; nested exception is:
      java.lang.SecurityException: Authentication exception, principal=null; nested exception is:
      java.rmi.RemoteException: checkSecurityAssociation; nested exception is:
      java.lang.SecurityException: Authentication exception, principal=null
      [PrivateSession] java.rmi.RemoteException: checkSecurityAssociation; nested exception is:
      [PrivateSession] java.lang.SecurityException: Authentication exception, principal=null
      [PrivateSession] java.lang.SecurityException: Authentication exception, principal=null
      [PrivateSession] at org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityAssociation(SecurityInterceptor.java:168)
      [PrivateSession] at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:92)
      [PrivateSession] at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invokeHome(StatefulSessionInstanceIntercep
      [PrivateSession] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:135)
      [PrivateSession] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:307)
      [PrivateSession] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:86)
      [PrivateSession] at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:106)
      [PrivateSession] at org.jboss.ejb.StatefulSessionContainer.invokeHome(StatefulSessionContainer.java:326)
      [PrivateSession] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPContainerInvoker.java:372)
      [PrivateSession] at java.lang.reflect.Method.invoke(Native Method)
      [PrivateSession] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
      [PrivateSession] at sun.rmi.transport.Transport$1.run(Transport.java:142)
      [PrivateSession] at java.security.AccessController.doPrivileged(Native Method)
      [PrivateSession] at sun.rmi.transport.Transport.serviceCall(Transport.java:139)
      [PrivateSession] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:443)
      [PrivateSession] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:643)
      [PrivateSession] at java.lang.Thread.run(Thread.java:484)

      on the Client:
      ----------------------
      oss.docs.jaas.howto.SessionClient java echoman @example@
      +++ Running SessionClient with username=java, password=echoman, example=@example@
      Created LoginContext
      Login failed
      javax.security.auth.login.LoginException: javax.naming.NameNotFoundException: DefaultDS not bound
      at org.jboss.security.auth.spi.DatabaseServerLoginModule.getUsersPassword(DatabaseServerLoginModule.java:105)
      at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(UsernamePasswordLoginModule.java:103)
      at java.lang.reflect.Method.invoke(Native Method)
      at javax.security.auth.login.LoginContext.invoke(LoginContext.java:595)
      at javax.security.auth.login.LoginContext.access$000(LoginContext.java:125)
      at javax.security.auth.login.LoginContext$3.run(LoginContext.java:531)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:528)
      at javax.security.auth.login.LoginContext.login(LoginContext.java:449)
      at org.jboss.docs.jaas.howto.SessionClient.main(SessionClient.java:66)


      But during the startup I get the following Message that DefaultDS is up.
      [DefaultDS] XA Connection pool DefaultDS bound to java:/DefaultDS


      Any Ideas ????

        • 1. Re: Can't use DatabaseServerLoginModule .....
          Scott Stark Master

          You have to run the example using ant as follows:

          1. Run ant to create the ears and configure the server:
          jaas 526>ant
          Buildfile: build.xml
          ...

          2. Start the server using run_with_tomcat.[bat|sh]

          3. Run ant to build the security database
          jaas 527>ant buildDB
          Buildfile: build.xml

          ...

          buildDB:
          [java] Created Principals table, result=false
          [java] INSERT INTO Principals VALUES ('scott', 'echoman'), result=false
          [java] INSERT INTO Principals VALUES ('stark', 'javaman'), result=false
          [java] Created Roles table, result=false
          [java] INSERT INTO Roles VALUES ('scott', 'Echo', 'Roles'), result=false
          [java] INSERT INTO Roles VALUES ('scott', 'caller_scott', 'CallerPrincipal'
          ), result=false
          [java] INSERT INTO Roles VALUES ('stark', 'Java', 'Roles'), result=false
          [java] INSERT INTO Roles VALUES ('stark', 'Coder', 'Roles'), result=false
          [java] INSERT INTO Roles VALUES ('stark', 'caller_stark', 'CallerPrincipal'
          ), result=false

          4. Use ant to run example 2:
          jaas 531>ant example2-test
          Buildfile: build.xml

          example2-test:

          ...

          compile:

          client-test0:
          [java] +++ Running SessionClient with username=scott, password=echoman, example=example2
          [java] Created LoginContext
          [java] Found StatelessSessionHome
          [java] Created StatelessSession
          [java] Bean.echo('Hello') -> Hello
          [java] Found StatefulSessionHome
          [java] Created StatefulSession
          [java] Bean.noop() called
          [java] Bean.echo('Hello') -> Hello
          ...