title: How to get the logged user in JAVA with WEBLOGIC?
body: <p>I found a code, which should reach the logged user:</p>
  
  <pre><code>InitialContext ic = new InitialContext();
  SessionContext sessionContext = (SessionContext)ic.lookup("java:comp/EJBContext");
  System.out.println("look up injected sctx: " + sessionContext); 
  Principal p = sessionContext.getCallerPrincipal();
  System.out.println(p.getName());
  </code></pre>
  
  <p>But it still gives me <code>&lt;anonymus&gt;</code>. Why is that? How could I reach the logged user's name?</p>