add jar in routines but keep getting java.lang.NoClassDefFoundError: error

Five Stars

add jar in routines but keep getting java.lang.NoClassDefFoundError: error

I created a routine and right click on that routine then edit routine libraries then add my own jar there. The jar is a very simple one I created myself and tested ok. Then when I import this jar in routine like 

import com.company.myclass

everything looks fine no compile error. Then I use it in my javax component and still no compile error. Only at runtime it throws NoClassFound error. Is there something I missed here?

Community Manager

Re: add jar in routines but keep getting java.lang.NoClassDefFoundError: error

Not sure if there is an issue on your jar, can you try also with tLibararyLoad component in a job to see if it works?

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Employee

Re: add jar in routines but keep getting java.lang.NoClassDefFoundError: error

Hi Alex,

 

      Could you please verify whether the NoClassFound error is for your class (referred in the routine) or some other class indirectly referred by your class?

 

       You are doing the right verification steps and I would strongly suggest to try the option specified by Shong ie to try to create a job with tLibrarayLoad.

 

       I had experience a similar issue in one of my Talend routine where a class for http core was indirectly getting referred from my class. Once I added the indirectly referred class by adding http core library, things started working normally.

 

       Could you please try above step and let us know the results?

 

Warm Regards,

 

Nikhil Thampi

Five Stars

Re: add jar in routines but keep getting java.lang.NoClassDefFoundError: error

Yes using tLoadLibrary resolves the issue. My class is simple so no indirect path yet, but it is a good point to remind myself. Thanks!

Employee

Re: add jar in routines but keep getting java.lang.NoClassDefFoundError: error

Hi Alex,

 

       Good job :-)

 

       Could you please mark Shong's reply as the solution for the topic? It will help the next member in our Talend community if they are searching for the same query.

 

Warm Regards,

 

Nikhil Thampi

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

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 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

APIs for Dummies

View this on-demand webinar about APIs....

Watch Now