Six Stars

Subjob doesn't start when deployed

Hello all, 

 

This problem is related to the former one I posted, where the whole job didn't run after deployment. This was solved (https://community.talend.com/t5/Deployment/Built-job-doesn-t-run-when-deployed-on-Windows-Server-201...)

 

However, it seems that only the mainjob is running, it stops every time at the point where it would start a Subjob. 

And the strange thing is.. it stops without throwing an error or anything.. so I have nothing to go on.. 

 

And still it applies that on my computer in Talend it works fine, but when deployed on another server (and running under another account) it doesn't start the subjob. 

 

Any ideas what could be the problem? 

Tags (2)
2 ACCEPTED SOLUTIONS

Accepted Solutions
Fifteen Stars

Re: Subjob doesn't start when deployed

OK, this is not necessarily the cause....but it sounds likely. You need to ensure that your Job is running against the same version of Java AND that you are using the JDK's JRE on both machines. Make sure you have the JDK installed on the machine where it fails and then edit your bat file to specify the location of your Java executable. For example, your bat file will start like this.....

 

%~d0
cd %~dp0
java -Xms256M -Xmx4096M -cp .;../lib/routines.jar..........etc

Edit it to point to your 1.7 JDK's JRE, like this....

 

%~d0
cd %~dp0
"C:/Program Files/Java/jdk1.8.0_91/jre/bin/java" -Xms256M -Xmx4096M -cp .;../lib/routines.jar..........etc

Note, that I am pointing my my JRE there. You will have to tailor it to your machine's JDK's JRE location.

Rilhia Solutions
Fifteen Stars

Re: Subjob doesn't start when deployed

Did you understand what I was saying about the type of JRE you are using. It is not just the version number (7 or 8), but it is also whether it came with the JDK (development kit) or just the JRE (runtime) on its own. You should endeavour to use the JRE that is delivered with the JDK.

 

As I understand it, your code works on your development machine which WILL have the JDK (otherwise you wouldn't be able to build), but it does not work on another machine that has multiple versions of Java and not necessarily the JDK's JRE. 

 

Don't build it in different versions, it works on your machine, so stick with that version. Check on your machine which Java version is used to run the successful runs. Then check that it is the same version on the server. You can use the modification to the batch file I gave you to force it to run against a particular version of Java. BUT make sure you have the JDK installed on your server. I suspect that this may be the issue.

Rilhia Solutions
14 REPLIES
Fifteen Stars

Re: Subjob doesn't start when deployed

Does it actually stop, or just not continue for a long time? What do your logs show? You will need to give us a lot more information so that we can understand exactly what is happening.

Rilhia Solutions
Six Stars

Re: Subjob doesn't start when deployed

Hi, 

 

It stops. And it says it just ran succesfully in the Task scheduler, so no errors there.. 

 

I have built in logging that goes to a database, so I can follow the flow, and the logging continues till the component just before the tRunJob. I indicated it in the screenshot of my mainjob with colours. So the circled  component is the last logged component.. and the arrows indicate where the job is stopped..  In the subjobs themselves I also have logging, so if it would stop somewhere halfway there, I would also see it, but it doesn't even reach the first component. 

 

If there is an error, it should have given an error in the logging as well, so that's also weird that that doesn't happen. 

 

So, it picks up the file in tFileList, moves it to another directory (which i can follow as well), directs to a certain flow, but then at the tRunJob it just stops... 

 

Fifteen Stars

Re: Subjob doesn't start when deployed

OK, I see what you are doing. It's a big job. It might make it a bit easier to understand if you break down the job into more child jobs, but that is up to you :-)

 

Can you show me the configuration of the tRunJobs?

Rilhia Solutions
Six Stars

Re: Subjob doesn't start when deployed

Hi, 

 

Well, as soon as I get the child jobs working.. I might consider that Smiley Wink It indeed grew way bigger during the process than on beforehand estimated..

 

Anyway, added a screenshot of the configuration, is that what you meant? 

Nothing else in the advanced settings, except for Catch tstatistics. 

Fifteen Stars

Re: Subjob doesn't start when deployed

OK, that looks pretty standard. I notice most of the tRunJobs that fail to run are connected to RunIfs. I know this is a pain, but can you replace the tRunJobs with tJava components with System.out.println() calls in them. When you run the job these should be fired. If they are not, then it could be your RunIfs are not firing as you expect.

Rilhia Solutions
Six Stars

Re: Subjob doesn't start when deployed

Hi, 

 

I tried as you suggested, but the tJava did run, so the if-statement seems not to be the problem.. 

 

What could be the issue with running a subjob, that if you run it from a different account/server, it suddenly doesn't work? 

Fifteen Stars

Re: Subjob doesn't start when deployed

I have seen an issue with the Dynamic option switched on, which is why I was curious to see your tRunJob config. But it is not that. The fact that the job doesn't error indicates that it is probably not a memory issue. It *could* be that your child jobs are not built into your parent job. To see that you would have to open the Jar (use 7Zip) and that would be a Talend bug.

 

One other thought, are you running in the JobServer or the Runtime (Apache Karaf)?

Rilhia Solutions
Six Stars

Re: Subjob doesn't start when deployed

Hi, 

 

Well, but when deployed on my own pc, same artifact, it runs perfectly, so for sure not being built in is not the issue. 

 

I am running them from the Windows Task scheduler. They are batchwise jobs (.bat). 

Fifteen Stars

Re: Subjob doesn't start when deployed

So this isn't in the Enterprise Edition? Sorry, I thought it was running on a Talend server.

 

Are you comparing running in the Studio against running as a compiled Jar file (from a .bat file). Or are you running the exact same Jar file, just on different machines? If so, are your Java environments the same? You should be using the JRE included with the JDK install as well. There are subtle differences between the JRE on its own and the JRE included with the JDK.

Rilhia Solutions
Six Stars

Re: Subjob doesn't start when deployed

Hi, 

 

Sorry, no this is Talend Open Source for ESB v. 6.4.1.  

My own PC is Windows 10, java build 1.8.0_162-b12, but I compiled the jobs on java 1.7, otherwise it didn't want to run at all on the server (my former issue).  I installed java 1.7 then as well on my PC, to be able to use JDK 1.7 while building the job. 

 

The server is a Windows Server 2012, with the latest Java 1.8.0_162-b12 as well. But the 1.7 version is installed as well, so why my job won't run on 1.8 I don't understand anyway.. but that is a different issue. 

 

And I am running the same .bat (built artifact) on different machines, both in the Windows Task Scheduler. 

 

 

Fifteen Stars

Re: Subjob doesn't start when deployed

OK, this is not necessarily the cause....but it sounds likely. You need to ensure that your Job is running against the same version of Java AND that you are using the JDK's JRE on both machines. Make sure you have the JDK installed on the machine where it fails and then edit your bat file to specify the location of your Java executable. For example, your bat file will start like this.....

 

%~d0
cd %~dp0
java -Xms256M -Xmx4096M -cp .;../lib/routines.jar..........etc

Edit it to point to your 1.7 JDK's JRE, like this....

 

%~d0
cd %~dp0
"C:/Program Files/Java/jdk1.8.0_91/jre/bin/java" -Xms256M -Xmx4096M -cp .;../lib/routines.jar..........etc

Note, that I am pointing my my JRE there. You will have to tailor it to your machine's JDK's JRE location.

Rilhia Solutions
Six Stars

Re: Subjob doesn't start when deployed

Hi, 

 

I tried this, but it didn't help either. Tried it with building it in different Java versions, but none worked. 

Fifteen Stars

Re: Subjob doesn't start when deployed

Did you understand what I was saying about the type of JRE you are using. It is not just the version number (7 or 8), but it is also whether it came with the JDK (development kit) or just the JRE (runtime) on its own. You should endeavour to use the JRE that is delivered with the JDK.

 

As I understand it, your code works on your development machine which WILL have the JDK (otherwise you wouldn't be able to build), but it does not work on another machine that has multiple versions of Java and not necessarily the JDK's JRE. 

 

Don't build it in different versions, it works on your machine, so stick with that version. Check on your machine which Java version is used to run the successful runs. Then check that it is the same version on the server. You can use the modification to the batch file I gave you to force it to run against a particular version of Java. BUT make sure you have the JDK installed on your server. I suspect that this may be the issue.

Rilhia Solutions
Six Stars

Re: Subjob doesn't start when deployed

Hi, 

 

Yes, I misunderstood it at first, but now indeed it works Smiley Happy 

So, I just compiled it in 1.7, but built with JDK 1.8... like I did when it did run at my PC. And now I changed the .bat file and pointed the java part to the JDK 1.8 at the server, as you explained. 

 

Thank you very much!!