cancel
Showing results for 
Search instead for 
Did you mean: 

UDF does not find package in imported archive

Former Member
0 Kudos

Hello,

as I want to use a base64 encoding method I have created an imported archive to use the package org.apache.commons.code.binary and want to use Base64 class in an UDF.

I have created an imported archive in the same SVCW and namespsace as the UDF exists. However when executing the UDF I get the following error message:

package org,.apache.commons.codes.binary. does not exist

import org.apache.commons.codec.binary.*

The import statement in the UDF is spelled correctly and the imported archive was acitvated without error.

What could be the reason for this?

Accepted Solutions (1)

Accepted Solutions (1)

former_member181962
Active Contributor
0 Kudos

Hi Florian,

have you specified this statement "import org.apache.commons.codec.binary.*

' in the code section of the udf or the import section of the UDF?

If you mentioned it in the import section, make sure that you have a ";" at the end and not a "."

Regards,

Ravi

Former Member
0 Kudos

Additional Info: I have mentioned the import in the import section and not the code section.

prasannakrishna_mynam
Contributor
0 Kudos

Hi,

if you mentioned import statement explicitly, there is no need to do that, you can remove the import before the package name, and write your package name instead

eg:- org.apache.commons.codec.binary.; not import org.apache.commons.codec.binary.;

Regards,

Prasanna

Former Member
0 Kudos

Yes, this is also was I tried, removing the import from the import section and have the full package name in front of the class.. However the error is still the same....

Former Member
0 Kudos

Sorry this was a misunderstaning, of course I have not written Import statement in the import section, just naming the package

Former Member
0 Kudos

hi Florian Guppenb,

i have met the same issue, do you have solved this problem?

if yes, can you give me your solution ?

thanx.

Answers (3)

Answers (3)

Former Member

check - Message Mapping -> Functions tab --> Archives Used tab ( import the jar file (imported Archivers))

if you not import the Archives Used tab ,

you canot use the udf with ur *.jar (zip)

former_member434280
Discoverer
0 Kudos

thanks for this. i forgot about adding the libraries to be used in this part of the mapping. quick fix for me.

prasannakrishna_mynam
Contributor
0 Kudos

Hello,

I have created an imported archive in the same SVCW and namespsace as the UDF exists. However when executing the UDF I get the following error message:

package <org,.apache>.commons.codes.binary. does not exist
import org.apache.commons.<codec.>binary.*

The import archive procedure you have done is correct. In your UDF check your importing statement as its not in correct syntax.

and also check the spelling of the package. check the words i have marked with in tags.

Regards,

Prasanna

Former Member
0 Kudos

package <org,.apache>.commons.codes.binary. does not exist

import org.apache.commons.<codec.>binary.*

Sorry, was working on two notebooks So I typed it here in the forum in rather than copy and paste. However in the UDF it is spelled correctly. However I still get the same error:

package org.apache.commons.codec.binary does not exist

import org.apache.commons.codec.binary.*;

Former Member
0 Kudos

what I undestood is that you have created the java program ,in the java program you used the package org.apache.commons.codec.binary.* Now you want to use the java program in the udf.You need not import package org.apache.commons.code.binary in the udf but you have to import your java program which you have in the imported archive

important points


user-defined function is only visible in the message mapping in which you created it

You can use your Java programs from imported archives in user-defined functions if the Java programs are located in the same, or an underlying software component version as the message mapping.