- try {
- getLoginContext().login();
- subject = getLoginContext().getSubject();
- } catch (Exception e) {
- throw new RuntimeException("Cannot retrieve subject", e);
- }
+ if (subject == null)
+ try {
+ getLoginContext().login();
+ subject = getLoginContext().getSubject();
+ } catch (Exception e) {
+ throw new ArgeoException("Cannot retrieve subject", e);
+ }