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( at lucee.commons.lang.PhysicalClassLoader.loadClass( at lucee.runtime.MappingImpl.getPhysicalClass( at lucee.runtime.PageSourceImpl.loadPhysical( at lucee.runtime.PageSourceImpl.loadPageThrowTemplateException( at lucee.runtime.PageSourceImpl.loadPage( at lucee.runtime.component.ComponentLoader._search( at lucee.runtime.component.ComponentLoader._search( at lucee.runtime.component.ComponentLoader.searchComponent( at lucee.runtime.PageContextImpl.loadComponent( at lucee.runtime.functions.other.CreateObject.doComponent( at at 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( at lucee.runtime.type.UDFImpl._call( at at lucee.runtime.ComponentImpl._call( at lucee.runtime.ComponentImpl._call( at at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues( at lucee.runtime.PageContextImpl.getFunction( at html.loggedin_cfm$ at lucee.runtime.PageContextImpl._doInclude( at lucee.runtime.PageContextImpl._doInclude( at lucee.runtime.listener.ModernAppListener._onRequest( at lucee.runtime.listener.MixedAppListener.onRequest( at lucee.runtime.PageContextImpl.execute( at lucee.runtime.PageContextImpl._execute( at lucee.runtime.PageContextImpl.executeCFML( at lucee.runtime.engine.Request.exe( at lucee.runtime.engine.CFMLEngineImpl._service( at lucee.runtime.engine.CFMLEngineImpl.serviceCFML( at lucee.loader.engine.CFMLEngineWrapper.serviceCFML( at lucee.loader.servlet.CFMLServlet.service( at javax.servlet.http.HttpServlet.service( at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( at org.apache.catalina.core.ApplicationFilterChain.doFilter( at org.apache.tomcat.websocket.server.WsFilter.doFilter( at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( at org.apache.catalina.core.ApplicationFilterChain.doFilter( at org.apache.catalina.core.StandardWrapperValve.invoke( at org.apache.catalina.core.StandardContextValve.invoke( at org.apache.catalina.authenticator.AuthenticatorBase.invoke( at org.apache.catalina.core.StandardHostValve.invoke( at org.apache.catalina.valves.ErrorReportValve.invoke( at org.apache.catalina.core.StandardEngineValve.invoke( at org.apache.catalina.connector.CoyoteAdapter.service( at org.apache.coyote.ajp.AjpProcessor.service( at org.apache.coyote.AbstractProcessorLight.process( at org.apache.coyote.AbstractProtocol$ConnectionHandler.process( at$SocketProcessor.doRun( at at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$ Source) at org.apache.tomcat.util.threads.TaskThread$ at java.base/ 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( at lucee.commons.lang.PhysicalClassLoader.loadClass( at lucee.commons.lang.PhysicalClassLoader.loadClass( at lucee.commons.lang.PhysicalClassLoader.loadClass( … 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 at at lucee.commons.lang.PhysicalClassLoader.findClass( … 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