Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
When I build a job, I can run it lauching the job_run.bat file and it works. This job use Default.properties context file.
However, I noticed that when I update Default.properties file, the context variable is not updated in the job (I print it using System.out.println)...
I only have this problem on Windows. It works fine on Linux when I edit context properties file.
Did someone already have this problem ?
@Shicong Hong
Something caught my attention on you screenshot. I realised that all your libs were in your command line.
In my Studio Window menu, preferences, Talend, Export/import I had this :
I unchecked add classpath jar.... and then rebuild my job.
Now it works... When I modify a value in my context file, and run the job again, the value changes !
@Alpha549 Alpha549 , what content you have modified? Can you describe the steps that helps us to reproduce the problem?
Regards
Shong
Hello @Shicong Hong
Here is my context in the Studio :
Here is the value :
I copied the value from here in the file explorer :
I build the job, and set the DEV context to be used :
I extract the zip :
Here I can see my context files :
In the DEV.properties file I can see :
My "C:\TJOB" in the Studio became "C\:\\TJOB" here
Let's run bat file :
END OF THE PREVIOUS MESSAGE
@Shicong Hong
Here we can see the loaded value of our context variable. Everything goes like expected.... Now let's edit this value in the DEV.properties file... :
When we run the job again, we can see that the value is not updated. It seems that it previously displayed value was the on defined in the job, and not the one in the file... :
I don't know why this problem happens, but it works well on Linux when I edit context properties file.
@Alpha549 Alpha549 Which version of studio are you using? I made a testing with v8.0.1 on windows and it works, see below:
My job is very simple, I use a tJava to print the value of context variable.
System.out.println(context.name);
Regards
Shong
@Shicong Hong
Something caught my attention on you screenshot. I realised that all your libs were in your command line.
In my Studio Window menu, preferences, Talend, Export/import I had this :
I unchecked add classpath jar.... and then rebuild my job.
Now it works... When I modify a value in my context file, and run the job again, the value changes !
ah, this checkbox is unchecked by default. I don't know why this option will cause this issue. Maybe it is a bug. I'm going to raise a ticket to our R&D team.
Thank you again for your help @Shicong Hong . If you didn't show me your command line, I wouldn't see that it was a classpath problem !
@Alpha549 Alpha549 here is the jira issue, you can watch the issue and will be notified once the status changes.