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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Job Automation - Java NoClassDefFoundError

Hi All,

Need some input and help from the community please.

I am using Talend Open Studio Version: 7.1.1 for ESB to help with some workflow, integration and automation.

I have a job that builds a database for phone call analytics for a contact center. The job currently makes use of an QueueMetrics API to poll and get the data for processing via tRestClient, does different data transforms, sorting, aggregating etc. Once it has everything, it pushes the transformed data into a database and reporting can then be done from there.

The process works, the data gets retrieved, transformed and moved where we want it. And all is well. Except...

If I run the job manually on my Windows 10 PC with Talend ESB, it works.

If I build the job, load it onto a linux box (centos 7) and run it manually from there using the *.sh script, it works fine.

But the minute I try and use a cron schedule to run the job on centos to complete the automation portion, it fails, and for the life of me I am unable to see or understand why it fails.

If the job is triggered via cron, then I get:

 

Getting callstats from 2019-05-30 to 2019-05-31
[statistics] disconnected
[statistics] disconnected
[statistics] disconnected
[statistics] disconnected
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/PropertyException
        at old_di.reality_ivr_report_0_1.Reality_IVR_Report.tRESTClient_2Process(Reality_IVR_Report.java:8321)
        at old_di.reality_ivr_report_0_1.Reality_IVR_Report.tRESTClient_1Process(Reality_IVR_Report.java:2986)
        at old_di.reality_ivr_report_0_1.Reality_IVR_Report.tJava_1Process(Reality_IVR_Report.java:19717)
        at old_di.reality_ivr_report_0_1.Reality_IVR_Report.tDBConnection_1Process(Reality_IVR_Report.java:23738)
        at old_di.reality_ivr_report_0_1.Reality_IVR_Report.runJobInTOS(Reality_IVR_Report.java:24013)
        at old_di.reality_ivr_report_0_1.Reality_IVR_Report.main(Reality_IVR_Report.java:23833)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.PropertyException
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
        ... 6 more


But if I manually run the job, either on Windows 10, or directly via terminal on centos, it works perfectly. Adds the data, sends the required mails etc.

I have checked the java paths and installs, reinstalled java (re/se/jdk), tried both oracle java and OpenJava distros, and still can't get the job to run on a schedule.

Manually, fine, via cron, no go.

Any input, suggestions or help would be greatly appreciated.

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I suspect that this is because of the user configuration of the user crontab uses (I believe that is root by default). Have you tried specifying a user for cron to use?

View solution in original post

5 Replies
Anonymous
Not applicable
Author

I suspect that this is because of the user configuration of the user crontab uses (I believe that is root by default). Have you tried specifying a user for cron to use?

Anonymous
Not applicable
Author

Hmmm, no I haven't actually.

I have only been running it in and running it on root. But, I do think you have a point. Let me dig into this first.

This might just be the pointer that I was missing.

Will provide feedback soon.

Anonymous
Not applicable
Author

I might be wrong, but the symptoms you were describing usually point to user permission issues.

Anonymous
Not applicable
Author

Spot on.

So, this system is used for a variety of different setups and staging at the moment.

Subsequently, it has multiple versions of java on it as well allowing me to move and test different jobs and applications as well as migrated them to see if everything works as planned etc.

Cron use the CentOS default Java

java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)

And some of the jobs use Java8.

Even though the path variables have been updated, cron still runs on java version 10 which breaks the job in this case.

Updated the actual job script with the version I want it to use, which basically changes the cron path for the time period in which the job is actually executed, and then release back (for our other tasks and applications) once done.

Thanks. I knew I was missing something silly.

BTW. I had a look at my Windows 10 PC and saw that I am still using Java 8 on there as well at the moment. It has been stable and working fine. Will Talend ESB be ok with a migration to Java 10/11/12?

Last install doc I saw mentioned that the requirement is/was 8. But I haven't found anything listing that it is compatible with 9 and up.

Anonymous
Not applicable
Author

For v7.1 only 8 is supported. This will not change for this version. However, newer versions of Talend will support the newer versions of Java. Keep in mind the Java LTS (Long term support) versions as something to pay attention to. I believe the next LTS version after 8 is 11.