One Star

Error : java.lang.NoClassDefFoundError:

Hello-
I am using Talend open studio 4.2.3 , While I am running jobs I am hitting the below error :
Starting job TestJob at 13:00 05/02/2012.
java.lang.NoClassDefFoundError: talenddemosjava/testjob_0_1/TestJob
Caused by: java.lang.ClassNotFoundException: talenddemosjava.testjob_0_1.TestJob
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)
Could not find the main class: talenddemosjava.testjob_0_1.TestJob. Program will exit.
Exception in thread "main"
Job TestJob ended at 13:00 05/02/2012.
Any Help?
12 REPLIES
One Star

Re: Error : java.lang.NoClassDefFoundError:

Hi
Which OS?
Please check whether you have spaces in your talend installation path(i.e c:\TOS 4.2.3).
If yes, reinstall in a path with no space.
Regards,
Pedro
One Star

Re: Error : java.lang.NoClassDefFoundError:

I am using Talend 4.2.2 on Windows xp, I have my path in the Below Format & I am getting the same error in the below Format :
Path : D:\TOS-All-r63143-V4.2.2\workspace\TalendWorkSpace

Exception in thread "main" java.lang.Error: java.lang.Error: java.lang.Error: java.lang.Error: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at talenddemosjava.ciscorunner_0_1.CiscoRunner.tJavaFlex_1Process(CiscoRunner.java:1853)
at talenddemosjava.ciscorunner_0_1.CiscoRunner.runJobInTOS(CiscoRunner.java:2149)
at talenddemosjava.ciscorunner_0_1.CiscoRunner.main(CiscoRunner.java:1899)
Caused by: java.lang.Error: java.lang.Error: java.lang.Error: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at talenddemosjava.ciscopull_map_part_0_1.CiscoPull_Map_Part.tMSSqlConnection_2Process(CiscoPull_Map_Part.java:10976)
at talenddemosjava.ciscopull_map_part_0_1.CiscoPull_Map_Part.runJobInTOS(CiscoPull_Map_Part.java:13459)
at talenddemosjava.ciscopull_map_part_0_1.CiscoPull_Map_Part.runJob(CiscoPull_Map_Part.java:13213)
at talenddemosjava.ciscorunner_0_1.CiscoRunner.tJavaFlex_1Process(CiscoRunner.java:1437)
... 2 more
Caused by: java.lang.Error: java.lang.Error: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
disconnected

Any Help Please?
One Star

Re: Error : java.lang.NoClassDefFoundError:

Hi
Have you fixed the below error?
java.lang.NoClassDefFoundError: talenddemosjava/testjob_0_1/TestJob

Could you show me the code of tJavaFlex?
Do you import slf4j jar correctly?
Regards,
Pedro
One Star

Re: Error : java.lang.NoClassDefFoundError:

public void tJavaFlex_1_error(Exception exception, String errorComponent,
final java.util.Map<String, Object> globalMap)
throws TalendException {
end_Hash.put("tJavaFlex_1", System.currentTimeMillis());
tJavaFlex_1_onSubJobError(exception, errorComponent, globalMap);

If I run other Job in my Talend Open Studio also I am getting the Same Issue :
java.lang.NoClassDefFoundError: talenddemosjava/testjob_0_1/TestJob
Caused by: java.lang.ClassNotFoundException: talenddemosjava.testjob_0_1.TestJob
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)
Could not find the main class: talenddemosjava.testjob_0_1.TestJob. Program will exit.
Exception in thread "main"
One Star

Re: Error : java.lang.NoClassDefFoundError:

I am Not able to Fix that Issue, where Shall I load that Jar ,Can you please Help me?
One Star

Re: Error : java.lang.NoClassDefFoundError:

Hi
According to what you say, you'd better delete TOS file and unzip (using 7-Zip) the zip file back into D:\TOS-All-r63143-V4.2.2.
If errors still occur, please report bug at BugTracker.
Regards,
Pedro
One Star

Re: Error : java.lang.NoClassDefFoundError:

So Do u Want me to Delete TOS 4.2.2 by taking backup & Install Again right?
One Star

Re: Error : java.lang.NoClassDefFoundError:

Hi
Yes. I'm sure this error is not related to slf4j jar.
Maybe the TOS files are corrupted.
Unzip TOS with 7-zip. Or you may encounter NoClassDefFoundError again.
Regards,
Pedro

Re: Error : java.lang.NoClassDefFoundError:

This can also happen if you install Talend to a directory containing a space (e.g. "Program Files") if you Talend installed in a directory containing a space, try moving it to one that does not contain a space.
One Star

Re: Error : java.lang.NoClassDefFoundError:

hi,
when i imported the talend job and tried to run in command line i was able to compile but not able to run getting the below error please help me to resolve this issue.
i am also not able to run through the talend tool.i get the following error.
Caused by: java.lang.ClassNotFoundException: talenddemosjava
C:\talend\TOS_DI-r95165-V5.2.1\workspace\.Java\src\talenddemosjava\pdfsplitr_0_1
>java PDFSplitr
Exception in thread "main" java.lang.NoClassDefFoundError: PDFSplitr (wrong name
: talenddemosjava/pdfsplitr_0_1/PDFSplitr)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
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$000(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)
Could not find the main class: PDFSplitr. Program will exit.
Thank's
jones
One Star

Re: Error : java.lang.NoClassDefFoundError:

hi,
and also please help how to add the lib files in talend tool


thank's
jones
One Star

Re: Error : java.lang.NoClassDefFoundError:

for setting the logger do we need to write java class and log4j xml files?
how to add the jars i am getting error even after adding the jar files please guide me