cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping activation error-Source code has syntax errors in UDF

Former Member
0 Kudos

Hi all,

I wrote a small UDF for sum of 2 numbers:

import

udf.*

public String getsum(String a, String b, Container container) throws StreamTransformationException{

int c = Integer.parseInt(a);

int d = Integer.parseInt(b);

int e = packageDemo.getSum(c,d);

return e+"";}

In imported archives, i imported pack.jar

In D:\udf , I have packageDemo.java, packageDemo.class, aii_map_api.jar, pack.jar(has the other 3)

packageDemo.java :-

package udf;

public class packageDemo{

public static int getSum(int a,int b)

{

int c= a+b;

return c;

}}

Did i miss anything?? Icant activate message mapping for 2 errors:-

1.package udf does not exist

2.Function getsum, Line 3:

cannot find symbol symbol : variable packageDemo location: class com.sap.xi.tf._xml_mm_int e = packageDemo.getSum(c,d); ^Note: /usr/sap/P7R/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd4214d3099dc11dd9470001d090e4bbe/source/com/sap/xi/tf/_xml_mm_.java uses or overrides a deprecated API.Note: Recompile with -Xlint:deprecation for details.Note: /usr/sap/P7R/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd4214d3099dc11dd9470001d090e4bbe/source/com/sap/xi/tf/_xml_mm_.java uses unchecked or unsafe operations.Note: Recompile with -Xlint:unchecked for details.2 errors

Edited by: NagaDurga Nannapaneni on Oct 16, 2008 1:07 PM

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi ,

Think the error is coming because the content in imported archive is not being taken into message mapping at all...so package, class, method ..nothing is identified.

Can anyone suggest the solution..

Thanks,

Durga

Former Member
0 Kudos

Hi,

I think before using the "return" statement you have to convert the integer into string. You are using "return c" where c is a integer.

Regards,

Sarvesh

prateek
Active Contributor
0 Kudos

Why and how are u using StreamTransformationException. Try to run the scenario removing this. And import only the class file as a jar file.

Regards,

Prateek

Former Member
0 Kudos

Hi Prateek,

Iam using PI 7.1..In that StreamTransformationException comes default and i also tried importing only the class file as a jar file..but in vain..same error..

Former Member
0 Kudos

Hi,

why do you need the getSum method?

>int e = c + d;

Regards

Patrick