Hi,
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: 5.3.8.189
Used to work fine in our last images which were 5.3.7.48
running on Tomcat/9.0.44
Jedi
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(PageContextImpl.java:1027)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:923)
at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:904)
at thread.index_cfm$cf$6.threadCall(/thread/index.cfm:10)
at lucee.runtime.thread.ChildThreadImpl.execute(ChildThreadImpl.java:203)
at lucee.runtime.thread.ChildThreadImpl.run(ChildThreadImpl.java:145)
Caused by: java.lang.NullPointerException
... 6 more
TagContext Array
1 Struct
codePrintHTML string 8: thread action="run" name="threadTest" {<br>
9: try {<br>
<b>10: include "inc.cfm";</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
</div>
<!-- ==stop== dump -->
1 Like