NPE on included files in a thread


Is anyone else getting NullPointerExceptions when including a file within a thread?

Proof of concept I have here Jedihomer Townend / thread-issue · GitLab

Very simple setup; include a file setting up a variable, then the top file outputs the value.

This works fine outside a thread but if you put it inside a thread we get a java.lang.NullPointerException

OS: Docker Tomcat Image
Java Version: 11.0.11
Tomcat Version: Apache Tomcat/9.0.48
Lucee Version:

Used to work fine in our last images which were running on Tomcat/9.0.44


do you have a java stacktrace?

Dumping the error gives

<!-- ==start== dump {ts '2021-07-09 14:55:25'} format: text -->
<div id="x5y" class="-lucee-dump">Catch
additional Struct (ordered)
Detail string
ErrorCode string 0
Extended_Info string
ExtendedInfo string
Message string java.lang.NullPointerException
StackTrace string lucee.runtime.exp.NativeException: java.lang.NullPointerException
	at lucee.runtime.PageContextImpl._doInclude(
	at lucee.runtime.PageContextImpl._doInclude(
	at lucee.runtime.PageContextImpl.doInclude(
	at thread.index_cfm$cf$6.threadCall(/thread/index.cfm:10)
	at lucee.runtime.thread.ChildThreadImpl.execute(
Caused by: java.lang.NullPointerException
	... 6 more
TagContext Array
1 Struct
codePrintHTML string 8: 	thread action=&quot;run&quot; name=&quot;threadTest&quot; {<br>
9: 		try {<br>
<b>10: 			include &quot;inc.cfm&quot;;</b><br>
11: 			echo(intVar);<br>
12: 		} catch (Any e) {<br>
codePrintPlain string 8: 	thread action="run" name="threadTest" {
9: 		try {
10: 			include "inc.cfm";
11: 			echo(intVar);
12: 		} catch (Any e) {
column number 0
id string ??
line number 10
Raw_Trace string thread.index_cfm$cf$6.threadCall(/thread/index.cfm:10)
template string /app/webroot/thread/index.cfm
type string cfml
type string java.lang.NullPointerException
<!-- ==stop== dump -->

1 Like