-
FEATURED COMPONENTS
First time here? Check out the FAQ!
We are facing strange issue in application intermittently.
ZK and Spring Version
ZK 6.01 framework
Spring 2.5
zkspring3.0
MVVM model
We have user management functionality. UserVM is value model class associated with window.
<window border="normal"
id="userManagementWnd" height="800px"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init(userVm)"
validationMessages="@id('vmsgs')" >
We have defined below method in UserVM class.
private UserDetails getUser() {
log.info("Calling getUser() - Get authentication object from sercurity context");
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
if (auth != null ) {
ZapScopeUserContext userCtx = (ZapScopeUserContext)auth.getPrincipal();
log.info("User context object - " + userCtx);
return userCtx;
} else {
log.info("Authentication object is NULL.");
return null;
}
}
We are getting null value for authentication object after some time.
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
When we restart tomcat then issue is resolved it works for some time and then issue starts happening again.
We also see below exceptions in logs but not sure whether that's related to this particular issue.
SEVERE: Failed to invoke org.zkoss.bind.tracker.impl.BindUiLifeCycle@5560c7a8
java.lang.IllegalStateException: UI can't be modified in the rendering phase
at org.zkoss.zk.ui.impl.UiVisualizer.getAttrRespMap(UiVisualizer.java:299)
at org.zkoss.zk.ui.impl.UiVisualizer.addSmartUpdate0(UiVisualizer.java:254)
at org.zkoss.zk.ui.impl.UiVisualizer.addSmartUpdate(UiVisualizer.java:238)
I think this might help: http://forum.springsource.org/showthread.php?57988-getAuthentication()-is-null
Asked: 2012-05-21 19:52:01 +0800
Seen: 335 times
Last updated: May 29 '12