on 10-16-2008 12:03 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
why do you need the getSum method?
>int e = c + d;
Regards
Patrick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.