Using compiled versions of Routines with the Test Run feature in Talend Data Mapper
You cannot test maps using the Test
Run feature available in the Mapping perspective if a function that was defined in the
Integration perspective under Code > Routines is called in one of the maps. Using the Test Run
feature on such a map will result in errors.
This issue occurs because Studio routines are not on the classpath during development. Test Run , in the Mapping perspective, has no access to the compiled versions of these routines.
Resolution
A workaround is to import a compiled version of these routines into your project.
To do so, do the following.
- In a command window, go to the <talend_studio_path>/workspace/.Java folder.
- Type mvn package .
This creates a routines.A.B.C.jar file in <talend_studio_path>/workspace/.Java/target which contains is a compiled version of the routines.
- In the Studio , open the Navigator view and find your project.
- Right click the Project, and then click Properties > Mapping .
- Click Add JAR and add <talend_studio_path]/workspace/.Java/target/routines-A.B.C.jar to your project.
After this, you will be able to use the Test Run feature as required.