Job using tFileInputJSON fails, saying that the path doesn't exist

Symptoms

If you are running a Job on 6.4.1, and you have a tFileInputJSON component in that Job, you may encounter an issue where the Job runs locally, but it fails when running remotely. You may build the Job locally, or using CommandLine, and there won't be any issues reported. However, upon reviewing the execution logs for TAC, you will find an error that is the same as or similar to the following:

 

### Job STARTED  at 2017/09/27 19:10:35 (jobId=20170927_191008_C3Shp, jobExecutionId=20170927191035_keJcU) ###

### Job ENDED WITH ERROR  at 2017/09/27 19:10:35 (jobId=20170927_191008_C3Shp, jobExecutionId=20170927191035_keJcU) ###
java.lang.NoClassDefFoundError: com/jayway/jsonpath/PathNotFoundException
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
	at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
	at java.lang.Class.getMethod0(Class.java:3018)
	at java.lang.Class.getMethod(Class.java:1784)
	at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: com.jayway.jsonpath.PathNotFoundException
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 7 more
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" 

 

Diagnosis

The issue is that you may have all the components for the tFileInputJSON component, but Maven is referencing the wrong library for that component. When you build the Job, that component may exist locally, but it doesn't exist and/or is mapped differently in your Nexus and Jobserver. When the Job runs, it will try to reference the old library, searching for the new JAR file. This will cause the component to not run properly, causing an issue with the Job.

 

Solution

To resolve this issue:

  1. Navigate to the location of the tFileInputJSON_java.xml file (for example, C:\Talend\6.4.1\Studio\plugins\org.talend.designer.components.localprovider_6.4.1.20170623_1246\components\tFileInputJSON) and open the file in a text editor.
  2. Scroll down to line 170, where you will see the following line:

    <IMPORT NAME="json-path-2.1.0.jar" MODULE="json-path-2.1.0.jar" MVN="mvn:org.talend.libraries/json-path-1.2.0/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.json/lib/json-path-2.1.0.jar"
    REQUIRED_IF="(READ_BY == 'JSONPATH')" />
  3. Change the filepath so that it reflects the correct JAR that needs to be referenced:

    <IMPORT NAME="json-path-2.1.0.jar" MODULE="json-path-2.1.0.jar" MVN="mvn:org.talend.libraries/json-path-2.1.0/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.json/lib/json-path-2.1.0.jar"
    REQUIRED_IF="(READ_BY == 'JSONPATH')" />
  4. Save the file and restart Studio; once you open your project and Job, the Maven changes will be reflected in your Nexus and JobServer. You can save and run the Job remotely now, and your Job will run using Job Conductor once again.

 

CommandLine

If you are using the CommandLine to build Jobs from Git/SVN from the TAC Job Conductor, you need to make this change in the corresponding file there, too.

 

The path would be effectively in the same place – this time, in the Studio directory embedded within the CommandLine install directory, for example:

C:\Talend\6.4.1\cmdline\studio\plugins\org.talend.designer.components.localprovider_6.4.1.20170623_1246\components\tFileInputJSON\tFileInputJSON_java.xml

 

Once you make the change, restart the CommandLine service.

 

This issue has been addressed and will be fixed in future version of Talend. If you have issues applying this fix to your environment, reach out to Talend Support for additional assistance.

Version history
Revision #:
4 of 4
Last update:
‎09-29-2018 12:15 AM
Updated by: