Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
artknight opened this issue Nov 25, 2021 · 6 comments
Open

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

artknight opened this issue Nov 25, 2021 · 6 comments

Comments

@artknight
Copy link

artknight commented Nov 25, 2021

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
Copy link
Owner

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
Copy link
Author

artknight commented Dec 3, 2021 via email

@brianklaas
Copy link
Owner

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
Copy link
Author

artknight commented Dec 3, 2021 via email

@brianklaas
Copy link
Owner

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

@artknight
Copy link
Author

artknight commented Dec 3, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants