Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
RVeitch_84
Creator
Creator

Using an external file in the cloud

Looking for some help in configuring an external resource file in Talend cloud so my job can access it.

 

Here is the summary, I have a job that runs fine locally using Studio and a wallet file saved locally on my C:\ drive.

 

I need to now run this job in the cloud, I have added the file in the Management console but need help in defining that in my job.

 

Here is the context variable that I am using locally which works fine:

javax.net.ssl.trustStoreType=SSO&javax.net.ssl.keyStoreType=SSO&javax.net.ssl.trustStore=C:/Talend/wallet_nsaw_sb/cwallet.sso&javax.net.ssl.keyStore=C:/Talend/wallet_nsaw_sb/cwallet.sso

 

 

And here is my external resource file that I uploaded to the management console.

 0695b00000UwLX7AAN.png 

 

So now I am trying to understand on how to set the cloud file, ADW_wallet_sb in my string.

javax.net.ssl.trustStoreType=SSO&javax.net.ssl.keyStoreType=SSO&javax.net.ssl.trustStore=???&javax.net.ssl.keyStore=???

 

Thanks

for any help.

Labels (3)
6 Replies
Anonymous
Not applicable

Hi

To use an resource file in TMC, you should define the name of context variable in studio like this:

resource_file_resourceName

eg:

resource_file_adw_wallet_sb

 

Then, you can use the context variable in the filed like:

"javax.net.ssl.trustStoreType=SSO&javax.net.ssl.keyStoreType=SSO&javax.net.ssl.trustStore="+context.resource_file_adw_wallet_sb+"&javax.net.ssl.keyStore="+context.resource_file_adw_wallet_sb

 

Regards

Shong

 

 

RVeitch_84
Creator
Creator
Author

Shong

 

Thanks for the quick reply, I tried the format that you suggested and still have the error.

0695b00000UwSwYAAV.png 

See my db connection :

 

0695b00000UwSwsAAF.png 

 

 

Anonymous
Not applicable

Make sure the Job works fine in studio, before you publish it to Talend Cloud. Maybe the error is caused by the char '-' in resource name, try to rename the resource and context variable without '-'.

Let me know if it works.

 

Regards

Shong

RVeitch_84
Creator
Creator
Author

I'm testing in Studio, and I tried renaming the resouce without the "_" and I still have the same error.

 

0695b00000Uwb7KAAR.png 

See my DB connection:

 

0695b00000Uwb7tAAB.pngI added a tJava at the start of the job to print out the context.wallet. this is what I got?

 

resource file = C:\Talend-Studio-20211109_1610-V8.0.1\workspace\.repositories\1347947789\main\TALENDJOBS\poms\jobs\process\Netsuite\Square\cloud_square_payments_adw_1.0\src\main\ext-resources\talendjobs\cloud_square_payments_adw_1_0\resources\cwallet_0.1.sso

 

 

Let me know if you have any other questions.

Anonymous
Not applicable

@Robert Veitch​ , the context variable should follow the format: resource_file_resourceName, eg: resource_file_wallet

It is a compilation error, open the Job code and see which lines has the error.

RVeitch_84
Creator
Creator
Author

 

java.util.Properties atnParamsPrope_tDBConnection_1 = new java.util.Properties();

atnParamsPrope_tDBConnection_1.put("user", dbUser_tDBConnection_1);

atnParamsPrope_tDBConnection_1.put("password", dbPwd_tDBConnection_1);

if ("javax.net.ssl.keyStoreType=SSO&javax.net.ssl.keyStore=" + context.wallet != null

&& !"\"\"".equals("javax.net.ssl.keyStoreType=SSO&javax.net.ssl.keyStore=" + context.wallet)

&& !"".equals("javax.net.ssl.keyStoreType=SSO&javax.net.ssl.keyStore=" + context.wallet)) {

atnParamsPrope_tDBConnection_1.load(

new java.io.ByteArrayInputStream("javax.net.ssl.keyStoreType=SSO&javax.net.ssl.keyStore="

+ context.wallet.replace("&", "\n").getBytes()));

}

 

conn_tDBConnection_1 = java.sql.DriverManager.getConnection(url_tDBConnection_1,

atnParamsPrope_tDBConnection_1);

log.debug("tDBConnection_1 - Connection to '" + url_tDBConnection_1 + "' has succeeded.");