1 Reply Latest reply on Jun 24, 2004 9:26 PM by cbrettin

    Return Subject to EJB-client

    nort

      Hello,

      i have created an authentication-EJb which invoces different custom loginModules. After running all LMs a Subject will be created. This subject has to be returned to the EJB-client. But I get this exception on the client side:

      java.lang.reflect.UndeclaredThrowableException

      Is it not allowed to return the Subject?

      Tanks,
      Juraj

        • 1. Re: Return Subject to EJB-client
          cbrettin

          This exception probably indicates that the invocation handler for a proxy object threw an exception that it shouldn't have.

          A serialized Subject imcomplete as credentials are not serialized, only principals (and at a guess it is one of the principals that is causing your problem). Subjects aren't all that useful outside the VM that created them anyway, since both principals and credentials are usually of a very local nature.

          A more usual pattern is to login locally on the client, using login modules that interact with a seperate login system on the server - so you will have seperate but related Subjects on the client and server.

          Since you are obviously using a J2EE client is there any particular reason why you can't use one of the normal EE authentication patterns (there sould be tutorials online)?