Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
AStoyakin
Contributor III
Contributor III

Talend Studio generates incorrect code sporadically

Hello,

I've got job compilation error which is sporadically reproduced. I'm looking to either make it reproducible or working. The problem is in Talend code generation, so probably there's some trigger which forces re-run of this task (clean workspace folders, etc.).

Design looks like this : route, job with tLibraryLoad control loading some custom code, tJava controls which are calling that custom code.

Scenario is:

  1. Create some tJava or tJavaFlex control and enter the code. The code is compilable, all imports are resolved, code completion is working.
  2. Save job,
  3. Edit tJava from step1 and modify the code. Now this code doesn't require any external jars, could be as simple as log.info("Hello");
  4. Try to compile - it fails. There's code generated in the job's src/main/internal/TalendJavaSourceViewer*.java which contains function like this (syntax is exactly the same, errors are similar):

void myFunction() {

if (/*code from tJava as is */)

else {

}

}

}

Labels (2)
7 Replies
Anonymous
Not applicable

If you switch to the code tab in the Studio, it will show you where the code is broken. Take a look at this and I think you will see where the issue is. Any tiny mistake in the Java or badly modified component will cause this.

AStoyakin
Contributor III
Contributor III
Author

There's no errors on Code tab. I see in error logs compilation problem of code from src/main/java/internal. My code from tJava control is valid and for some reason it's pasted in this if() condition.

https://github.com/Talend/tdi-studio-se/blob/b2418a7fa884a93613a2f0ea4298ae2e37b6735e/main/plugins/o...76

Anonymous
Not applicable

Can you show me the job design and all of the components? Looking at the code that is generated will not help here. The best place to start looking for any issues is in the Code tab within the Studio.

 

The code is generated from the design. The generation process is fixed. The only thing that will be changing will be the job design. As such, the error will be in the design.

jlolling
Creator III
Creator III

Do you use the Enterprise studio or the open studio? In the enterprise studio we sometimes see a behaviour the code is not refreshed in time.

AStoyakin
Contributor III
Contributor III
Author

Somehow it stopped reproducing. I'll try to put some details when it fails again.

AStoyakin
Contributor III
Contributor III
Author

It's enterprise. Yes, it looks like the code is not refreshed properly, in sporadic way. Do you use any workaround or hints to solve it? Looks like it starts working after some save-compile iterations. And looks like the problem for Camel routes.

jlolling
Creator III
Creator III

If you want to be sure you see the current code you can always use the Build Job function, also if you actually do not want the build yet. After this build the code is definitely up-to-date.