How can I set it up correctly?

Hello all,
I would like to ask for help with the settings of lucee server. I installed lucee on EC2 on AWS. I put aws-java-sdk-1.11.1000.jar in the path - ‘/opt/lucee/tomcat/lucee-server/bundles’. When I log in the lucee server, the server shows the state of loaded instead of active. Please take a look of the image below.

I would like to practice the code that I found from github - GitHub - brianklaas/awsPlaybox: The sample app for my presentations about AWS + CFML.
When I request the page that shows the following error:

"
Lucee 5.3.7.47 Error (lucee.commons.lang.ClassException)
Message cannot load class through its string name, because no definition for the class with the specified name [com.amazonaws.auth.BasicAWSCredentials] could be found caused by (java.lang.ClassNotFoundException:com.amazonaws.auth.BasicAWSCredentials;java.lang.ClassNotFoundException:com.amazonaws.auth.BasicAWSCredentials not found by lucee.core [46]:wink:
Stacktrace The Error Occurred in
/var/www/html/awsPlaybox/model/awsServiceFactory.cfc: line 19

17: var credentialsConfig = CreateObject(‘component’,‘awsCredentials’).init();
18: // AWS Docs for Working with Credentials: http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html
19: var awsCredentials = CreateObject(‘java’,‘com.amazonaws.auth.BasicAWSCredentials’).init(credentialsConfig.accessKey, credentialsConfig.secretKey);
20: variables.awsStaticCredentialsProvider = CreateObject(‘java’,‘com.amazonaws.auth.AWSStaticCredentialsProvider’).init(awsCredentials);
21: variables.awsRegion = “us-east-1”;
called from /var/www/html/awsPlaybox/application.cfc: line 8
"

How can I set it up correctly?

OS: AWS Linux(EC2)
Java Version: openjdk version “11.0.10” 2021-01-19 LTS
Tomcat Version: Apache Tomcat/9.0.35
Lucee Version: Lucee 5.3.7.47

Thank you in advance!

William

@William welcome to our community
Put the external jar in the lib folder instead of bundles.

  • Put jar file into lucee/tomcat/lucee-server/context/lib/
  • Restart the tomcat.

I hope it will work.

1 Like

@cfmitrah It works!! Thank you very much!

1 Like

Hello all,
Thanks for giving some hints. I encountered the following errors:

"
Lucee 5.3.7.47 Error (java.lang.NoClassDefFoundError)
Message Could not initialize class com.amazonaws.partitions.PartitionsLoader
Stacktrace The Error Occurred in
/var/www/html/awsPlaybox/model/awsServiceFactory.cfc: line 66

64: break;
65: }
66: serviceObject = CreateObject(‘java’, ‘#javaObjectName#’).standard().withCredentials(variables.awsStaticCredentialsProvider).withRegion(#tools-and-libraries ariables.awsRegion#).build();
67: return serviceObject;
68: }
called from /var/www/html/awsPlaybox/iam.cfm: line 1

1: <cfset iam = application.awsServiceFactory.createServiceObject(‘iam’) />
2:
3:
"

Does it mean that I give the wrong credential?
Any cfms on the page cannot pass the line: <cfset iam = application.awsServiceFactory.createServiceObject(‘iam’) />

Could you please tell me some ways to figure it out. Thank you

Willaim

Here is the related ticket in Jira: LDEV-3128
@William Just try another method to load jar file by application javaSettings.

  • Stop tomcat and remove the jar from the lib folder
  • Put it into any of the root folder
  • Add javaSetings loadpath in application.cfc
  • this.javaSettings.loadpaths = “system path of jar file folder”;

I think this will works.