6.2.6.9-SNAPSHOT intermittant Java class not found errors

We have code that makes use of the AWS SDK Java classes, and when we use the code with 6.2.6.9-SNAPSHOT we get intermittant errors with this stack.

It goes away if we roll back to 6.2.5-48. I notice it references class loaders, which have changed in this release.

I’ll try and make a minimal test case, but was wondering if anyone else has tried the recent snap shots (or could :slight_smile: ) and if you had did you have issues with loading Java classes ?

The “missing” class is present in a java class we’re loading via Application.cfc java settings:

$ unzip -t sdk-core-*.jar |grep sync/ResponseTransformer.class
    testing: software/amazon/awssdk/core/sync/ResponseTransformer.class   OK
$

lucee.runtime.exp.NativeException: software.amazon.awssdk.core.sync.ResponseTransformer at lucee.commons.lang.PhysicalClassLoader.loadClass(PhysicalClassLoader.java:287) at lucee.commons.lang.PhysicalClassLoader.loadClass(PhysicalClassLoader.java:218) at java.base/java.lang.Class.getDeclaredMethods0(Native Method) at java.base/java.lang.Class.privateGetDeclaredMethods(Unknown Source) at java.base/java.lang.Class.privateGetPublicMethods(Unknown Source) at java.base/java.lang.Class.getMethods(Unknown Source) at lucee.transformer.dynamic.meta.reflection.ClazzReflection.getMethods(ClazzReflection.java:136) at lucee.transformer.dynamic.meta.Clazz.getMethod(Clazz.java:93) at lucee.runtime.reflection.pairs.MethodInstance.invoke(MethodInstance.java:97) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:824) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:2081) at manager.s3_cfc$cf.udfCall(/resources/Manager/S3.cfc:45) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:224) at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:811) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:773) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:2081) at manager.s3_cfc$cf.udfCall(/resources/Manager/S3.cfc:26) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:224) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:738) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:611) at lucee.runtime.ComponentImpl.call(ComponentImpl.java:2123) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:773) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:2081) at upload_cfc$cf.udfCall(/resources/upload.cfc:23) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:214) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:739) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:611) at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:2137) at lucee.runtime.tag.Invoke.doComponent(Invoke.java:212) at lucee.runtime.tag.Invoke.doEndTag(Invoke.java:186) at taffy_3_6_0270.core.api_cfc$cf.udfCall2(/Taffy-3_6_0/core/api.cfc:370) at taffy_3_6_0270.core.api_cfc$cf.udfCall(/Taffy-3_6_0/core/api.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:224) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:738) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:611) at lucee.runtime.ComponentImpl.call(ComponentImpl.java:2123) at lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:479) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:214) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:43) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2816) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2803) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2774) at lucee.runtime.engine.Request.exe(Request.java:45) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1113) at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1070) at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97) at lucee.loader.servlet.jakarta.CFMLServlet.service(CFMLServlet.java:52) at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:710) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:128) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:107) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:165) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:77) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:113) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:83) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:72) at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:685) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:341) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:397) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:903) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1779) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:946) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:480) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:57) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: software.amazon.awssdk.core.sync.ResponseTransformer ... 76 more

Sounds like the first 6.2.6 commit, which got moved to that release to avoid another RC cycle

It must be the morning lack of caffine, but I can’t seem to get JavaSettings to work even in 6.2.5.48

With docker run --rm --network host -v/tmp/a:/var/www lucee/lucee:6.2.5.48-nginx and this saved as Application.cfc, an empty index.cfm and a copy of our apps java-libs folder, I get a NativeException of cannot load class through its string name, because no definition for the class with the specified name [software.amazon.awssdk.services.s3.S3Client] could be found; failed to load class with multiple classloaders, every cause in the stacktrace represents a classloader

Even though the directoryList shows all the .jar files are found, and the .class file is present if I unzip -t the s3 .jar inside the container.

Adding

writedump(getApplicationMetadata())
writedump(getApplicationSettings())

doesn’t even dump the correct name

What stupid mistake have I made ? Nobody here can spot it either !

component{
    this.name='test';

    this.javaSettings={
            loadPaths:['java-libs/aws/'],
            reloadOnChange:true
    };

    writeOutput( serializeJSON( directoryList('java-libs/aws') ) )

    createObject('java','software.amazon.awssdk.services.s3.S3Client')
}

this.javasettings in a normal cfc? it’s an attribute of json?

oh ignore me, it’s an application.cfc !

https://luceeserver.atlassian.net/browse/LDEV-6190

I’ve added a fix for the reported problem, 6.2.6.10-SNAPSHOT

will follow up tomorrow (still stuck in Melbourne till Sunday, it’s late here!), but that should resolve that error

1 Like

Oh, sweet, we’ll try that later in the week.

Problem seems fixed so far.

1 Like

Spoke too soon, we got NoClassDefFoundError again but for software/amazon/awssdk/services/s3/presigner/model/PresignedGetObjectRequest

With the stack trace below. Our code S3.cfc:66 is var presignedRequest = variables.s3presigner.presignGetObject(presignRequest);

Directly before hand is

var presignRequest = createObject('java','software.amazon.awssdk.services.s3.presigner.model.GetObjectPresignRequest').builder()
			.signatureDuration(createObject('java','java.time.Duration').ofMinutes( arguments.expiryMinutes ))
			.getObjectRequest(objectRequest.build())
			.build();

lucee.runtime.exp.NativeException: software/amazon/awssdk/services/s3/presigner/model/PresignedGetObjectRequest at java.base/java.lang.Class.getDeclaredMethods0(Native Method) at java.base/java.lang.Class.privateGetDeclaredMethods(Unknown Source) at java.base/java.lang.Class.privateGetPublicMethods(Unknown Source) at java.base/java.lang.Class.getMethods(Unknown Source) at lucee.transformer.dynamic.meta.reflection.ClazzReflection.getMethods(ClazzReflection.java:136) at lucee.transformer.dynamic.meta.Clazz.getMethod(Clazz.java:93) at lucee.runtime.reflection.pairs.MethodInstance.invoke(MethodInstance.java:97) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:824) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:2081) at manager.s3_cfc$cf.udfCall(/resources/Manager/S3.cfc:66) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:224) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:738) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:611) at lucee.runtime.ComponentImpl.call(ComponentImpl.java:2123) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:773) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:2081) at referral_detail_cfc405$cf.udfCall2(/resources/referral-detail.cfc:82) at referral_detail_cfc405$cf.udfCall(/resources/referral-detail.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:219) at lucee.runtime.type.EnvUDF.call(EnvUDF.java:137) at lucee.runtime.functions.closure.Map._inv(Map.java:334) at lucee.runtime.functions.closure.Map.invoke(Map.java:179) at lucee.runtime.functions.closure.Map._call(Map.java:100) at lucee.runtime.functions.closure.Map.call(Map.java:77) at lucee.runtime.functions.arrays.ArrayMap._call(ArrayMap.java:48) at lucee.runtime.functions.arrays.ArrayMap.call(ArrayMap.java:36) at lucee.runtime.functions.arrays.ArrayMap.invoke(ArrayMap.java:53) at lucee.runtime.interpreter.ref.func.BIFCall.getValue(BIFCall.java:141) at lucee.runtime.type.util.MemberUtil.call(MemberUtil.java:155) at lucee.runtime.type.util.ArraySupport.call(ArraySupport.java:322) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:773) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:2081) at referral_detail_cfc405$cf.udfCall2(/resources/referral-detail.cfc:93) at referral_detail_cfc405$cf.udfCall(/resources/referral-detail.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:224) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:738) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:611) at lucee.runtime.ComponentImpl.call(ComponentImpl.java:2123) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:773) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:2081) at referral_detail_shortcode_cfc1125$cf.udfCall(/resources/referral-detail-shortcode.cfc:41) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:214) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:739) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:611) at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:2137) at lucee.runtime.tag.Invoke.doComponent(Invoke.java:212) at lucee.runtime.tag.Invoke.doEndTag(Invoke.java:186) at taffy_3_6_0270.core.api_cfc$cf.udfCall2(/Taffy-3_6_0/core/api.cfc:370) at taffy_3_6_0270.core.api_cfc$cf.udfCall(/Taffy-3_6_0/core/api.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:224) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:738) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:611) at lucee.runtime.ComponentImpl.call(ComponentImpl.java:2123) at lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:479) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:214) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:43) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2816) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2803) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2774) at lucee.runtime.engine.Request.exe(Request.java:45) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1113) at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1070) at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97) at lucee.loader.servlet.jakarta.CFMLServlet.service(CFMLServlet.java:52) at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:710) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:128) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:107) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:165) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:77) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:113) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:83) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:72) at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:685) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:341) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:397) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:903) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1779) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:946) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:480) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:57) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.lang.NoClassDefFoundError: software/amazon/awssdk/services/s3/presigner/model/PresignedGetObjectRequest ... 95 more Caused by: java.lang.ClassNotFoundException: software.amazon.awssdk.services.s3.presigner.model.PresignedGetObjectRequest at lucee.commons.lang.PhysicalClassLoader.loadClass(PhysicalClassLoader.java:287) at lucee.commons.lang.PhysicalClassLoader.loadClass(PhysicalClassLoader.java:218) ... 95 more

thanks for testing, I’ve dug in, seems it’s the other issues, i.e. the .close() is problem still

https://luceeserver.atlassian.net/browse/LDEV-6190?focusedCommentId=77668

Cheers, happy to help.

It’s just annoying that it will only replicate on the server itself, rather than locally.