1 Reply Latest reply on Jan 26, 2004 6:59 PM by gary_kephart

    Has anyone made jaas how to example work under JBoss 3.0.0 b

    jackxu

      I'm using the jaas how to example from javaworld http://www.javaworld.com/javaworld/jw-08-2001/jw-0831-jaas.html#resources

      It works fine under JBoss-2.4.0 and Tomcat-3.2.3 bundle but failed under JBoss 3.0.0beta and Tomcat-4.0.2 bundle. It compiled OK but when I run ant example1-test0, it first complained about can't find org/apache/log4j/Priority. I added
      <pathelement location="${jboss.dist}/client/log4j.jar"/> in the build.xml file, then it can't find class org.jboss.srp.jaas.SRPLoginModule. I went to file ${jboss.dist}/client/auth.conf and changed org.jboss.srp.jaas.SRPLoginModule to org.jboss.security.srp.jaas.SRPLoginModule. Next there's this SRPServerInterface not bound error. I checked JNDIViwer, couldn't find it bounded. I deleted this login module from file ${jboss.dist}/client/auth.conf and seems login is fine. But on the server side, the principal is not propagated, when calling ejb home create, there's this principal=null exception. Here's the server side exception:

      14:30:42,962 INFO [Server] JBoss (MX MicroKernel) [3.0.0beta Date:200202210220
      ] Started in 0m:25s:176ms
      14:30:51,464 INFO [Default] validatePassword, inputPassword=null, expectedPassw
      ord=null
      14:30:51,464 ERROR [SecurityInterceptor] Authentication exception, principal=nul
      l
      14:30:51,464 ERROR [JRMPInvoker] operation failed
      java.rmi.RemoteException: checkSecurityAssociation; nested exception is:
      java.lang.SecurityException: Authentication exception, principal=null
      java.lang.SecurityException: Authentication exception, principal=null
      at org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityAssociation(Se
      curityInterceptor.java:167)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityIntercep
      tor.java:91)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:1
      09)
      at org.jboss.ejb.StatelessSessionContainer.invokeHome(StatelessSessionCo
      ntainer.java:295)
      at org.jboss.ejb.Container.invoke(Container.java:682)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
      55)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
      23)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:
      364)
      at java.lang.reflect.Method.invoke(Native Method)
      at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
      at sun.rmi.transport.Transport$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Unknown Source)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Sour
      ce)
      at java.lang.Thread.run(Unknown Source)
      14:30:51,724 INFO [Default] validatePassword, inputPassword=null, expectedPassw
      ord=null
      14:30:51,724 ERROR [SecurityInterceptor] Authentication exception, principal=nul
      l
      14:30:51,724 ERROR [JRMPInvoker] operation failed
      java.rmi.ServerException: checkSecurityAssociation; nested exception is:
      java.lang.SecurityException: Authentication exception, principal=null; n
      ested exception is:
      java.rmi.RemoteException: checkSecurityAssociation; nested exception is:

      java.lang.SecurityException: Authentication exception, principal=null
      java.rmi.RemoteException: checkSecurityAssociation; nested exception is:
      java.lang.SecurityException: Authentication exception, principal=null
      java.lang.SecurityException: Authentication exception, principal=null
      at org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityAssociation(Se
      curityInterceptor.java:167)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityIntercep
      tor.java:91)
      at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invokeHome(S
      tatefulSessionInstanceInterceptor.java:128)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
      rceptor.java:98)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
      torCMT.java:167)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.ja
      va:52)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:1
      09)
      at org.jboss.ejb.StatefulSessionContainer.invokeHome(StatefulSessionCont
      ainer.java:361)
      at org.jboss.ejb.Container.invoke(Container.java:682)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
      55)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
      23)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:
      364)
      at java.lang.reflect.Method.invoke(Native Method)
      at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
      at sun.rmi.transport.Transport$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Unknown Source)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Sour
      ce)
      at java.lang.Thread.run(Unknown Source)


      The clinet side error is:

      C:\test\javaworld-jaas>ant example1-test0
      Buildfile: build.xml

      example1-test0:

      validate:

      fail_if_not_valid:

      init:
      [echo] Using jboss.dist=C:\jboss\JBoss-3.0.0beta
      [echo] Using classpath=C:\jboss\jboss-3.0.0beta\client\jboss-j2ee.jar;C:\jb
      oss\jboss-3.0.0beta\client\jaas.jar;C:\jboss\jboss-3.0.0beta\client\jbosssx-clie
      nt.jar;C:\jboss\jboss-3.0.0beta\client\jboss-client.jar;C:\jboss\jboss-3.0.0beta
      \client\jnp-client.jar;C:\jboss\jboss-3.0.0beta\client\log4j.jar;C:\jboss\jboss-
      3.0.0beta\lib\ext\javax.servlet.jar;C:\test\javaworld-jaas\build\classes

      compile:

      client-test0:
      [java] +++ Running SessionClient with username=java, password=echoman, exam
      ple=example1
      [java] Created LoginContext
      [java] Found PublicSession home
      [java] java.rmi.ServerException: RemoteException occurred in server thread;
      nested exception is:
      [java] java.rmi.RemoteException: checkSecurityAssociation; nested excep
      tion is:
      [java] java.lang.SecurityException: Authentication exception, principal
      =null
      [java] java.rmi.RemoteException: checkSecurityAssociation; nested exception
      is:
      [java] java.lang.SecurityException: Authentication exception, principal
      =null
      [java] java.lang.SecurityException: Authentication exception, principal=nul
      l
      [java] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServe
      r(StreamRemoteCall.java:245)
      [java] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCa
      ll.java:220)
      [java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
      [java] at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unkn
      own Source)
      [java] at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(
      JRMPInvokerProxy.java:174)
      [java] at org.jboss.proxy.ejb.GenericProxy.invoke(GenericProxy.java:182
      )
      [java] at org.jboss.proxy.ejb.HomeProxy.invoke(HomeProxy.java:192)
      [java] at $Proxy0.create(Unknown Source)
      [java] at org.jboss.docs.jaas.howto.SessionClient.main(SessionClient.ja
      va:79)
      [java] Found PrivateSession home
      [java] Failed to create PrivateSession as expected

      BUILD SUCCESSFUL

      Looking at the client side printout, it seems the user is authenticated ok but the principal is not propagated to the server side when calling ejb home create.

      I'm totally stuck, could someone help me please ? Is this a bug in JBoss 3 ?

      Thanks in advance