java.lang.NoClassDefFoundError - Autonomous unix Job fails

Five Stars

java.lang.NoClassDefFoundError - Autonomous unix Job fails

I created a small ETL job (connect to sFTP server, find files and download locally, using contexts for different environmenst) in Talend Open Studio for Data Integration version 5.2.1.
The job works flawlessy in the Open Studio GUI so I exported it to run on unix (using export to autonomous job with the "All" option).
When I run the job on unix, it never executes at all. I always receive the error
Exception in thread "main" java.lang.NoClassDefFoundError: routines/system/api/TalendJob
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

Running the same job from within Windows (locally on my Windows 7 machine), it runs successfully.
I downloaded the very latest OPenStudio 5.2.2 and tried the same thing, to no avail. I still don't succeed in running the standalone job, as it seems to have some issues with locating the different src JARs. I tried changing the shell file, building in 1.5 and 1.6, all of this did not help at all.
So, has anyone encountered the same issue recently, using openstudio 5.2.1 or 5.2.2?
Please advice
Thank you

Accepted Solutions
Moderator

Re: java.lang.NoClassDefFoundError - Autonomous unix Job fails

Hi,

Can we consider this issue as resolved?

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.

All Replies
Moderator

Re: java.lang.NoClassDefFoundError - Autonomous unix Job fails

Hi,
If the job in studio works well, I think the work flow is Fine. Perhaps something wrong with the export. Have you seen the KB article on Talend Help Center Exporting a Job script and executing it outside of Talend Studio?
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.
Five Stars

Re: java.lang.NoClassDefFoundError - Autonomous unix Job fails

Thanks Sabrina, I just finished all the steps in the KB, to make sure I didn't make any mistakes in my own ETL project, but I get the same error in this ExportDemo project.
On Unix it doesn't work and returns the same error message:
Exception in thread "main" java.lang.NoClassDefFoundError: routines/system/api/TalendJob
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Moderator

Re: java.lang.NoClassDefFoundError - Autonomous unix Job fails

Hi,
Usually, the systemRoutine.jar should have included this class when you export your job successfully. All the jobs have this error or this error only occur in your ExportDemo project?
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.
Five Stars

Re: java.lang.NoClassDefFoundError - Autonomous unix Job fails

Hi Sabrina
I only get this error on Unix and I get it every time, regardless which project I try.
The weird thing is, when I open the systemRoutines.jar file, I do see the mentioned class (see attached file 'Capture.JPG')
The contents of the unix shell are as follows:
cd `dirname $0`
ROOT_PATH=`pwd`
java -Xms256M -Xmx1024M -cp $ROOT_PATH/../lib/dom4j-1.6.1.jar:$ROOT_PATH/../lib/talendcsv.jar:$ROOT_PATH/../lib/talend_file_enhanced_20070724.jar:$ROOT_PATH:$ROOT_PATH/../lib/systemRoutines.jar:$ROOT_PATH/../lib/userRoutines.jar::.:$ROOT_PATH/exportdemo_0_1.jar: bdma_sftp.exportdemo_0_1.ExportDemo --context=Default "$@"
Is there nobody experiencing the same problem out there?
As a workaround, I turned to running the job on one of our windows servers for now, but in the end they all should be able to run on unix.
Thanks
Moderator

Re: java.lang.NoClassDefFoundError - Autonomous unix Job fails

Hi,
I have seen your contents of the unix shell, and it seems everything is fine without problem. You can replace ROOT_PATH with the current directory of bat/sh and then execute the java command by manually.
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.
Five Stars

Re: java.lang.NoClassDefFoundError - Autonomous unix Job fails

Hi
I tried replacing lots of stuff in the unix shell, using wildcards, full paths, variabele paths, environment variables, whatnot.. but none of those changes resolved my problem.
For the time being I'll be using the windows batch launcher, but if anybody else comes across the same issue, I would value there input as well.
Thanks for your help thusfar!
kind regards
Diaz
Moderator

Re: java.lang.NoClassDefFoundError - Autonomous unix Job fails

Hi,
I have made a testing (Talend open studio for Data Integration 5.2.2 r99271)for your case on Linux, everything is good. In addition, I don't find any related bug on talend jira.
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: java.lang.NoClassDefFoundError - Autonomous unix Job fails

Hi,
I have the same problem in Linux , NullPointer exception when work in Autonomous Job, but run in GUI all times is OK.

Best regards
Moderator

Re: java.lang.NoClassDefFoundError - Autonomous unix Job fails

Hi,
I have the same problem in Linux , NullPointer exception when work in Autonomous Job, but run in GUI all times is OK.

Is it working with your Window? Have you follow up document TalendHelpCenter:How to build Jobs to build your .sh file in Linux?
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: java.lang.NoClassDefFoundError - Autonomous unix Job fails

I've just had this same issue.  It turns out the 'lib' folder needs to be copied to the new root folder location when moving the job to a different location after unzipping it.  Best option is to unzip the job where you want to deploy as the lib folder is part of the zip which prevents this issue in the first place.
Hope this helps anyone else who comes up against this issue...
Moderator

Re: java.lang.NoClassDefFoundError - Autonomous unix Job fails

Hi,

Can we consider this issue as resolved?

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.