[solved] import talend Routines in jet part to use own Utils
Hello
i am trying the following:
i want to use the package routines to read metadata for GENERATING, not at runtime of the component
<%@ jet imports=" org.talend.core.model.process.INode org.talend.core.model.process.ElementParameterParser org.talend.core.model.metadata.IMetadataTable org.talend.core.model.metadata.IMetadataColumn org.talend.core.model.process.IConnection org.talend.core.model.process.IConnectionCategory org.talend.core.model.process.EConnectionType org.talend.designer.codegen.config.CodeGeneratorArgument org.talend.core.model.metadata.types.JavaTypesManager org.talend.core.model.metadata.types.JavaType java.util.List java.util.Map java.util.HashMap java.util.Set java.math.BigInteger routines.DB " %> And the result is: Execution failed : Failed to generate code.
[----------
1. ERROR in E:\x163842\Workspace\.JETEmitters\src\org\talend\designer\codegen\translators\dataquality\TFileAidIMSQABeginJava.java (at line 18)
import routines.DB;
^^^^^^^^
The import routines cannot be resolved
How can i qualify the package routines that it will be found by the jetengine ???? Thanks for your help
You will need to remove the semi colon after "routines.DB" and ensure that you have compiled your routines into a Jar and that the Jar is in the classpath of the component.
thank you for the responds, i removed the ; already.
I think the jar in the componentfolder will help only in the case that i want to use it inside the component or not ?
regards
dj
i solved it by placing the routines Folder with the compiled classfiles into C:\Program Files (x86)\Talend-Studio-V5.4.1\plugins\org.talend.designer.codegen_5.4.1.r111943\
That is pretty much what I was suggesting, however you will now have two routines folders/files to update. You will have the one which is available to your Studio for development and the one that is in your components classpath. It would be more logical to create the code that you want for your component, compile as a Jar and then package it with the component.
I will try that, thank you
actually i am fighting with an
JETException: InvocationTargetException
running the code, which runs perfectly in my unittest. Might be still some config Problem