brianklaas / ctlS3Utils

A simple utility to create signed S3 requests with optional custom headers.
10 stars 4 forks source link

I am unable to load the java classes in lucee #1

Open artknight opened 2 years ago

artknight commented 2 years ago

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;)
brianklaas commented 2 years ago

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.

artknight commented 2 years ago

Thanks!

Where can I download all the jars from?

Please do not send me to the AWS SDK page as there are no direct download links.

Thanks!

Art

On Dec 2, 2021 at 9:52 AM, <Brian Klaas @.***)> wrote:

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 (https://www.bennadel.com/blog/3651-dynamically-loading-java-classes-from-jar-files-using-createobject-in-lucee-5-3-2-77.htm), 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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub (https://github.com/brianklaas/ctlS3Utils/issues/1#issuecomment-984699549), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AABGQQVWGBSSI4G4SXBUYM3UO6B2RANCNFSM5IXOZ7ZA).

brianklaas commented 2 years ago

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.

artknight commented 2 years ago

Do you happen to have the other files needed? I remember seeing

jackson-annotations-2.6.0.jar jackson-core-2.6.7.jar jackson-databind-2.6.7.1.jar joda-time-2.8.1.jar

Are those still needed? Where can i download them?

On Fri, Dec 3, 2021 at 12:09 PM Brian Klaas @.***> wrote:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/brianklaas/ctlS3Utils/issues/1#issuecomment-985685956, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABGQQRCLEXDEPV3TJUKBYTUPD2VPANCNFSM5IXOZ7ZA .

brianklaas commented 2 years ago

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

artknight commented 2 years ago

Awesome, Thank you Sir!!

On Fri, Dec 3, 2021 at 12:55 PM Brian Klaas @.***> wrote:

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/brianklaas/ctlS3Utils/issues/1#issuecomment-985716464, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABGQQWYOAXX5HFEZY6TIWTUPEABDANCNFSM5IXOZ7ZA .