I have a problem calling custom Java method which accesses AWS S3 (NoSuchMethodError)
Exception in thread "main" java.lang.NoSuchMethodError: com.amazonaws.SDKGlobalConfiguration.isInRegionOptimizedModeEnabled()Z
The routine is tested and works outside of Talend.
When I call it inside tJava then I get above error:
I copied the AWS SDK jar into the Talend area and put the external routine dependency
I also explicitly imported the following in tJava:
import insightsanalytics.TransferPostgreDynSqlRdsToS3; // my code
I have run out of ideas, please advise, given Talend DI generates pure Java, is there is a way to get it working ??
I managed to get it to work by the following steps:
In Eclipse I picked the Export option Extract a Runnable JAR file (instead of plain Jar file) with a sub-option of Library handling: Extract required libraries into generated JAR file.
So I have a self-contained, rather huge Jar file of ~200 MB.
This worked! I tried both inside DI Studio and also ran generated bat file in Widows shell. Both worked.
So my question now is this - am I doing this correctly?
If there a better method to get external Java methods to work from Talend ?
My custom code also references other libraries such as AWS PostgreSQL, AWS Redshift, in addition to AWS S3.
The versions of libraries I use in my custom code and those AWS uses will likely be different to the libraries used by Talend DI.
I wonder if there is likely to be a conflict?
Example: Talend job may use PostgreSQL and Redshift itself and my custom Java may also use the same libraries.
Perhaps creating single large Runnable Jar with libraries packaged inside will somehow insulate/isolate my code and the library versions I use from those used by Talend DI?
PS: The build job task generates a massive zip file of ~500 MB (which includes my custom JAR of 200+ MB). I am not very concerned about the size but more about recommended best practices.
Many thanks everyone