[resolved] Exception in thread "main" java.lang.NoClassDefFoundError

Five Stars

[resolved] Exception in thread "main" java.lang.NoClassDefFoundError

Resolved: Talend isn't creating a folder that contains the lib directory and the jobinfo properties. I had to put them in the directory manually, but it works now. 
I'm trying to build a Standalone job in Talend. 
When I run the job in TOS it runs fine. When I build the job and run it on my machine, it runs without error. However, when I try to run the job on another machine I get the following error:
C:\universe\bin\Talend\LenderJob>java -Xms256M -Xmx1024M -cp ../lib/commons-la
ng-2.4.jar;../lib/dom4j-1.6.1.jar;../lib/external_sort.jar;../lib/jakarta-oro-2.
0.8.jar;../lib/talendcsv.jar;../lib/talend_file_enhanced_20070724.jar;../lib/sys
temRoutines.jar;../lib/userRoutines.jar;.;lenderjob_0_3.jar; lender.lenderjob_0_3.LenderJob --context=Default
Exception in thread "main" java.lang.NoClassDefFoundError: routines/system/api/T
alendJob
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: routines.system.api.TalendJob
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 13 more

I have made sure that Java is installed on the other machines and that the path is set correctly. 
It works on my Windows 7 machine, but it isn't working on the Windows 2008 server edition machine. 
Community Manager

Re: [resolved] Exception in thread "main" java.lang.NoClassDefFoundError

Resolved: Talend isn't creating a folder that contains the lib directory and the jobinfo properties. I had to put them in the directory manually, but it works now. 

Talend generates a zip package while exporting the job script. The zip package should contains a lib direcotry and jobinfo properties file, it is not normal if it doesn't. 
Can you please give us more information about this issue? What's the configurations when you export the job script?
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Exception in thread "main" java.lang.NoClassDefFoundError

Hello,
I have the same problem when i create a autonomous Job. My job is working on my Windows 7 machine but not on my Windows 2008 server edition machine.
The error is the same (Exception in thread "main" java.lang.NoClassDefFoundError: routines/system/api/T
alendJob). For information, I am working with Talend 5.5.1.
Is there a solution?
Laurent
Moderator

Re: [resolved] Exception in thread "main" java.lang.NoClassDefFoundError

Hi Laurent,
What's the JDK version installed on your Windows 2008 server edition machine?
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.
One Star

Re: [resolved] Exception in thread "main" java.lang.NoClassDefFoundError

Hello,
the java version on my Windows 2008 server edition machine is 1.7.0.60. (Fyi it's 1.7.0.40 on my Windows 7 machine).
Laurent.
Moderator

Re: [resolved] Exception in thread "main" java.lang.NoClassDefFoundError

Hi,
Is oracle JDK or open JDK?
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.
One Star

Re: [resolved] Exception in thread "main" java.lang.NoClassDefFoundError

Both Oracle JDK
Moderator

Re: [resolved] Exception in thread "main" java.lang.NoClassDefFoundError

Hi,
Did you follow up document TalendHelpCenter:How to build Jobs to export your job as autonomous job? What's your configurations when you export the job script?
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.
One Star

Re: [resolved] Exception in thread "main" java.lang.NoClassDefFoundError

hi,
I will look. I chosed (All: windows + unix) because on some forum i've seen that can soluce my problem for an former version of talend.
Laurent
Moderator

Re: [resolved] Exception in thread "main" java.lang.NoClassDefFoundError

Hi,
Feel free to let me know if something happend.
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.
Four Stars

Re: [resolved] Exception in thread "main" java.lang.NoClassDefFoundError

Start from the beginning in java when we using some function which belong to some class of jar and we do not have that in our running environment this error happens.

 

Now when come to talend job which is made in java so this error(which by the way your own fault) happen as when we created different type of jobs like on using excel file to map in mysql db, one using a mysql(any db) and joining it with excel file data to map in mysql(any db) will have different jar file requirement.Means not all talend jobs are using same jar file of lib.

 

So, check job lib folder jar files if they already exists in global lib folder(of talend) in external project of your.Like in my case

talend_Jobs

  /Students

 /Teachers

/lib

/jobInfo.properties 

 

I added Schools job here which using some jar file which are not already there in /lib so I added jar files from Schools job  /lib to global /lib of talend_Jobs

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog