Component definition is not added to the job's classpath in Talend 6.5.1

Six Stars

Component definition is not added to the job's classpath in Talend 6.5.1

Hello,

 

I've faced an issue when I wanted to check my custom component in the new versions of Talend (6.5.1 & 7.0.1 M2) Actually, what I see that the component's definition part is not added to the classpath of the job thus it cannot be used. It worked well with 6.4.1.

 

It's possible to reproduce this issue if you create the sample component based on the documentation.

  1. Download and unzip: TOS_ESB-20180116_1512-V6.5.1.zip
  2. Create the a demo component from archetype by following the steps in the documentation:
    mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeGroupId=org.talend.components -DarchetypeArtifactId=input-component-archetypes -DarchetypeVersion=0.19.9 -DarchetypeRepository=https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceRelease/
  3. Change directory to the generated source (cd components-file) and build the component
  4. Deploy it to TOS (https://help.talend.com/reader/AIx_MlLrdaX0O8KexaMESA/1RaDTf8tgxmJXFfUz3yqRA)
  5. Place a tLogRow and the demo FileInput custom component in a job and wire them together

Robot Happy Expected: When checking the generated code for the job you shouldn't see unresolved types for the component definition classes

 

 

Error when the code is generated for the job (run the job)

Multiple markers at this line
- org.talend.components.file cannot be resolved to a type
- org.talend.components.file cannot be resolved to a type


Workaround:
- Add both definition and runtime of the custom component to the job's classpath.

The same issue occurs in v7.0.1 M2 as well. Not to mention that the "tLogRow" is not included in TOS_ESB-20171219_1109-V7.0.1M2 bundle, was it intentionally removed?

 

Note that the custom component just works fine with Talend Studio (DI / ESB) 6.4.1 without any manual configuration on the classpath.

 

My question: Did something change in the deploy process for 6.5.1 that the documentation does not cover?

I haven't find related questions issues on the community site yet :/

 

Environment:

  • Java: 1.8 u144 (64)
  • OS: Windows

 

Thanks,
Zoltán


Accepted Solutions
Employee

Re: Component definition is not added to the job's classpath in Talend 6.5.1

Hi Zoltán

 

Thanks again for your feeback. After walking though several tests, our component framework development team thinks that this is related to a bug to which they need to look in a broader and deeper scope on the product side and created a jira ticket to track it.

https://jira.talendforge.org/browse/TDI-40273

 

They did find a workaround for this issue as you can read in the link I pasted above:

 

I was analyzing the issue and found one more workaround.
1. Right mouse click on .Java project in Navigator view
2. Update Project
3. Uncheck "Offline" and run update
It fixes the issue, but normally user should not do these actions to make it work.

But still it's not normal to have to do this, as he said in his comment in the jira.

 

Please don't hesitate to let us know about any other issue you might encounter.

 

Regards,

 

Yudong CHEN



All Replies
Moderator

Re: Component definition is not added to the job's classpath in Talend 6.5.1

Hello Zoltán,

Sorry for delay!

We have reported your issue and concern to our DOCT team to see if there is any change in the deploy process for 6.5.1 that the documentation does not cover and will keep you posted.

Thanks for your time.

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.
Six Stars

Re: Component definition is not added to the job's classpath in Talend 6.5.1

Hi Sabrina,

 

Thanks for the update! If you need more information from my side in any sense, please just let me know! Smiley Happy

I look forward to your findings.

 

Best regards,

Zoltán

Employee

Re: Component definition is not added to the job's classpath in Talend 6.5.1

Hello Zoltán,

 

This is Yudong from Talend Documentation team. We are analyzing your issue with our component framework developers.

 

Before we can reach some final conclusion, our developers suggest you to copy the components-file-definition folder from your maven repository to the Studio repository to see whether this action helps (this works fine in their test). I will also update the tutorial at the same time to reflect this step.

 

In addition, if you don't mind, could you please open the error log generated automatically by the Studio to see whether you have error stack trace there; if you do have errors, it's appreciated if you can paste it here.

 

About how to open this error log: in your Studio, click Window to open the menu, then select Show View->General->Error Log. Once you see an error, double click it.

 

Best regards,

 

Yudong

Talend Documentation team

Six Stars

Re: Component definition is not added to the job's classpath in Talend 6.5.1

Hi Yudong,

 

Thanks for the getting back to me.

 

Actually, I've done the same trick in v6.4.1 (copied the definition part as well [not just the runtime]) to the Talend Studio's maven repository which worked on 6.4.1. However, it doesn't work for 6.5.1, still doesn't add the component's artifacts as a Maven dependency in the Job's classpath.

 

See the classpath on 6.4.1:
Talend641-01.jpg

 

On 6.5.1 the component artifacts are missing:
Talend651-01.jpgTalend651-02.jpg

 

The Error log console has only 1 Error severity entry which which notifies about the compile error as the definition artifact is not on the classpath. Same JVM setup is used so it is not JVM compatibility issue.

 

Here it is:

 

eclipse.buildId=unknown
java.version=1.8.0_144
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en
Command-line arguments:  -os win32 -ws win32 -arch x86_64

org.talend.platform.logging
Error
Mon Mar 19 16:29:48 CET 2018
2018-03-19 16:29:48,006 ERROR org.talend.commons.exception.CommonExceptionHandler  - Job compile errors
At least job "TestJob" has a compile errors, please fix and export again.
Error Line: 455
Detail Message: org.talend.components.file.StringDelimiter cannot be resolved to a variable
There may be some other errors caused by JVM compatibility. Make sure your JVM setup is similar to the studio.


org.talend.designer.runprocess.ProcessorException: Job compile errors 
At least job "TestJob" has a compile errors, please fix and export again.
Error Line: 455
Detail Message: org.talend.components.file.StringDelimiter cannot be resolved to a variable
There may be some other errors caused by JVM compatibility. Make sure your JVM setup is similar to the studio.
	at org.talend.designer.runprocess.JobErrorsChecker.checkLastGenerationHasCompilationError(JobErrorsChecker.java:328)
	at org.talend.designer.runprocess.DefaultRunProcessService.checkLastGenerationHasCompilationError(DefaultRunProcessService.java:380)
	at org.talend.designer.runprocess.RunProcessService.checkLastGenerationHasCompilationError(RunProcessService.java:292)
	at org.talend.designer.runprocess.ProcessorUtilities.generateBuildInfo(ProcessorUtilities.java:656)
	at org.talend.designer.runprocess.ProcessorUtilities.generateCode(ProcessorUtilities.java:943)
	at org.talend.designer.runprocess.ProcessorUtilities.generateCode(ProcessorUtilities.java:741)
	at org.talend.designer.runprocess.ProcessorUtilities.generateCode(ProcessorUtilities.java:1533)
	at org.talend.designer.core.ui.AbstractMultiPageTalendEditor.codeSync(AbstractMultiPageTalendEditor.java:1425)
	at org.talend.designer.core.ui.AbstractMultiPageTalendEditor.turnToCodePage(AbstractMultiPageTalendEditor.java:796)
	at org.talend.designer.core.ui.AbstractMultiPageTalendEditor.pageChange(AbstractMultiPageTalendEditor.java:700)
	at org.eclipse.ui.part.MultiPageEditorPart$2.widgetSelected(MultiPageEditorPart.java:294)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:782)
	at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3110)
	at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1794)
	at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:283)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.talend.rcp.intro.Application.start(Application.java:255)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)

Please let me know if you need anything else from my side.

 

Thank you,
Zoltán

Employee

Re: Component definition is not added to the job's classpath in Talend 6.5.1

Hi Zoltán, 

 

Thanks to the information you provided, our developers reproduced this issue. He is trying to find the reason and a solution.

 

We will keep you posted.

 

Thanks and regards,

 

Yudong

Employee

Re: Component definition is not added to the job's classpath in Talend 6.5.1

Hello Zoltán

 

After walking through several tests around the issue you signaled, one of our component developers thought this was caused by a bug to be looked to in a broader and deeper scope on the product side and has reported this issue in our bug tracking system. 

 

https://jira.talendforge.org/browse/TDI-40273

 

Please do not hesitate to come back to us if you encounter any other issues.

 

Regards,

 

Yudong CHEN

Employee

Re: Component definition is not added to the job's classpath in Talend 6.5.1

Hi Zoltán

 

Thanks again for your feeback. After walking though several tests, our component framework development team thinks that this is related to a bug to which they need to look in a broader and deeper scope on the product side and created a jira ticket to track it.

https://jira.talendforge.org/browse/TDI-40273

 

They did find a workaround for this issue as you can read in the link I pasted above:

 

I was analyzing the issue and found one more workaround.
1. Right mouse click on .Java project in Navigator view
2. Update Project
3. Uncheck "Offline" and run update
It fixes the issue, but normally user should not do these actions to make it work.

But still it's not normal to have to do this, as he said in his comment in the jira.

 

Please don't hesitate to let us know about any other issue you might encounter.

 

Regards,

 

Yudong


Employee

Re: Component definition is not added to the job's classpath in Talend 6.5.1

Hi Zoltán

 

Thanks again for your feeback. After walking though several tests, our component framework development team thinks that this is related to a bug to which they need to look in a broader and deeper scope on the product side and created a jira ticket to track it.

https://jira.talendforge.org/browse/TDI-40273

 

They did find a workaround for this issue as you can read in the link I pasted above:

 

I was analyzing the issue and found one more workaround.
1. Right mouse click on .Java project in Navigator view
2. Update Project
3. Uncheck "Offline" and run update
It fixes the issue, but normally user should not do these actions to make it work.

But still it's not normal to have to do this, as he said in his comment in the jira.

 

Please don't hesitate to let us know about any other issue you might encounter.

 

Regards,

 

Yudong CHEN


Six Stars

Re: Component definition is not added to the job's classpath in Talend 6.5.1

Hi Yudong,

 

Thanks very much for the update on this thread! Smiley Happy

 

I can confirm that the workaround indeed works for me as well. 

I'm just wondering if the ticket will be eventually fixed in later version of Talend Open Studio because it's not clear to me why the referenced JIRA ticket (TDI-40273) has been closed. 

As per the description Ivan said that:
"I've checked the result of Component.getModulesNeeded() method in debug. It contains required libs. Thus, Component's dependencies.txt file is correct"

 

however the comment on the ticket by Nicolas:
"That's a problem of archetype definition here maybe, as it's working for other components.
That means the definition doesn't list correctly the dependencies needed"

It seems counterproductive statements also it's not clear to me if it will be fixed or not in the later releases.

I'm asking this question because if someone would like to upload a component to Talend Exchange which was made by this Talend Component Kit will probably face this issue in the future.

 

Thank you very much for your investigation and if you could double check with the Component Framework Dev Team that their findings seems conflicting, that would be great knowing that it was working flawlessly in Talend 6.4.1.

 

Thanks,

Zoltán

Employee

Re: Component definition is not added to the job's classpath in Talend 6.5.1

Hi Zoltán,

 

Sorry for this late reply and thank you for your Kudo.

 

What you read in the comment of the jira was actually an assumption of one of our developers and was put to start a discussion within the team. Sorry for this confusion.

 

Our developer says this issue is linked closely with the default Studio behavior, to the extent of how the Maven offline mode generally works. With the offline mode on by default, the Studio looks at the lastUpdate tag of the maven-metadata-local.xml file of your component and fetch it only when that date is earlier than what the Studio has at the lastUpdate tag in any of the maven-metadata-local.xml files of its existing components. This also explains why this issue can be resolved by clearing the Mave offline check box.

 

So if you always change the lastUpdate tag of the maven-metadata-local.xml file of your component to a date earlier than that of the Studio when you create your component, this should prevent this issue from coming back.

 

Thanks,

 

Yudong

 

Six Stars

Re: Component definition is not added to the job's classpath in Talend 6.5.1

Hi Yudong,

 

Thanks for getting back to me.

To be honest, it doesn't explain why it worked for v6.4.1 in Maven Offline mode. The maven-metadata-local.xml is auto generated during the deploy phase to the local repository so I wouldn't alter that file manually.

Anyways, it would be great to update the documentation and add these instructions in Developing a component using Talend Component Kit as well for the version as of TOS 6.5.1.

 

Thanks for your help!

 

Best,

Zoltán