How to call ejb from Forms?
Hi.
I have an existing form (version 11.1.2.0.0) and an existing ejb. Both are running on a WebLogic server version 10.3.5.0. I want to call the ejb from the form (I know that this is not recommended, but in this case it is the only sensible solution). I have tried searching the web but I have not been able to find anything about this except some broken links.
Can somebody please explain how to do this or show me some documentation or tutorial?
Regards,
Sveinung
Edited by: SvSig on Aug 7, 2012 11:52 PM
Let's skip the fact that you are asking about an EJB and instead talk about what options are available to call out to any external app or component. Here are some of the options:
<blockquote>1. To make calls from the client machine to any web server (HTTP listener) you can use WEB.SHOW_DOCUMENT. This command simply passes a url to a browser. No return information is passed back into the running form.
2. To make calls from the client machine to almost any process on the client side, including the OS directly, you would need to create a java bean and integrate it into your form. Whether or not you get return information will depend on how you write the bean and to what you are calling.
3. To make calls from the server side (mid tier) part of a running form to an external application or component on the same mid tier you can use the HOST command. This executes a shell command. Although specific information cannot be returned (i.e. return values), you can get pass or fail results.
4. To call out to java applications on the mid tier you can import java code into your Forms application using the Forms Java Importer. This will give you a direct connection to the java application both in and out.</blockquote>
All of the above examples are explained in the Forms Builder online help. There are other options which are explained in the Forms Deployment Guide
<blockquote>http://docs.oracle.com/cd/E24269_01/doc.11120/e24477/toc.htm</blockquote>
Look specifically at chapters 6-8
<blockquote><li>6 Oracle Forms and JavaScript Integration
<li>7 Enhanced Java Support
<li>8 Working with Server Events</blockquote>
Summary
<blockquote><li>WEB.SHOW_DOCUMENT
<li>HOST
<li>Java Bean
<li>Imported Java</blockquote>
Similar Messages
-
How to Call EJB from coldfusion
I need to call EJB that's created in JBoss from coldfusion.
I'm getting different errors depending on how I set the home object
and provider url.
If I prefix provider url with jnp://, then I get the
following error
The connection to the remote JNDI server on host jnp at port
1099 has failed (as have all backup hosts listed, if any) - please
verify that the server is running and the NamingService is
available
If I take the jnp out and keep just the ip address and port,
then i get the following error
null (no security manager: RMI class loader disabled).
So I'm not sure what the issue is and I haven't used this
feature before.
Here's my codeI tries to call custom EJBfrom custom component received
follwong error
ERROR [STDERR] javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException:
No ClassLoaders found for: com.mycom.myapp.action.interfaces.pm.ejb.PmFacadeRemote
(no security manager: RMI class loader disabled)]
any idea?
Thanks
YogLC -
How to call ejb from a Swing gui application client?
Hi Everyone,
I am new to EJB and I have question for calling an ejb from a Swing GUI application client. Can anyone give me an example of how my Swing GUI can call an EJB from a SUN ONE Application Server. If anyone can give me some insight, I appreciate it.I have looked up various sources and just can't get it to work. I know I have to use the lookup() method, but I have also seen lookups using IIOP://servename......
Context ctx = getInitialContext();
DemoHome dhome = (DemoHome)ctx.lookup("demo.DemoHome");
or
Context ctx = getInitialContext();
DemoHome dhome = (DemoHome)ctx.lookup(java:comp/......)
so can anyone tell what is the difference between using iiop://servername..... as the lookup string and java:comp/......
and if using java:comp/ what does this mean? Does it mean that lookup() method is looking for the ejb somewhere in this directory. I would really appreciate if someone can give an example of a Swing GUI calling a ejb from an application server and how the code is actually doing the lookup in and what are each steps it goes through.
Thanks -
HOW TO Call REPORT from FORM usning a Button ?
Hi All,
Please Help me and Help other Beginers in this :
Hot to call a report from a form using WHEN_BUTTON_PRESSED trigger (using Oracle 10g R1)
Should i save the report as .rdf or .jsp ?
Should i save the report in a specific path ?
Should i add the path to the REPORTS_PATH in the registery ?
What about the Report Server ? should i install it first ?
What about the report properties ? what should i change ?
Please Help with Steps to make this sample report with the most important thing which is the PLSQL code we will type in the WHEN_BUTTON_PRESSED trigger.
Regards,
PS. i tried to search in the forum .. but u can imagine how hard it is to look within Messages: 164,066 - Threads: 46,773 - Pages: 3,119 :)Hi there,
Most of the things do not come for free. You need to spend some effort in order to obtain results.
Check run_product, run_report_object built-in.
Also, download the documentation library and go through:
http://www.oracle.com/technology/documentation/devsuite.html
The example of how to use the run_product directly from the book "Oracle Forms Developer Form Builder Reference, Volume 1 - Release 6i.pdf":
RUN_PRODUCT examples
** Built-in: RUN_PRODUCT
** Example: Call a Report Builder report, passing the
** data in record group ’EMP_RECS’ to substitute
** for the report’s query named ’EMP_QUERY’.
** Presumes the Emp_Recs record group already
** exists and has the same column/data type
** structure as the report’s Emp_Query query.
PROCEDURE Run_Emp_Report IS
pl_id ParamList;
BEGIN
** Check to see if the ’tmpdata’ parameter list exists.
349
pl_id := Get_Parameter_List(’tmpdata’);
** If it does, then delete it before we create it again in
** case it contains parameters that are not useful for our
** purposes here.
IF NOT Id_Null(pl_id) THEN
Destroy_Parameter_List( pl_id );
END IF;
** Create the ’tmpdata’ parameter list afresh.
pl_id := Create_Parameter_List(’tmpdata’);
** Add a data parameter to this parameter list that will
** establish the relationship between the named query
** ’EMP_QUERY’ in the report, and the record group named
** ’EMP_RECS’ in the form.
Add_Parameter(pl_id,’EMP_QUERY’,DATA_PARAMETER,’EMP_RECS’);
**Pass a Parameter into PARAMFORM so that a parameter dialog
will not appear
**for the parameters being passing in.
Add_Parameter(pl_id, ’PARAMFORM’, TEXT_PARAMETER, ’NO’);
** Run the report synchronously, passing the parameter list
Run_Product(REPORTS, ’empreport’, SYNCHRONOUS, RUNTIME,
FILESYSTEM, pl_id, NULL);
END;
Hope it helps,
Michael -
Can anyone help how to call JavaBeans from Forms 6i (Urgent !!!!)
Hi,
I'm working on Forms 6i and oracle 8.1.6 database in Client-Server Environment. In forms 6i how to use bean area button. I could able to write a bean program and save it in jar file. But when I attach that to 'bean area', it's not reflecting. Could any one help in this.
Thanks in advance.
Murali.Hi,
I'm working on Forms 6i and oracle 8.1.6 database in Client-Server Environment. In forms 6i how to use bean area button. I could able to write a bean program and save it in jar file. But when I attach that to 'bean area', it's not reflecting. Could any one help in this.
Thanks in advance.
Murali. -
How to call EJB deployed on OC4J from java stored procedure?
Hello,
I'd like to call EJB from java stored procedure. My example works fine from command line, but the problem seems to be with deployment of this code into database. Especialy I'm wondering how to reference jars like oc4jclient.jar, ejb.jar, ... from java stored procedure.
Is there some example how to do that ?
Can You help me please ?
Many thanks,
Radim Kolek,
Eurotel Prague.Hi,
You may want to check up this thread
Calling JBoss EJBs from Java stored procedure
Hope this helps,
Sujatha.
OTN Group. -
Calling report from form. Need PDF output
I am calling a report from a form using RUN_PRODUCT. I need to display the form in PDF format. When the user clicks the button in the form to run the report, acrobat reader should open up and the report displayed there. Please help.
ThanksThanks for the response. The first part worked. I am able to get the output in PDF format. In the 2nd part where I want to open acrobat and display the output, I am having some trouble with the code. When I compile, it says
win_api_environment.read_registry must be declared. Is there some package I need to attach?
Also, in the After reports trigger, how do I pass vFile (I am assuming this is the PDF file name)?
Thanks
The first thing you'll want to do is pass parameters to the report IE DESTYPE, DESNAME and DESFORMAT where these could be FILE, 'c:\temp\report' and PDF.
Then, you can try this piece of code I wrote (with some help from other people at Metalink and here) sometime back. Now, I call it from forms, but in your case, you'd have to run it in the after report trigger. Since with RUN_PRODUCT you don't know when the report is finished, if you did it from the form, it wouldn't work correctly.
PROCEDURE OPEN_PDF(vFile IN VARCHAR2)
IS
vcServerApp varchar2(40);
vcServerTag varchar2(600);
vcCommand varchar2(2000);
iArgPos pls_integer;
dummy NUMBER;
BEGIN
-- 1 get the Server App for .PDF files
vcServerApp := win_api_environment.read_registry('HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\.PDF','',true);
-- 2 get the executable
vcServerTag := 'HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\'||
vcServerApp||'\SHELL\OPEN\COMMAND';
vcCommand:= win_api_environment.read_registry(vcServerTag,'',true);
-- 3 Sort out how to specify the Filename
iArgPos:= instr(vcCommand,'%1');
if iArgPos = 0 then --no substitution Var on the command line
vcCommand := vcCommand||' '||vFile;
else
vcCommand := substr(vcCommand,1,(iArgPos-1))||
vFile||substr(vcCommand,(iArgPos+2));
end if;
-- 4 Run using Winexec (or Host if preferred).
win_api_shell.winexec(vcCommand);
EXCEPTION
when no_data_found then
abortt('Acrobat Reader was not found! Please consult with your help desk to install it and try again.','N');
END;
Chad
I am calling a report from a form using RUN_PRODUCT. I need to display the form in PDF format. When the user clicks the button in the form to run the report, acrobat reader should open up and the report displayed there. Please help.
Thanks -
Calling JSP from Forms and going back from JSP to Forms
Hi,
We are calling JSP from Forms 6i using show_document
I'd like to go back to tha calling Form from the JSP.
How can I construct the URL that would lead me back to the same Form and Forms session where the JSP was called from?
Thanks,
ArpadThanks Shay,
works for me too...
Now:
when I use the "Back" button of my IE to go back from JSP to the Forms session, it works for Jinitiator 1.1.8.19, but if I use Jinitiator 1.3 I got hung...
Any ideas how could I make it work from Jinit 1.3?
Thanks again/
Regards,
Arpad -
Calling EJB from Java Stored Procedures
Hi,
I am trying to call an Enterprise Java Bean from stored procedure. This stored procedure calls a java program. As long as it is a simple java program it works fine and loadjava.exe does not give any problem (neither compile-time nor run-time).
It is not working when I am trying to call EJB from it. It is giving compile-time error.
If anybody has implemented the same please suggest how to go forward.
thanks in advance,
Shashank AgarwalI tried the same thing without any luck. I assume you are using OC4J for your EJB ...
The compiling issue may be because you don't have the classes in your EJB client jar loaded into the database. Once those classes are loaded, you should loadjava without any problem.
However, you won't be able to call the EJB server because the EJB client (your Java code in the DB) will need the OC4J environment (oc4j.jar). I have tried to load oc4j.jar into the DB as well, and that was a big mess and nothing worked. My DB is 8.1.7, maybe the new 9i have OC4J libs bundled?!?
I looked around and only found 2 alternatives:
1. Write a JSP page that acts like an EJB client, then use URLConnection in your DB java code to send params to the JSP for it to invlode the EJB
2. Replace the JSP with RMI code, and use RMI instead of URLConnection in your DB code to invloke the EJB client.
If you find any other solution, please share it here.
Good luck!
Hi,
I am trying to call an Enterprise Java Bean from stored procedure. This stored procedure calls a java program. As long as it is a simple java program it works fine and loadjava.exe does not give any problem (neither compile-time nor run-time).
It is not working when I am trying to call EJB from it. It is giving compile-time error.
If anybody has implemented the same please suggest how to go forward.
thanks in advance,
Shashank Agarwal -
Hello, everybody,
I'm very new at EJB and I'm trying to learn it.
I have created Enterprise Application using Netbeans IDE, I have EJB and APP client. What I want is to connect to my MySql database and get some info from table.
For e.g. Login and Password.
How can I call EJB from my client app which connects to my database and gets information I need?What server you are using?
if you use jboss AS ,here is a simple Main class how to connect EJB and access ejb methods:
package com.david.ejb.client;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;
import com.david.ejb.domain.Person;
import com.david.ejb.domain.PersonRemote;
public class Main {
public static void main(String[] args) {
try {
Context ctx = getInitialContext();
Object obj = ctx.lookup("PersonSessionRemote/remote");
PersonRemote pr=(PersonRemote)PortableRemoteObject.narrow(obj, PersonRemote.class);
Person p=new Person();
p.setName("david");
pr.addPerson(p);
pr.findPerson(1);
// System.out.print(br.find(pk).getAuthor_name());
} catch (Exception ex) {
ex.printStackTrace();
private static Context getInitialContext() throws NamingException {
Properties p = new Properties();
p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.NamingContextFactory");
p.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
p.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
return new InitialContext(p);
}Person is ant @Entity and PersonRemote is remote interfaces, to connect database you have to make datasource file at jboss-4.2.3.GA\server\default\deploy
simle mysql-ds.xml looks like this:
datasources>
<local-tx-datasource>
<jndi-name>some name</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/dbname</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<password>root password</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>100</max-pool-size>
<idle-timeout-minutes>15</idle-timeout-minutes>
<exception-sorter-class-name>com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter</exception-sorter-class-name>
<valid-connection-checker-class-name>com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker</valid-connection-checker-class-name>
</local-tx-datasource>
</datasources>also at resources/META-INF directory you must have persistence.xml like this
<persistence>
<persistence-unit name="SimpleEjb">
<jta-data-source>java:/some name</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
</properties>
</persistence-unit>
</persistence> -
Calling Report From Form To Many Destinations
Hi
I am calling reports from forms using SET_REPORT_OBJECT_PROPERTY and then run_report_object.
I dont know the destination until runtime of the report which is ok as I can pass this in via my procedure, but if that destination is many ie mail and file what is the best way to distribute the report?
I could call my procedure for each destination but that seems a bit unefficient since the report would be created many times, is there another way?what about adding a drop-down-list near your report-button where you can choose the destination?
when you click the report-button you simply read the value selected in the drop-down-list and send it to your reports-server too. -
Calling Report from Form Error ORA-06508
Dear all,
I want migrate from Fom6i to Oracle Developer Suite 10g (10.1).
Folder Form = C:\APLIORA\IRS\FORM
Folder Report = C:\APLIORA\IRS\REPORT
I have modified file DEFAULT.ENV
FORMS_PATH=C:\APLIORA\IRS\FORM;C:\APLIORA\IRS\REPORT
i do not have problem call a form from form.
but when i call report from form show error ORA-06508 : PL/SQL : could not find program unit being called ; -6508
my procedure is
PROCEDURE Call_Report IS
list_id ParamList;
BEGIN
list_id := Get_Parameter_List('input_params');
IF NOT Id_Null(list_id) THEN
Destroy_Parameter_List(list_id);
END IF;
list_id := Create_Parameter_List('input_params');
Add_Parameter(list_id,'MAXIMIZE',TEXT_PARAMETER,'YES');
Add_Parameter(list_id,'ORACLE_SHUTDOWN',TEXT_PARAMETER,'YES');
RP2RRO.RP2RRO_RUN_PRODUCT(REPORTS,'TESTREPORT.REP',SYNCHRONOUS,RUNTIME,FILESYSTEM,list_id,null);
END ;
Do I miss something ?
Can any one help ?
ThanksHi,
Thank you for your replay.
The problem have solved.
This my step :
1. Install Windows XP SP2 and Form 10.1.2.0.2 on new pc.
2. Install Jinit version 1.3.1.28.
3. Create report server
3. Compile form, report and pll
4. call report from from with this procedure :
PROCEDURE Call_Report (vFILENAME varchar2) IS
report_id Report_Object;
ReportServerJob VARCHAR2(100);
vc_rep_status VARCHAR2(100);
repsvr varchar2(21) := 'myserv';
userid VARCHAR2(100);
pass VARCHAR2(100);
Host VARCHAR2(100);
BEGIN
userid := Get_Application_Property(USERNAME) ;
pass := Get_Application_Property(PASSWORD) ;
Host := Get_Application_Property(CONNECT_STRING) ;
report_id:= find_report_object('REPORT');
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_FILENAME,vFILENAME||'.jsp');
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER,repsvr);
ReportServerJob:=run_report_object(report_id);
vc_rep_status := REPORT_OBJECT_STATUS(ReportServerJob);
WHILE vc_rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED', null)
LOOP
vc_rep_status:=REPORT_OBJECT_STATUS(ReportServerJob);
END LOOP;
IF vc_rep_status='FINISHED' THEN
WEB.SHOW_DOCUMENT('/reports/rwservlet?report='||vFILENAME||'.jsp'||'&userid='||userid||'/'||pass||'@'||Host||'&destype=CACHE&desformat=PDF¶mform=yes','_blank');
ELSE
message ('Report failed with error message '|| vc_rep_status);
END IF;
END;
Ok, but i have another strange error. I will post new thread.
Thank you and regards
Teguh S -
Hi All,
We are migrating form from Oracle form 6i to Oracle 10g(10.1.2.0.2). I am calling reports from forms
using Web.Show_Docment(). When we run reports in report builder 10g it works fine.
But when we try to run reports from Forms 10g it throws error which is given below.
We want to run reports from UNIX. After using this url to submit report we get error REP 110 and REP 0110
URL
http://GEM:7777/reports/rwservlet?server=rep_server&report=/u01/forms/QA_Forms10g/GEMREP.rdf+DESTYPE=CACHE+DESFORMAT=HTML+p_user_id=XYZ+p_client=2
ERROR
REP-110: File '/u01/forms/QA_Forms10g/GEMREP.rdf DESTYPE=CACHE DESFORMAT=HTML p_user_id=XYZ p_client=2' not found.
REP-0110: Unable to open file '/u01/forms/QA_Forms10g/GEMREP.rdf DESTYPE=CACHE DESFORMAT=HTML p_user_id=XYZ p_client=2'.
I will really appreciate your help.
Thanks
SandyHello,
You are mixing 2 separators in the URL : & and +
Use only one separator in the URL :
Example :
http://GEM:7777/reports/rwservlet?server=rep_server+report=/u01/forms/QA_Forms10g/GEMREP.rdf+DESTYPE=CACHE+DESFORMAT=HTML+p_user_id=XYZ+p_client=2
Regards -
Urgent: how to run report from forms runtime
hi
can anybody tell me how to call reports in forms through menu
i just forgot how to call...
exact menu item code!!
rgds,Dear
if u are using client server then use this code
Run_Product(REPORTS, 'd:\emp.rep', ASYNCHRONOUS, RUNTIME,
FILESYSTEM, 'x', NULL);
if u r wsing web then use this code
Web.Show_Document('/reports/rwservlet?server=myrepserv&report=test.rdf&userid=scott/tiger@mydb&desformat=pdf&destype=c
ache¶mform=yes', '_blank');
M Rizwan -
Hello Developers!
I deployed my ejb to OAS4081. I call that
from JDeveloper so it good. But when I try
to call from applet in IExpl5 I can't
instantiate the ORB. I've got a com.ms.security.SecurityException : oracle.oas.orb.CORBA.ORB.init
I coded the CLASSPATH(oasoorb(yoj),client,
ejbapi...) perfectly, I think.
If anybody could help, please...
Thanx!Hi there,
I saw someone on this group had a problem to locate proper classpath
to call EJB from JSP. I thought if you call EJB from classpath, you are
calling the bean. But you loss all the EJB functions. To be able to utilize
EJB features like object pooling. You need to call it from Weblogic server
using url/jndi, not from the jar directly.
Any comment? Am I right?
BTW, my question about calling EJB from JSP means calling through URL,
not a local path.
Thank you
>-------------------------------------------------------------------->
Jim wrote in message <[email protected]>...
>Hi there,
> Can I call EJB from JSP? Is there a particular security setting or
>concern for Weblogic? Is there an coding example?
>
>Thank you
>
>
Maybe you are looking for
-
How do you make a text input control behave like a normal web form control that displays suggestion as you type in the control. I'm sure Flex can do this I am apparently looking in the wrong places. Any help would be greatly appreciated. Thanks so mu
-
Hi can I install lightroom 5 on my pc and laptop with one licance
-
How Come Some Clips Need To Be Rendered
Hi, I have several projects open, one is from standard def DV tapes and the other is from a FCP learning tutorial. When doing 3 way color correcting the project from the DV tapes needs to be rendered after changes while the tutorial files don't need
-
Hello everyone, Recently my installation of lightroom has stopped loading giving this error message: Adobe Photoshop Lightroom 5 cannot be opened because of a problem. Check with the developer to make sure Adobe Photoshop Lightroom 5 works with this
-
Hello I hope this isnt a repeated request but had a quick look and couldnt really find my answer.. Ive got a new machine at work and trying to get my music restored from my Zen Touch (20GB). I've installed the drivers and the Nomad explorer... but wh