Skip to main content
Participant
Dec 2, 2016 8:53 PM UTC
Question

empty onSessionEnd creating NullPointerExceptions?

Some background: we recently upgraded from CF 10 to CF 2016, and moved to a new server (Windows Server 2012 R2, IIS 8).  All updates are installed for all of the above (cf version 2016.0.03.300466 and jvm version: 25.72-b15).

Here's the issue:  In my Application.cfc I've got a completely empty onSessionEnd.

<cffunction name="onSessionEnd" returnType="void">

    <cfargument name="SessionScope" required="true" />

    <cfargument name="ApplicationScope" required="false" />

</cffunction>

I've got onError is currently set up to send me an email. 

I am periodically getting this:

arguments - struct

EVENTNAME onSessionEnd
EXCEPTION
arguments - struct
Cause
arguments - struct
Message [empty string]
StackTrace java.lang.NullPointerException at coldfusion.runtime.NeoJspWriter.writeOutput(NeoJspWriter.java:228) at coldfusion.runtime.NeoJspWriter.flush(NeoJspWriter.java:362) at coldfusion.cfc.CFCProxy.flush(CFCProxy.java:357) at coldfusion.cfc.CFCProxy.doInvoke(CFCProxy.java:332) at coldfusion.cfc.CFCProxy.invoke(CFCProxy.java:302) at coldfusion.runtime.AppEventInvoker.onSessionEnd(AppEventInvoker.java:462) at coldfusion.runtime.SessionTracker.invokeOnSessinEnd(SessionTracker.java:291) at coldfusion.runtime.SessionTracker.cleanUp(SessionTracker.java:274) at coldfusion.runtime.SessionTracker.access$000(SessionTracker.java:43) at coldfusion.runtime.SessionTracker$SessionCleanUpAgent.run(SessionTracker.java:483) at coldfusion.scheduling.ThreadPool.run(ThreadPool.java:260) at coldfusion.scheduling.WorkerThread.run(WorkerThread.java:71)
Suppressed
arguments - array [empty]
TagContext
arguments - array [empty]
Type java.lang.NullPointerException
Detail An exception occurred while invoking an event handler method from Application.cfc. The method name is: onSessionEnd.
Message Event handler exception.

I'm basically at a loss as to how it's generating a nullPointerException (which, to my understanding, can sometimes be basically a variable undefined error when encountered in onSessionEnd or onApplicationEnd which aren't handled well by onError, but as there's literally nothing in it, that's not relevant).

So I dug into the logs.

Exception log:

"Error","scheduler-2","12/02/16","15:13:59","","'' The specific sequence of files included or processed is: '''' "

java.lang.NullPointerException

    at coldfusion.runtime.NeoJspWriter.writeOutput(NeoJspWriter.java:228)

    at coldfusion.runtime.NeoJspWriter.flush(NeoJspWriter.java:362)

    at coldfusion.cfc.CFCProxy.flush(CFCProxy.java:357)

    at coldfusion.cfc.CFCProxy.doInvoke(CFCProxy.java:332)

    at coldfusion.cfc.CFCProxy.invoke(CFCProxy.java:302)

    at coldfusion.runtime.AppEventInvoker.onSessionEnd(AppEventInvoker.java:462)

    at coldfusion.runtime.SessionTracker.invokeOnSessinEnd(SessionTracker.java:291)

    at coldfusion.runtime.SessionTracker.cleanUp(SessionTracker.java:274)

    at coldfusion.runtime.SessionTracker.access$000(SessionTracker.java:43)

    at coldfusion.runtime.SessionTracker$SessionCleanUpAgent.run(SessionTracker.java:483)

    at coldfusion.scheduling.ThreadPool.run(ThreadPool.java:260)

    at coldfusion.scheduling.WorkerThread.run(WorkerThread.java:71)

application log:

"Error","scheduler-2","12/02/16","15:13:59","","'' The specific sequence of files included or processed is: '''' "

coldfusion-out log:

Dec 2, 2016 15:13:59 PM Error [scheduler-2] - '' The specific sequence of files included or processed is: ''''

Other notes: I am using J2EE session variables, and SESSSION management is enabled for the app.

My question(s): what weird thing is this scheduler thread doing, why would it be encountering a null pointer exception in onsessionend, and how would one go about stopping it from occurring again?

This topic is closed to new replies. Start a new post to keep the conversation going.

14 replies

Participating Frequently
Aug 5, 2017 12:17 AM UTC

Hi Bruce --

Did you ever work out a fix for this?

We are having this identical problem.   We just went from CF9 to CF2016 and have been seeing these appear in our app.log once or twice a day:

"Error","scheduler-2","08/04/17","17:51:21","","'' The specific sequence of files included or processed is: '''' "

"Error","scheduler-2","08/04/17","17:51:21","","'' The specific sequence of files included or processed is: '''' "

"Error","scheduler-2","08/04/17","17:51:21","","'' The specific sequence of files included or processed is: '''' "

There were 38 lines of this just a few minutes ago.

Each one corresponds to an exception.log error:

"Error","scheduler-2","08/04/17","17:51:21","","'' The specific sequence of files included or processed is: '''' "

java.lang.NullPointerException

        at coldfusion.runtime.NeoJspWriter.writeOutput(NeoJspWriter.java:228)

        at coldfusion.runtime.NeoJspWriter.flush(NeoJspWriter.java:362)

        at coldfusion.cfc.CFCProxy.flush(CFCProxy.java:357)

        at coldfusion.cfc.CFCProxy.doInvoke(CFCProxy.java:332)

        at coldfusion.cfc.CFCProxy.invoke(CFCProxy.java:302)

        at coldfusion.runtime.AppEventInvoker.onSessionEnd(AppEventInvoker.java:462)

        at coldfusion.runtime.SessionTracker.invokeOnSessinEnd(SessionTracker.java:292)

        at coldfusion.runtime.SessionTracker.cleanUp(SessionTracker.java:275)

        at coldfusion.runtime.SessionTracker.access$000(SessionTracker.java:43)

        at coldfusion.runtime.SessionTracker$SessionCleanUpAgent.run(SessionTracker.java:484)

        at coldfusion.scheduling.ThreadPool.run(ThreadPool.java:260)

        at coldfusion.scheduling.WorkerThread.run(WorkerThread.java:71)

This looks like your same problem.   Did you ever find a way to stop the exceptions from occurring?

Translate
BKBK
Community Expert
Community Expert
Aug 6, 2017 11:05 AM UTC

Chances are, there is a bug in ColdFusion 2016's session apparatus.

I have voted for your bug report, CF-4199420.

Translate
Legend
Dec 15, 2016 5:13 PM UTC

Just a guess but possibly the required="true" parameter in the cfargument tag.

Translate
BKBK
Community Expert
Community Expert
Dec 15, 2016 7:39 PM UTC

Steve Sommers wrote:

Just a guess but possibly the required="true" parameter in the cfargument tag.

I agree. The application could be debugged as follows

<cffunction name="onSessionEnd" returnType="void">

    <cfargument name="SessionScope" required="true" />

    <cfargument name="ApplicationScope" required="true" />

<cftry>

    <cflog file="#this.Name#" type="Information" text="The session #arguments.SessionScope.sessionid# has ended">

<cfcatch type="Any">

    <cflog file="errorInOnSessionEnd" type="error" text="cfcatch.message=#cfcatch.message#">

</cfcatch>

</cftry>

</cffunction>

Translate
Legend
Dec 16, 2016 8:24 PM UTC

Maybe try:

<cffunction name="onSessionEnd" returnType="void">

    <cfargument name="SessionScope" required="false" />

    <cfargument name="ApplicationScope" required="false" />

<cftry>

<cfif structKeyExists(arguments,"SessionScope")>

    <cflog file="#this.Name#" type="Information" text="The session #arguments.SessionScope.sessionid# has ended" />

<cfelse>

    <cflog file="#this.Name#" type="Information" text="Unprovided session has ended" />

<cfelse>

</cfif>

<cfcatch type="Any">

    <cflog file="errorInOnSessionEnd" type="error" text="cfcatch.message=#cfcatch.message#" />

</cfcatch>

</cftry>

</cffunction>

Translate
BKBK
Community Expert
Community Expert
Dec 6, 2016 6:28 AM UTC

Weird indeed. The only cause I can think of is a NULL session. Which implies no session might have been created in the first place or that an error resulted during the creation of the session.

Could you show us how you enable sessions? Also, what are your JVM parameters? Does your Coldfusion installation share JVM resources with an external application, such as FusionReactor?

Translate
Participant
Dec 15, 2016 2:38 PM UTC

We are having the same problem, although we don't have an empty OnSessionEnd function. I'm curious about why you're asking about sharing resources with FusionReactor, what affects might that have?

Edit: @bruceb19075631​ does it happen for you every time or sporadically?

Translate
Participant
Dec 15, 2016 7:04 PM UTC

The problem started with a normal, full of stuff onsessionend. 

We slowly pared it down until it was completely empty and the problem still persisted/persists.

Originally I believed it was happening at the end of every session, but we eventually figured out that the error doesn't happen on normal session endings.  Only when these weird scheduler things happen.

Translate