securityContext not available in scheduled function

I’m invoking a function via a timer

invoke searchTags() every 2 minutes

which eventually calls

extend function addToTags(tag : Tag) {
  if(loggedIn()) {
  this.modified("Added tag '[[tag(" + tag.key + ")|" + + "]]'.");

This leads to a run-time null pointer exception in the statement

SecurityContext securityContext = (SecurityContext)env.getVariable("securityContext");

of the implementation of addToTags:

public void addToTags_(org.hibernate.Session hibSession, Environment env, org.researchr.www.domain.Tag Publication_value57, PrintWriter out)
    SecurityContext securityContext = (SecurityContext)env.getVariable("securityContext");
    if(GlobalFunctions.loggedIn_(hibSession, env, out))
      GlobalFunctions.updateCredit__CostPolicy_(hibSession, env, ((org.researchr.www.domain.CostSheet)env.getVariable("cost")).setupForPropertyEvents(hibSession, out).getAddTagToPublication(), out);
Submitted by Eelco Visser on 13 March 2010 at 16:22

On 15 March 2010 at 10:56 Zef Hemel commented:

Fixed in r3726, all session variables are now initialized to empty objects.

Log in to post comments