brianklaas / ctlS3Utils

A simple utility to create signed S3 requests with optional custom headers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I am unable to load the java classes in lucee

artknight opened this issue · comments

Hi,
i followed your article to connect to S3 but i am unable to load the class. Here is the error that I am getting.
I placed the JAR files into \lib according to the notes

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 [48];java.lang.ClassNotFoundException:com.amazonaws.auth.BasicAWSCredentials;)

Hi,

I don't normally work with the Lucee runtime, but you should be able to add the AWS SDK .jar in one of these two places and have it load automatically when the server starts up:

{lucee-server}/WEB-INF/lib
{website-root}/WEB-INF/lucee/lib

Alternatively, if you can't load the AWS SDK .jar file at server startup, you could load it needed classes dynamically when you start your application as follows:

createObject( "java", "some.java.Class", [ "path/to/class.jar" ] )

This is detailed on Ben Nadel's blog, but it's not an approach I'm familiar with. The AWS SDK .jar is also huge and you might have to load a ton of individual classes if you try this route.

Hi Art -

You can download the complete version 1.x AWS Java SDK .jar file here: https://sdk-for-java.amazonwebservices.com/latest/aws-java-sdk.zip

I have yet to get the v2 AWS Java SDK to work in ColdFusion, so I strongly recommend using the v1.x SDK. You'll be on your own if you want to use v2.

Those .jar files come bundled with the AWS Java SDK 1.x download. They're in the "third-party" folder.