Cffile action copy broken in Lucee 5.3.4.77

another day another bug!

when doing a file copy i.e.
<cffile action="copy" source="#sVars.cSrcFile#" destination="#sVars.cDirectory#/#sVars.cDstFileName#" />

we get the exception :

Lucee 5.3.4.77 Error (java.lang.NoClassDefFoundError)
Message Could not initialize class sun.nio.fs.UnixCopyFile
Stacktrace The Error Occurred in /mq_cluster/data/mailquatro/live/www_dev/mq/cfc/AttachmentHandler.cfc: line 837

835: <!--- <cfset sVars.cDstFileName = listLast(sVars.arrAttachedFiles[sVars.iFilePos].cAttachmentFile, "/") /> --->
836: </cfif>
837: <cffile action="copy" source="#sVars.cSrcFile#" destination="#sVars.cDirectory#/#sVars.cDstFileName#" />
838:
839: <cfset sVars.lcFiles = listAppend(sVars.lcFiles, sVars.cDirectory & "/" & sVars.cDstFileName, "|") />

I see a pattern developing. whenever a class uses sun.* there is a casting issue

Is there a war going on between openJDK and oracle? this is the third bug which I thought was unrelated
see https://lucee.daemonite.io/t/isimagefile-broken-in-5-3-4-77/6647/6 and https://lucee.daemonite.io/t/5-3-5-80-snapshot-email-problem/6648

how did this all start? the os (arch linux) had an update for openJDK 8 probably around end of January
Jan 26 12:13 jre8-openjdk-8.u242-1-x86_64.pkg.tar.zst

this caused tomcat to fail to start and as far as I remember it was an obscure error class not found, so I checked the lucee downloads, lo and behold there was a new release. Since packaging the new release its been a nightmare of support.
Often the server stops responding and needs a tomcat restart, sometimes that does not help and the web-inf/ROOT needs to be deleted

All about our stack!

OS : arch linux 5.5.4-arch1-1
Java Version : openJDK 1.8.0_242
Tomcat Version : 8.5.51
Lucee Version : 5.3.4.77

this works fine with openJDK 8.u232-1

@mailme_gx, Yes java 8u242 has some issues. That’s why lot issue comes from java 8u242

Does not work with openjdk 11.0.7 2020-04-14 LTS and Lucee 5.3.7.43 or .47

Hi Kiwibloke, i tried this on my current dev box and it works

<cffile action="copy" source="#expandPath('/temp/dump.json')#" destination="#expandPath('/temp/dump2.json')#" />

java 11.0.8
lucee 5.3.7.47
tomcat 9.0.11

hope this helps

Hi mailme_gx,

I have tried the following:

on:
java 11.0.7
lucee 5.3.7.47
tomcat 9.0.20.0

and it does not work. Still get error:
error: Could not initialize class sun.nio.fs.UnixCopyFile

Were you using jdk or openjdk for your java version 11.0.7?

How to update to specific version of java?

Thanks

can you post the rest of the java stacktrace?

Hi Kiwibloke,

I am using openjdk, it is installed as a system package via the operating system package manager (running arch linux)

usually when I come across a bug like this I try to use pure java alternatives in place of cfml so I am no longer using the cffile action=“copy” in the code anymore

GX