UserSessionBean currentUser factory crashes with NPE when called from a non-JSF
context
---------------------------------------------------------------------------------------
Key: NXP-2261
URL: http://jira.nuxeo.org/browse/NXP-2261
Project: Nuxeo Enterprise Platform 5
Issue Type: Bug
Affects Versions: 5.1.4
Reporter: Olivier Grisel
Assignee: Alexandre Russel
Fix For: 5.1.5
FacesContext.getCurrentInstance() is null in :
@Factory(value = "currentUser", scope = SESSION)
public Principal getCurrentUser() throws Exception {
if (currentUser == null) {
ExternalContext context =
FacesContext.getCurrentInstance().getExternalContext();
currentUser = context.getUserPrincipal();
}
return currentUser;
}
UserSessionBean use to be a SFSB able it fetch the principal from the EJB
context when FacesContext.getCurrentInstance() is null.
The JSF context is null when using Seam enabled restlet used by the LiveEdit
client, for instance:
http://localhost:8080/nuxeo/restAPI/creationContainerList?docType=File
(CreationContainerListRestlet)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.nuxeo.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
ECM-tickets mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm-tickets