Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-1992

Calling SessionContext.getCallerPrincipal returns wrong value on first call from testcase

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 4.5.1
    • None
    • tests
    • None

    Description

      I reduced a problem encountered during testing of our application to the following testcase. There is a stateless bean with a method that returns the caller principal, obtained from the injected SessionContext. A testcase creates an EJBContainer and calls the bean method two times. The first time the method returns the default username "guest", on the second time the configured username of "test" is returned.

      Attachments

        1. CallerPrincipalServiceBean.java
          0.5 kB
          Jörn Horstmann
        2. CallerPrincipalTest.java
          2 kB
          Jörn Horstmann
        3. login.config
          0.2 kB
          Jörn Horstmann
        4. groups.properties
          0.1 kB
          Jörn Horstmann
        5. users.properties
          0.1 kB
          Jörn Horstmann
        6. beans.xml
          0.3 kB
          Jörn Horstmann
        7. ejb-jar.xml
          0.4 kB
          Jörn Horstmann
        8. pom.xml
          2 kB
          Jörn Horstmann
        9. jndi.properties
          1 kB
          Jörn Horstmann
        10. CallerPrincipalWithApplicationComposerTest.java
          1 kB
          Jörn Horstmann
        11. CallerPrincipalWithApplicationComposerTest.log
          32 kB
          Jörn Horstmann

        Activity

          People

            Unassigned Unassigned
            jhorstmann Jörn Horstmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: