on 04-05-2016 2:12 PM
Hi Experts ,
We have a requirement for filelookup and we have written the UDF for it. In the UDF we are using URL and InputBufferReader and therefore we require java.net.* JAR package. Please suggest a location to download the same from. If the file is available in the PI Installation or server location, Please share the path for it as well.
Thanks in advance.
Amitosh Srivastava
Hi Amitosh,
You don't need to download a jar to use the Java.net package as ist part of the jdk that PI uses.
If you want to use it in your UDF you only need to delcare in your Import packages "java.net.*"
Btw to use BufferedReader it would be "java.io.*" package in your imports
Best regards
Sebastian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sebastian,
Even after importing the packages java.net.* and java.io.* in mapping . I am getting the below error :
Can you kindly suggest.
Hi Amitosh,
The reason of this error might not be due to wrong import. To investigate the cause need to go through entire code. A "Cannot find symbol" error means that the compiler cannot do this. Your code appears to be referring to something that the compiler doesn't understand.
For example, maybe you "star" imported java.io.* and then tried to use the Files class ... which is in java.nio not java.io. Or maybe you meant to write File ... which is a class in java.io.
Please paste your code as a function in eclipse or NWDS. remove all import statements. Now it will prompt you suggestions to correct the errors if you right click on location of those errors. Once you select the correct options exact import statements will show up. Then you can add those classes in the UDF. I guess by this way you can get rid of these errors.
Regards
Anupam
Hi Amitosh,
Please check this link File Lookup in UDF - Process Integration - SCN Wiki
You do not need to use "InputBufferReader" in your UDF. This can be achieved using standard classes.
You can face issue with URL class. which can be resolved using this line in the code
try {
java.net.URL url=new java.net.URL("xyz.com");
} catch (MalformedURLException e) {
e.printStackTrace();
}
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amitosh,
You have not provided the code you are using here, still I am sure you can replace "InputBufferReader" with "InputStreamReader" i.e java.io.InputStreamReader.
Thus you need to e use below import statements
import java.io.InputStreamReader;
import java.net.URL;
In case you have issues compiling, please post the code.
Will look into it.
Regards
Anupam
Hello Amitosh,
In UDF I dont think you need deploy any Jar.
Try maintaing the below Import in the UDF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.