Export OQL to CSV leads to Amazon S3 error, but only in the MxCloud?

1
This error has me a little stumped. I’m not sure what’s causing it.    We have an app that uses OQL to generate .csv files. After that it uploads them to S3. This was all working fine until recently where we did an update that also required the Database Connector module from the app store.   For some reason, our Export OQL to CSV action leads to the following error: Exception in thread "pool-4-thread-4" java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.services.s3.internal.Constants 9:22:49 com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1709) 9:22:49 com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1687) 9:22:49 com.mendix.storage.s3.internal.AmazonS3StorageService.singlePartUpload(AmazonS3StorageService.scala:63) 9:22:49 com.mendix.storage.s3.internal.AmazonS3StorageService.doStoreWithKey(AmazonS3StorageService.scala:34) 9:22:49 com.mendix.storage.s3.internal.AmazonS3StorageComponent.super$doStoreWithKey(AmazonS3StorageComponent.scala:77) 9:22:49 com.mendix.storage.s3.internal.AmazonS3StorageComponent.$anonfun$doStore$1(AmazonS3StorageComponent.scala:77) 9:22:49 scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) 9:22:49 scala.util.Try$.apply(Try.scala:210) 9:22:49 com.mendix.storage.s3.internal.AmazonS3StorageComponent.wrapException(AmazonS3StorageComponent.scala:111) 9:22:49 com.mendix.storage.s3.internal.AmazonS3StorageComponent.doStore(AmazonS3StorageComponent.scala:77) 9:22:49 com.mendix.storage.StorageService.doStore(StorageService.scala:60) 9:22:49 com.mendix.storage.StorageService.doStore$(StorageService.scala:58) 9:22:49 com.mendix.storage.s3.internal.AmazonS3StorageComponent.doStore(AmazonS3StorageComponent.scala:21) 9:22:49 com.mendix.storage.StorageService.store(StorageService.scala:30) 9:22:49 APPCRITICALActionManager: Error in execution of monitored action '{"name":"MODULENAME.ACT_ExecuteOQL","type":"Microflow"}' (execution id: b6b2ebca-2d8e-4d97-bbe4-10bbd5b8d5fb, execution type: CLIENT_ASYNC_MONITORED). 9:22:49 com.mendix.storage.StorageService.store$(StorageService.scala:28) 9:22:49 com.mendix.storage.s3.internal.AmazonS3StorageComponent.store(AmazonS3StorageComponent.scala:21) 9:22:49 APPINFONoClassDefFoundError occurred for class 'Could not initialize class com.amazonaws.services.s3.internal.Constants'. Please make sure the userlib folder of 9:22:49 com.mendix.filedocumentprocessor.internal.FileDocumentProcessorImpl.writeFile(FileDocumentProcessorImpl.java:205) 9:22:49 APPINFOyour project includes the correct library which contains this class. 9:22:49 com.mendix.filedocumentprocessor.internal.FileDocumentProcessorImpl.storeFileDocument(FileDocumentProcessorImpl.java:130) 9:22:49 com.mendix.basis.component.FileDocumentCore.storeFileDocumentContent(FileDocumentCore.scala:32) 9:22:49 com.mendix.basis.component.FileDocumentCore.storeFileDocumentContent$(FileDocumentCore.scala:27) 9:22:49 APPCRITICALActionManager: java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.services.s3.internal.Constants 9:22:49 com.mendix.basis.component.InternalCore.storeFileDocumentContent(InternalCore.scala:21) 9:22:49 com.mendix.core.Core.storeFileDocumentContent(Core.java:1217) 9:22:49 com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1709) 9:22:49 oql.actions.ExportOQLToCSV.executeAction(ExportOQLToCSV.java:145) 9:22:49 oql.actions.ExportOQLToCSV.executeAction(ExportOQLToCSV.java:38) 9:22:49 com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1687) 9:22:49 com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:46) 9:22:49 com.mendix.storage.s3.internal.AmazonS3StorageService.singlePartUpload(AmazonS3StorageService.scala:63) 9:22:49 com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:71) 9:22:49 com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:48) 9:22:49 com.mendix.core.actionmanagement.internal.InternalCoreAction.call(InternalCoreAction.scala:25) 9:22:49 com.mendix.basis.actionmanagement.ActionManager.$anonfun$executeSync$2(ActionManager.scala:80) 9:22:49 com.mendix.storage.s3.internal.AmazonS3StorageService.doStoreWithKey(AmazonS3StorageService.scala:34) 9:22:49 com.mendix.util.classloading.Runner.withContextClassLoader(Runner.java:19) 9:22:49 com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.scala:79) 9:22:49 com.mendix.basis.actionmanagement.UserActionCallBuilderImpl.execute(UserActionCallBuilderImpl.scala:34) 9:22:49 com.mendix.modules.microflowengine.actions.actioncall.ForegroundJavaAction.doExecute(ForegroundJavaAction.scala:35) 9:22:49 com.mendix.modules.microflowengine.actions.actioncall.ForegroundJavaAction.doExecute(ForegroundJavaAction.scala:11) 9:22:49 com.mendix.modules.microflowengine.actions.actioncall.JavaAction.execute(JavaAction.scala:38) 9:22:49 com.mendix.storage.s3.internal.AmazonS3StorageComponent.super$doStoreWithKey(AmazonS3StorageComponent.scala:77) 9:22:49 com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.$anonfun$execute$1(MicroflowObject.scala:32) 9:22:49 com.mendix.storage.s3.internal.AmazonS3StorageComponent.$anonfun$doStore$1(AmazonS3StorageComponent.scala:77) 9:22:49 scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) 9:22:49 scala.Option.flatMap(Option.scala:283) 9:22:49 com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.scala:29) 9:22:49 com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.$anonfun$executeAfterBreakingIfNecessary$2(MicroflowImpl.scala:167) 9:22:49 scala.Option.flatMap(Option.scala:283) 9:22:49 com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.scala:167) 9:22:49 com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.scala:114) 9:22:49 com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:46) 9:22:49 com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:71) 9:22:49 com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:48) 9:22:49 com.mendix.core.actionmanagement.internal.InternalCoreAction.call(InternalCoreAction.scala:25) 9:22:49 com.mendix.basis.actionmanagement.CoreActionHandlerImpl.$anonfun$runMonitoredAction$1(CoreActionHandlerImpl.scala:59) 9:22:49 com.mendix.basis.actionmanagement.ActionMonitoring$.$anonfun$monitor$1(ActionMonitoring.scala:49) 9:22:49 com.mendix.util.classloading.Runner.withContextClassLoader(Runner.java:19) 9:22:49 com.mendix.basis.actionmanagement.ActionMonitoring$.monitor(ActionMonitoring.scala:49) 9:22:49 scala.util.Try$.apply(Try.scala:210) 9:22:49 com.mendix.storage.s3.internal.AmazonS3StorageComponent.wrapException(AmazonS3StorageComponent.scala:111) 9:22:49 com.mendix.storage.s3.internal.AmazonS3StorageComponent.doStore(AmazonS3StorageComponent.scala:77) 9:22:49 com.mendix.basis.actionmanagement.CoreActionHandlerImpl.runMonitoredAction(CoreActionHandlerImpl.scala:59) 9:22:49 com.mendix.storage.StorageService.doStore(StorageService.scala:60) 9:22:49 com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:46) 9:22:49 com.mendix.core.actionmanagement.internal.InternalCoreAction.call(InternalCoreAction.scala:25) 9:22:49 com.mendix.basis.actionmanagement.ActionManager.$anonfun$executeAsync$3(ActionManager.scala:64) 9:22:49 scala.concurrent.Future$.$anonfun$apply$1(Future.scala:672) 9:22:49 com.mendix.storage.StorageService.doStore$(StorageService.scala:58) 9:22:49 scala.concurrent.impl.Promise$Transformation.run(Promise.scala:431) 9:22:49 com.mendix.storage.s3.internal.AmazonS3StorageComponent.doStore(AmazonS3StorageComponent.scala:21) 9:22:49 java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 9:22:49 java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 9:22:49 com.mendix.storage.StorageService.store(StorageService.scala:30) 9:22:49 java.base/java.lang.Thread.run(Unknown Source) 9:22:49 com.mendix.storage.StorageService.store$(StorageService.scala:28) 9:22:49 com.mendix.storage.s3.internal.AmazonS3StorageComponent.store(AmazonS3StorageComponent.scala:21) 9:22:49 com.mendix.filedocumentprocessor.internal.FileDocumentProcessorImpl.writeFile(FileDocumentProcessorImpl.java:205) 9:22:49 com.mendix.filedocumentprocessor.internal.FileDocumentProcessorImpl.storeFileDocument(FileDocumentProcessorImpl.java:130) 9:22:49 com.mendix.basis.component.FileDocumentCore.storeFileDocumentContent(FileDocumentCore.scala:32) 9:22:49 com.mendix.basis.component.FileDocumentCore.storeFileDocumentContent$(FileDocumentCore.scala:27) 9:22:49 com.mendix.basis.component.InternalCore.storeFileDocumentContent(InternalCore.scala:21) 9:22:49 com.mendix.core.Core.storeFileDocumentContent(Core.java:1217) 9:22:49 oql.actions.ExportOQLToCSV.executeAction(ExportOQLToCSV.java:145) 9:22:49 oql.actions.ExportOQLToCSV.executeAction(ExportOQLToCSV.java:38) 9:22:49 com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:46) 9:22:49 com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:71) 9:22:49 com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:48) 9:22:49 com.mendix.core.actionmanagement.internal.InternalCoreAction.call(InternalCoreAction.scala:25) 9:22:49 com.mendix.basis.actionmanagement.ActionManager.$anonfun$executeSync$2(ActionManager.scala:80) 9:22:49 com.mendix.util.classloading.Runner.withContextClassLoader(Runner.java:19) 9:22:49 com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.scala:79) 9:22:49 com.mendix.basis.actionmanagement.UserActionCallBuilderImpl.execute(UserActionCallBuilderImpl.scala:34) 9:22:49 com.mendix.modules.microflowengine.actions.actioncall.ForegroundJavaAction.doExecute(ForegroundJavaAction.scala:35) 9:22:49 com.mendix.modules.microflowengine.actions.actioncall.ForegroundJavaAction.doExecute(ForegroundJavaAction.scala:11) 9:22:49 com.mendix.modules.microflowengine.actions.actioncall.JavaAction.execute(JavaAction.scala:38) 9:22:49 com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.$anonfun$execute$1(MicroflowObject.scala:32) 9:22:49 scala.Option.flatMap(Option.scala:283) 9:22:49 com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.scala:29) 9:22:49 com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.$anonfun$executeAfterBreakingIfNecessary$2(MicroflowImpl.scala:167) 9:22:49 scala.Option.flatMap(Option.scala:283) 9:22:49 com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.scala:167) 9:22:49 com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.scala:114) 9:22:49 com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:46) 9:22:49 com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:71) 9:22:49 com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:48) 9:22:49 com.mendix.core.actionmanagement.internal.InternalCoreAction.call(InternalCoreAction.scala:25) 9:22:49 com.mendix.basis.actionmanagement.CoreActionHandlerImpl.$anonfun$runMonitoredAction$1(CoreActionHandlerImpl.scala:59) 9:22:49 com.mendix.basis.actionmanagement.ActionMonitoring$.$anonfun$monitor$1(ActionMonitoring.scala:49) 9:22:49 com.mendix.util.classloading.Runner.withContextClassLoader(Runner.java:19) 9:22:49 com.mendix.basis.actionmanagement.ActionMonitoring$.monitor(ActionMonitoring.scala:49) 9:22:49 com.mendix.basis.actionmanagement.CoreActionHandlerImpl.runMonitoredAction(CoreActionHandlerImpl.scala:59) 9:22:49 com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:46) 9:22:49 com.mendix.core.actionmanagement.internal.InternalCoreAction.call(InternalCoreAction.scala:25) 9:22:49 com.mendix.basis.actionmanagement.ActionManager.$anonfun$executeAsync$3(ActionManager.scala:64) 9:22:49 scala.concurrent.Future$.$anonfun$apply$1(Future.scala:672) 9:22:49 scala.concurrent.impl.Promise$Transformation.run(Promise.scala:431) 9:22:49 java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 9:22:49 java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 9:22:49 java.base/java.lang.Thread.run(Unknown Source) This error occurs in the MxCloud only. It does not happen when we test it locally.   What stands out to me is that it seems to say that a class is missing in the userlib for Amazon Services constants. The thing is, the error occurs when trying to execute this action in the microflow: Which as far as I can see from the Java code, does not use S3 or any AWS services at all (it would be strange if it did).    What I’m thinking is: The app tries to create a CSV file. The MxCloud uses S3, so tries to do an S3 call to store the CSV file. For some reason, it doesn’t have the right user libraries it needs to do this call. I’m going to try a few things, but if someone has ever encountered this before, it would be great to get your input.   What I’m going to try: This has worked before in this app. The main thing that changed in this version is that we added the Database Connector and an AWS Athena driver to the Userlib. So I’m going to try to revert to the old version that still worked, then add the module and next the driver, to see if one of the two is the cause of the error. I’ll try adding the required library myself to the userlib, to see if that helps.  
asked
2 answers
0

Well it seems to be an issue with the Athena Driver that I added to the Userlib. If I remove that, it works. I think there may be a difference between the two drivers that AWS offers for Athena. There’s one WITH the SDK and one WITHOUT the SDK. 

 

See: https://docs.aws.amazon.com/athena/latest/ug/connect-with-jdbc.html

 

So far I was using the one WITH the SDK, but I’m going to try to use the one WITHOUT. Perhaps this SDK is conflicting with the one that Mendix uses internally.

answered
0

I haven’t been able to solve this. Seems like a bug, so will create a ticket for it.

answered