Getting error message: “coldfusion/runtime/UDFMethod” and Type: “java.lang.NoClassDefFoundError”

Hi Sir,

Recently we converted Coldfusion to Lucee server, we have once of the CFC file call securityOrder.cfc which is in Java byte code. While creating an object for the securityOrder.cfc as below we are getting an error as below.
Can you please suggest me where I do missed configuration or java settings.

<cfset myEncryption = createObject(“component”, “securityOrder”) />
<cfset myEncryption = createObject(“component”, “securityOrder”).init() />
<cfset myEncryption = createObject(“component”, “securityOrder”).init(requiresJavaLoader=true) />

All above methods did not worked.

lucee.runtime.exp.NativeException: coldfusion/runtime/UDFMethod at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(Unknown Source) at java.base/java.lang.ClassLoader.defineClass(Unknown Source) at lucee.commons.lang.PhysicalClassLoader._loadClass(PhysicalClassLoader.java:201) at lucee.commons.lang.PhysicalClassLoader.loadClass(PhysicalClassLoader.java:182) at lucee.runtime.MappingImpl.getPhysicalClass(MappingImpl.java:276) at lucee.runtime.PageSourceImpl.loadPhysical(PageSourceImpl.java:368) at lucee.runtime.PageSourceImpl.loadPageThrowTemplateException(PageSourceImpl.java:237) at lucee.runtime.PageSourceImpl.loadPage(PageSourceImpl.java:1013) at lucee.runtime.component.ComponentLoader._search(ComponentLoader.java:219) at lucee.runtime.component.ComponentLoader._search(ComponentLoader.java:117) at lucee.runtime.component.ComponentLoader.searchComponent(ComponentLoader.java:79) at lucee.runtime.PageContextImpl.loadComponent(PageContextImpl.java:3247) at lucee.runtime.functions.other.CreateObject.doComponent(CreateObject.java:148) at lucee.runtime.functions.other.CreateObject.call(CreateObject.java:70) at lucee.runtime.functions.other.CreateObject.call(CreateObject.java:49) at cfc.member_cfc$cf.udfCall3(/cfc/Member.cfc:1410) at cfc.member_cfc$cf.udfCall(/cfc/Member.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:684) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:572) at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1911) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:787) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1747) at html.loggedin_cfm$cf.call(/html/loggedin.cfm:181) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1034) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:926) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:217) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:44) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2460) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2450) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2421) at lucee.runtime.engine.Request.exe(Request.java:45) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1179) at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1125) at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97) at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51) at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357) at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:433) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.lang.NoClassDefFoundError: coldfusion/runtime/UDFMethod … 61 more Caused by: java.lang.ClassNotFoundException: Class [coldfusion.runtime.UDFMethod] is invalid or doesn’t exist at lucee.commons.lang.PhysicalClassLoader.findClass(PhysicalClassLoader.java:161) at lucee.commons.lang.PhysicalClassLoader.loadClass(PhysicalClassLoader.java:142) at lucee.commons.lang.PhysicalClassLoader.loadClass(PhysicalClassLoader.java:125) at lucee.commons.lang.PhysicalClassLoader.loadClass(PhysicalClassLoader.java:119) … 61 more Caused by: java.nio.file.NoSuchFileException: C:\inetpub\iravi\WEB-INF\lucee\cfclasses\CFC__inetpub_iravi_com3428\coldfusion\runtime\UDFMethod.class at java.base/sun.nio.fs.WindowsException.translateToIOException(Unknown Source) at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source) at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source) at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(Unknown Source) at java.base/java.nio.file.Files.newByteChannel(Unknown Source) at java.base/java.nio.file.Files.newByteChannel(Unknown Source) at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(Unknown Source) at java.base/java.nio.file.Files.newInputStream(Unknown Source) at lucee.commons.io.res.type.file.FileResource.getInputStream(FileResource.java:243) at lucee.commons.io.IOUtil.copy(IOUtil.java:190) at lucee.commons.lang.PhysicalClassLoader.findClass(PhysicalClassLoader.java:157) … 64 more

Mohan, when you say you want to “call securityOrder.cfc which is in Java byte code”, do you mean that when you open the cfc in an editor, it’s binary? If so, can you confirm how you know it’s Java byte code? Or was that just a guess, perhaps?

I ask because you say you’re moving from ColdFusion to Lucee, and in ACF there were at least two ways to convert a cfml template into binary code, with features it offers.

One is a tool called cfencode (which used to be called cfencrypt), whose job is to pretty much merely to obfuscate the code. (There were tools that could reverse the encoding, and that’s when it was renamed cf encode so as not to imply it was somehow encrypting.)

The other is cfcompile, which does indeed literally render the byte code for the cfml, which both obfuscates the code and saves the compilation step that happens automatically (for what that’s worth). This binary could be decompiled, but the result if the Java source that acf turns the cfml into, rather than the cfml itself.

And with either, the point is that one could then deploy these in place of the original cfml files (which you’d need to retain), whether you’d put these binary variants on your cf server (for some reason) or to distribute perhaps to customers who might run them on their own machine–which would still require that they run ACF: this does not make a standalone Java app, to be clear.

And as far as I know, lucee cannot process these binary variants that one might create with ACF. In that case, I sure hope you have the cfml source of the cfc’s that you’re trying to run.

Let us know what you think.

And I may well be misinterpreting things or have something wrong. I’m just sharing my perspective based on what you said and what I’ve seen/come to know. And since some of these things are things rarely discussed anymore, I elaborate a bit to help those for whom they are new or little considered. :slight_smile:

Hi carehart,

My SecurityOrder.cfc is starts with code as below and I am not sure from these file is decoded.

cafe babe 0003 002d 00c3 0100 0a53 6f75

And As per error its reading a CFC file but there is an error call UDFMethod.class is undefined

I’ll have to let others assess what those lines tell us, but if it is byte code and so a cfc that’s been cfcompile’d, I’m pretty sure you’ll need the original cfc source. Do you have it?

The Java code created via ACF’s cfcompile would be java code designed to run with ACF only, relying on Java libraries and objects included in ACF. Again, if did not create some sort of Java code that could “run anywhere”, because of those library dependencies.

@Mohan_Raju I have moved this post to a new thread. Please don’t “piggy back” your questions onto an unrelated existing thread. Also, I deleted your duplicate thread. Please don’t cross post the same question twice.


As to your question - Charlie basically gave you the answer but perhaps you didn’t see it. You can’t use a compiled .cf template from an Adobe server in a Lucee server. it simply won’t work. Lucee can not and will not execute compiled Adobe ColdFusion code. You need to procure the original SecurityOrder.cfc that is not compiled.

Thanks Brad & Charlie for making this Post in right way.

I will make it a note of it compiled .cfc template from an Adobe server in a Lucee server wont work and I will try to get original CFC source file and test it.

Thanks a lot again!

1 Like