Lucee without java agent: get missing include errors for tmp files used in AOP


This error occurs when a temporary file is written down within a particular mapping (e.g. /coldbox), used to read in some dynamic source code and then deleted. All is well until another template within the same mapping is recompiled. Without the java agent in use, this forces a .clear() on all the pageSource objects within the mapping and when Lucee goes to re-read the tmp file, it can't find it.

Not using the java agent is a required workaround to LDEV-638.

Example stack trace snippet that shows the .clear() of a sourceFile

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 at lucee.runtime.PageSourceImpl.clear( <<<<<< this is the point at which the compiled tmp file source is being cleared at lucee.runtime.PageSourcePool.clearPages( at lucee.runtime.MappingImpl.clearPages( at lucee.commons.lang.PCLCollection.loadClass( at lucee.runtime.PageSourceImpl._compile( at lucee.runtime.PageSourceImpl.compile( at lucee.runtime.PageSourceImpl.loadPhysical( at lucee.runtime.PageSourceImpl.loadPage( at lucee.runtime.PageSourceImpl.loadPage( at lucee.runtime.PageContextImpl.doInclude( at lucee.runtime.PageContextImpl.doInclude( at$cf.udfCall(/coldbox/system/web/services/ExceptionService.cfc:114) at lucee.runtime.type.UDFImpl.implementation( at lucee.runtime.type.UDFImpl._call( at at lucee.runtime.ComponentImpl._call(

In the stacktrace above, "Inspect templates" is set to "Once", so when /coldbox/system/web/services/ExceptionService.cfc:114 does a cfinclude on a template file, Lucee recompiles it clears all the other saved PageSourceImpl objects under the same /coldbox mapping.


Create a mapping that is only used by the AOP mixing system's temp files. This way, no other recompiles will mess with tmp file mappings.

For coldbox / wirebox, do something like:

1 2 3 4 5 6 7 8 // Application.cfc DirectoryCreate( "ram://aoptmp", false, true ); this.mappings[ "/aoptmp" ] = "ram://aoptmp"; ... // Wirebox.cfc wirebox.listeners = [ { class="coldbox.system.aop.Mixer",properties={ generationPath="/aoptmp" } } ];





Michael Offner


Dominic Watson



Fix versions