Four Stars

[resolved] Run Builded Job in Server - JDBC error

Hi, I created a Job that connects to a PostgreSQL database.  I exported job as standalone job. After running on Ubuntu 14.04 LTS Server reports an error:
Exception in component connectionStatsLogs 
java.sql.SQLException: No Suitable driver found for jdbc: postgresql: // null: null / null 

Where should I store the JDBC driver? Into the project? 
Thank you for your help
9 REPLIES
Four Stars

Re: [resolved] Run Builded Job in Server - JDBC error

Hi,
Based on error, the variable values for postgres driver are not passed to component. Please check your job settings and variable usage... If it is inside subjob and you are passing variable from parent then in standalone job mode, the context variable would not be available from parent. Please explain your job design and structure.
Thanks
vaibhav
Four Stars

Re: [resolved] Run Builded Job in Server - JDBC error

Hey. 
Structure my work is that I have a main job. it starts several separate subjobs. We use the context for the connection to the DB. 
Buil Job is as follows:
Moderator

Re: [resolved] Run Builded Job in Server - JDBC error

Hi,
Have you tried to check out "Context scripts" to export ALL context parameters files?
TalendHelpCenter:How to build Jobs
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

Re: [resolved] Run Builded Job in Server - JDBC error

I have not tried it. I understood, that if I later want to change the value of Context, so I had to change the values in each of the script. But I want to change the values only in one place. That's why I did not tick value "Context scripts".
So this is the reason why I report bugs?
Four Stars

Re: [resolved] Run Builded Job in Server - JDBC error

Hi,
Another approach is to use tContextLoad in parent job from one property file or fixedflow component and enable "Transmit whole context" to child jobs option on subjobs.
Thanks
Vaibhav
Moderator

Re: [resolved] Run Builded Job in Server - JDBC error

Hi,
Please see a related forum: http://www.talendforge.org/forum/viewtopic.php?id=35438
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Seventeen Stars

Re: [resolved] Run Builded Job in Server - JDBC error

sanvaibhav +1
I think it's the only right way ... load context from file or DB with tContextLoad or implicit context load (I use to load with implicit option).
Talend writes files with context by his own when you build job ...but don't use them Smiley Happy
Use a dedicated file like a Config.ini. 
regards
laurent
Four Stars

Re: [resolved] Run Builded Job in Server - JDBC error

Thanks.
It helped check "Context scripts". But now the problem is with the fact, that Talend is created for each Job separate context (I have about 30), so editing is challenging. 
So will help when I load the context from an external file, then I can edit only one context file?
But how to determine context for the external context file? I mean the path to the file. It is possible to determine path in sh script?
Thanks
Seventeen Stars

Re: [resolved] Run Builded Job in Server - JDBC error

a very simple job : write a message due to different environment Smiley Happy
by default my message (context.message is null). I want to populate the context variable only with a config.ini 
So create a file config.ini anywhere and load context via tContextLoad or implicit Context load.(use impplicit for ex)
in my config.ini I initialize my variable 'message'
message=value in dev

launch your job to see if everthing is OK Smiley Wink
you have something like  :
Démarrage du job talendJob a 12:44 22/08/2014.
connecting to socket on port 3742
connected
Implicit_Context_Context set key "message" with value "value in dev"
value in dev
disconnected
Job talendJob terminé à 12:44 22/08/2014.


But config's path is hard-coding ... create a new context variable for it (context.configPath)!
Build job and modify script by adding 
--context_param configPath=C:/Users/lraulier/Documents/config.ini




now run job with script ! 
You can tell any other path to another config.ini (int, prod, test ..) and modify value of the message without build job again.
hope it help
regard
laurent