-----Google Analytics Code Start----> <-----Google Analytics Code Close---->
Home |
Technical Articles |
Training Articles |
Receive Email for New Articles |
Contributors |
Apps Book |
Java Concurrent Programs in Oracle | | Print | |
Written by Anil Passi | |
Monday, 04 December 2006 | |
Please find an article that explains basics of a Java Concurrent Programs, with a working example, ciring various features of a Java Concurrent Program. Why the need for java concurrent program when we can write pl/sql concurrent programs? Let’s admit PL/SQL is primarily an Oracle database language. What if you wish to do the following seamlessly in a single pl/sql concurrent program:- Scenario 1. FTP the file from a server securely, validate and load into apps using an API Scenario 2. Connect to a non-oracle database using JDBC, fetch the data, load into Apps Custom tables, validate/transform and interface using API. For the above scenario (1), yes you may find a way of doing so PL/SQL, but that will be clumsy, as you will write a host program followed by loader, followed by Oracle PL/SQL. However in case of Java Concurrent Program, you can google on ftp classes, download, put those into your CLASSPATH, and its there to be used. For scenario(2), in PL/SQL your DBA will need to setup Gateways, which is an infrastructural overhead, and also an overkill for simple requirement just to get data from a SQL*Server. What should be the best practice for developing Java Concurrent Program? Do not try to write massive PL/SQL operations inside java concurrent program directly. For simplicity, call a PL/SQL package procedure/function with parameters from java concurrent program. I tend to use java only where PL/SQL is found to be deficient. I wish to interface newly created employee records from PeopleSoft regularly, given that this specific PeopleSoft instance is in SQL*Server database, tell me the steps for such point to point interface? 1. Download free jdbc driver for SQL*Server from this link to an educational site 2. Unzip the jdbc zip file on you server, note down the directory location. You may decide to dump that into $JAVA_TOP, but please do not clutter JAVA_TOP in apps. 3. Open jDeveloper, and ensure that your project has in its CLASSPATH the entire oracle FND Classes. You may need to FTP those classes from $JAVA_TOP/oracle/apps/fnd to your PC. Although, I vaguely remember that FND Classes come bundled with patch 4573517. Develop your java concurrent program class xxInterfaceFromPeopleSoft, by implementing class JavaConcurrentProgram 4. Navigate to Application Developer responsibility, Register concurrent program executable xxInterfaceFromPeopleSoft of type java 5. Define concurrent program, and in option field enter the CLASSPATH. See the next step carefully. 6. CLASSPATH...you can either change the CLASSPATH of the Oracle Apps environment or you can override the CLASSPATH per concurrent program. I think the decision will be driven by how many Java Concurrent Programs you plan to develop. Anyway, in the option field, include the following directories with their absolute path $JAVA_TOP:apps.zip with path:appsborg.zip:your custom directory where java/jdbc files will be stored. 7. In java concurrent program do this.... Inside main -->Open JDBC connection to Sql*Server Note: - You already have a connection object for APPS, given by CpContext.getJDBCConnection() -->Here lies the beauty, you have now connections to both SQL*Server and Apps in one single program. -->Get the records into result set. -->Call the PL/SQL wrapper code, which in turn will use TCA API’s You can write into Concurrent program log within java concurrent program. Before I paste a sample java concurrent program, let’s have some important notes:- Comments
(24)
![]()
Anil,
I am trying to do something similar as the sample code above. The code would be a great help . Thanks! I have 2 questions: 1. On which location should we usually keep a custom java class. Should we define in a new package or keep it under the apps package. I dont see any standards mentioned for custom java files. Your java class is not under any package currently. 2. I am planning to send an email to a predefined group informing about any failure of the concurrent request. Should I be writing a java sendmail class or call in pl/sql procedure from java using sendmail. ![]() written by ajay singh , December 29, 2006
hai anil
my name is ajay singh i m from mumbai .i m new for oracle apps technical . i want more information ab this and also want to do the project . can you guide me ![]() written by ajay singh , December 29, 2006
hai anil
my name is ajay singh i m from mumbai .i m new for oracle apps technical . i want more information ab this and also want to do the project . can you guide me ![]() written by Suresh , December 30, 2006
thank u very much for ur informative website it is very helpfull to me and i have few clarifications as listed below in the OA frame work plss help me in this
1.How to insert the data in to the tables by oa frames? 2. How to register the frame designed in the OA Framework in to apps? 3. How to see and personalize the Frames already exiasting in the apps these are the three big Question Marks for me in the OA Framework, i request u plsss help me in this issues plsssss.... i know u ill help me... thankssssss MY MAil : s_l_babu@Yahoo.co.in plsss send me the mail ![]() written by Suresh , December 30, 2006
thank u very much for ur informative website it is very helpfull to me and i have few clarifications as listed below in the OA frame work plss help me in this
1.How to insert the data in to the tables by oa frames? 2. How to register the frame designed in the OA Framework in to apps? 3. How to see and personalize the Frames already exiasting in the apps these are the three big Question Marks for me in the OA Framework, i request u plsss help me in this issues plsssss.... i know u ill help me... thankssssss MY MAil : s_l_babu@Yahoo.co.in plsss send me the mail ![]() written by Runa Shrivastava , January 30, 2007
Hi Anil,
I did not thank you for your quick response to my queries. I was checking up your other articles and you are doing a great job with this site here!! Thank You. Runa ![]() written by kumar , April 05, 2007
Hi Anil,
I liked this site very much. The articles here are great and worth reading ![]() written by kumar , April 05, 2007
Hi Anil,
I liked this site very much. The articles here are great and worth reading ![]() written by Pritosh , May 13, 2007
Is there any API documentation available on
import oracle.apps.fnd.cp.request.* ; import oracle.apps.fnd.util.*; ![]() written by Anil Passi , May 14, 2007
Hi
Indeed there is documentation plus the java doc from OAF-jDeveloper[download the patch]. You can also look at sample programs in metalink and more importantly code for some of the seeded java concurrent programs delivered by Oracle. If you have any specific questions on those APIs, then please feel free to ask Thanks, Anil Passi ![]() written by Anil Passi , June 28, 2007
Thanks Rehan
We tried ............
6. CLASSPATH...you can either change the CLASSPATH of the Oracle Apps environment or you can override the CLASSPATH per concurrent program. I think the decision will be driven by how many Java Concurrent Programs you plan to develop. Anyway, in the option field, include the following directories with their absolute path $JAVA_TOP:apps.zip with path:appsborg.zip:your custom directory where java/jdbc files will be stored. We got................... Exception in thread "main" java.lang.NoClassDefFoundError: oracle/apps/fnd/cp/request/Run Any ideas?
Hi Anil,
Thanks a lot for your wonderful articles. I learned a lot from this blog. It would be great if you can put some articles on JSP customization in apps as well That would be really helpful thanks
Hi Dan,
I have the same issue... I am in a Catch-22 situation. No matter what I put in the "Options" text field, even any gibberish, I get the same error - Exception in thread "main" java.lang.NoClassDefFoundError: oracle/apps/fnd/cp/request/Run. When I leave the "Options" field blank I get java.lang.ClassNotFoundException: . Anil, do you have any suggestions? ----------------------------------------------------------------------- We tried ............ 6. CLASSPATH...you can either change the CLASSPATH of the Oracle Apps environment or you can override the CLASSPATH per concurrent program. I think the decision will be driven by how many Java Concurrent Programs you plan to develop. Anyway, in the option field, include the following directories with their absolute path $JAVA_TOP:apps.zip with path:appsborg.zip:your custom directory where java/jdbc files will be stored. We got................... Exception in thread "main" java.lang.NoClassDefFoundError: oracle/apps/fnd/cp/request/Run Any ideas? ![]() written by Hariram , October 18, 2007
If i want to see the source code of the java file which they used to develop the java concurrrent program, where would it be.
any standard path they would be in ?
I too followed your instructions on setting the classpath and received the same error as Dan and JkJk...
On analyzing I realized that Oracle Apps while executing the Java Concurrent Program is converting all periods "." to slashes "/" and hence it can not resolve anything. You must be having some work around. Can you please guide me as to how can I over-come this issue? Thanks. -Sanket ![]() written by Sanket , January 08, 2008
In the OPTIONS write the following
-classpath full_path_to_$AU_TOP/appsborg.zip:full_path_to_ur_directory/ur_classes.jar:full_path_to_ur_directory/ur_classes.zip It is working GREAT now. :-D Thanks. -Sanket
hello Anil,
Coming back the API documentation bit, i was trying to make a JCP which submits another programatically. But I'm challenged by the documentation available on the seeded classes (ex. oracle.apps.fnd.cp.request.ConcurrentRequest). So, I raised a SAR with oracle to check availability on the documentation and I've been there isn't any. I see a lot of potential for reusing some of the seeded classes in our custom programs, but the developer would be hampered by the lack of Javadoc for these classes. Any thoughts around this ? regards, Rehan Yusuf
Hi Anil,
Great website!! you are going great help to the Oracle apps community for spreading knowledge. I have a question realted to this article. I am trying to find the documentation which outlines the tecnical details regarding Java concurrent program. Alos,want to know where can I get the documentation for all the AOL packages for Java concurrent programs. -Thanks again, Satya
I want to modify 'PoGenerateDocumentCP.class' which is registered as java concurrent program
.This is a first customisation we are doing on java concurrent program. Could you please send me steps implement after modifying this program. Should i change name of this program and copy under custom top retaining original path. Could you send steps for this customisation.
Hi Anil,
I am new to Oracle Apps, i tried to Register a Sample Java Concurrent Program which Prints "Hello World" in Output file and Log file. I registered the Java Class file successfully, when i tried to run the Program from Apps frontend its completing with error i found following Exceptions in Log file of the Request. I have compiled the Java Program in JDK 1.5_0_7 What steps i need to take to resolve this problem ? java.lang.UnsupportedClassVersionError: oracle/apps/fnd/gems/Hello (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at oracle.apps.fnd.cp.request.Run.main(Run.java:157) Thanks in Advance, You must be logged in to a comment. Please register if you do not have an account yet.
|
I am trying to do something similar as the sample code above. The code would be a great help . Thanks!
I have 2 questions:
1. On which location should we usually keep a custom java class. Should we define in a new package or keep it under the apps package. I dont see any standards mentioned for custom java files. Your java class is not under any package currently.
2. I am planning to send an email to a predefined group informing about any failure of the concurrent request. Should I be writing a java sendmail class or call in pl/sql procedure from java using sendmail.