cancel
Showing results for 
Search instead for 
Did you mean: 

Referring external jar in a UDF in PI 7.31

former_member185846
Active Participant
0 Kudos

Dear Experts,

I'm trying to create an UDF using the external commons-codec-1.4.jar. I downloaded the jar file to my desktop and placed it inside the folder path (com/test/encoding/) and imported the jar file to PI 7.31 as imported archive ( i can see the path as com/test/encoding/ in imported archive with file name com.zip)..but, when I use the import com.test.encoding.* in the UDF, its throwing the error package doesn't exist.. not sure what's wrong with this (I'm referring the Imported archive in archived used of function library too)...

Any suggestions?

Thanks.

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member185846
Active Participant
0 Kudos

I think its resolved after I imported the jar file directly (without zipping) and used the import org.apache.commons.codec.binary.*.. thanks everyone for your inputs

former_member185846
Active Participant
0 Kudos

Attached the picture... and in import statement I used com.test.encoding.*   .... pls help..

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Joe,

Once you have downloaded the commons-codec-1.4.zip, you need to extract its contents. There are actually 3 (commons-codec-1.4.jar, commons-codec-1.4-sources.jar, commons-codec-1.4javadoc.jar), you only need to place commons-codec-1.4.jar as an imported archive. Refer it in your archives used and Import Instructions.

Hope this helps,

Mark

former_member185846
Active Participant
0 Kudos

I just downloaded commons-codec-1.4.jar and uploaded as an imported archive. I can upload it as an external jar file and test a simple program using NWDS..But, its not working for UDF. Any clue?

Former Member
0 Kudos

Hi Joe,

             if you are trying to include the external jar i would suggest you to directly add the jar using Add External JARS option in Configure Build path of the project.Once you click on the button you can navigate to desired folder and select the required Jar.This might solve your problem.Please try it

Thanks & Regards,

Keerthi