Implementing java beans in forms 10g [Problem]

Hi All,
I am trying to implement the java bean in the forms 10g
I performed the following steps, but no luck.. Could anybody please help me in this?
I have created a simple java class
package mypackage1;
public class MyClass
public String GetString(String a)
return a;
Make a jar myjar.jar out of it.
Copy this jar files in $ORACLE_HOME/forms/java directory
and set the archive.jini parameter in formsweb.cfg to
archive_jini=frmall_jinit.jar,Myjar.jar
Created a simple form having one button, one textbox
Set the implementation class property of text item to mypackage1.MyClass
on button pressed trigger, I wrote
set_custom_property('block2.text_item4',1,'GetString','Hello World');
Ideally, on button pressed, it should show the text "Hello World" in the etxt box. But on button pressed nothing is happening and in java console on error is appearing.
My java console output is
Loading http://asst104253:8889/forms/java/frmall_jinit.jar from JAR cache
Loading http://asst104253:8889/forms/java/Myjar.jar from JAR cache
proxyHost=null
proxyPort=0
connectMode=HTTP, native.
Forms Applet version is : 10.1.2.0
Could anyone please tell me what I am doing wrong?? And how do I achieve this functionality??
Please, any help appreciated !!

Hi there
The is plenty wrong with this code:
1. MyClass is not extending VBean
2. There is no public boolean setProperty(ID ID, Object args) method and no property IDs have been defined so set_custom_property('block2.text_item4',1,'GetString','Hello World'); will not execute anything
3. If you're hoping to return values back from the bean, you need to define a custom event and associated ID.
If you're just looking for some java code to return values in a similar manner as normal Oracle functions then you may want to consider using forms java stored procedures which are based on static java methods. Beans are really more for interaction type stuff with other applications.
But any way if you want to do it this way (i.e. using beans) then at very least you class should look something like (Note, I have not compiled is so there may be a few errors):
package mypackage1;
import oracle.forms.handler.IHandler;
import oracle.forms.ui.CustomEvent;
import oracle.forms.properties.ID;
import oracle.forms.ui.VBean;
import oracle.forms.engine.Main;
import oracle.forms.engine.*;
import oracle.forms.handler.*;
public class MyClass extends VBean
// initiating event id
protected static final ID pgetString = ID.registerProperty("GetString");
// return value id
private static final ID preturnValue = ID.registerProperty("returnValue");
// return event id
protected static final ID preturn = ID.registerProperty("returnEvent");
static IHandler mHandler;
public String GetString(String a)
// may do some string manipulation here.
return a;
public boolean setProperty(ID ID, Object args)
if (_ID== pgetString)
if (_args instanceof String)
String myArg = (String)_args;
mHandler.setProperty(preturnValue,getString(myArg));
CustomEvent ce = new CustomEvent(mHandler, preturn);
dispatchCustomEvent(ce);
Keep your button as is and then to return the value back into forms place a WHEN-CUSTOM-ITEM-EVENT trigger on the bean area with something like this:
DECLARE
     BeanValListHd1 PARAMLIST;
     ParamType NUMBER;
     EvenName     Varchar2(20);
     CurrentValue Varchar2(2000);
BEGIN
     BeanValListHd1 := get_parameter_list(:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS);
     IF :SYSTEM.Custom_Item_Event = 'returnEvent' THEN
          IF iD_NULL(BeanValListHd1) THEN
          MESSAGE('NO PARAMETER FOUND FOUND');     
          ELSE
          GET_PARAMETER_ATTR(BeanValListHd1,'returnValue',ParamType,CurrentValue);
          MESSAGE('IN CUSTOM EVENT THE STRING RETURNED IS '|| CurrentValue);
          END IF;
     ELSE
          MESSAGE('no value');
     END IF;          
END;
hope this helps
Q

Similar Messages

  • Integrating BI Beans into Forms 10g

    Hi all,
    <br><br>
    We have our application built using Oracle Forms and Reports 10g R2. I am thinking that BI Beans would highly inhance the reports in our application.
    <br><br>
    If my idea is true, <b>is it possible to use Oracle BI Beans in Forms 10g?</b> Any guideline or related link would be highly appreciated.
    <br><br>
    Thanks.

    hello,
    i use the formsgraph.jar into my test_forms,the data is display ok,but the Y axis scale i didn't solute it what i want to display.
    for example:
    7|
    6|
    5|
    4|
    3|
    2|
    1|
    0|_______________________________________________________________
    0 1 2 3 4 5 6
    my problem is that how i can define the Y axis what i want it to display.that only display 0-2-4-6-8-10-12 if recompile the java codes ,where i can modify???
    please help me !
    thanks!!

  • Embedding Java bean in Forms 6i

    Hi,
    Can anybody guide me to embed java bean in forms 6i . I need steps to embed. I tried the steps given in oracle site for KnobBean steps are confusing. Can anybody pls help me
    thanks in advance
    Ilam

    Hi
    Following is the result of Jinitiator Java Consol.......
    Oracle JInitiator version 1.1.8.19
    Using JRE version 1.1.8.19
    User home directory = C:\Documents and Settings\Administrator
    JAR caching enabled.
    Cache directory: C:\Program Files\Oracle\JInitiator 1.1.8.19\jcache
    Maximum cache size: 50000000 bytes
    Opening http://202.163.88.194:6777/forms60java/f60all_jinit.jar no proxy
    Loading http://202.163.88.194:6777/forms60java/f60all_jinit.jar from JAR cache.
    Opening http://202.163.88.194:6777/forms60java/java/awt/KeyboardFocusManager.class no proxy
    Opening http://202.163.88.194:6777/forms60java/oracle/forms/engine/MainBeanInfo.class no proxy
    Opening http://202.163.88.194:6777/forms60java/sun/beans/infos/MainBeanInfo.class no proxy
    Opening http://202.163.88.194:6777/forms60java/oracle/ewt/swing/JBufferedAppletBeanInfo.class no proxy
    Opening http://202.163.88.194:6777/forms60java/sun/beans/infos/JBufferedAppletBeanInfo.class no proxy
    Opening http://202.163.88.194:6777/forms60java/oracle/ewt/lwAWT/BufferedAppletBeanInfo.class no proxy
    Opening http://202.163.88.194:6777/forms60java/sun/beans/infos/BufferedAppletBeanInfo.class no proxy
    Opening http://202.163.88.194:6777/forms60java/oracle/ewt/popup/PopupAppletBeanInfo.class no proxy
    Opening http://202.163.88.194:6777/forms60java/sun/beans/infos/PopupAppletBeanInfo.class no proxy
    Opening http://202.163.88.194:6777/forms60java/oracle/forms/registry/Registry.dat no proxy
    Opening http://202.163.88.194:6777/forms60java/oracle/forms/registry/default.dat no proxy
    proxyHost=null
    proxyPort=0
    connectMode=HTTP
    Forms Applet version is : 60821
    Opening http://202.163.88.194:6777/forms60java/oracle/forms/demos/GetClientInfo.class no proxy
    Opening http://202.163.88.194:6777/forms60java/oracle/forms/demos/Utils.class no proxy
    Regards
    Laila Mac

  • Printing Java Bean through Forms

    I want to be able to print the contents of a Java bean through forms. Preferably through a popup on right click. Does anyone know how i can do this?
    It is the BI Graph example given through oracle.
    Thanks

    Hi,
    I'd like to be able to do the same thing ... did you find a solution?
    Steve

  • How to include PJC and Java Beans in forms

    I have tried a lot to include java codes in my forms ..So I decide to start with ProgressBarPJC(cause it is tested and provided with demo) but I could not set implementation class of java bean object to
    oracle.forms.demos.ProgressBarPJC it does not accept it but it accept ProgressBar instead of ProgressBarPJC. I don't know why? I have made changes in Forms90_builder_classpath to access f90all.jar and progressbar.jar. I have Progressbar.class and progressbarpjc.classs both but i don't know how to set implementation class to ProgressBarPJC.
    don't you think there is lots of configuration and path setting to use any JPC or Jar in forms? I am totally confused with this integration.
    Please solve this matter
    Thanking you,
    Neeraj

    and even more information samples and step by step instructions are on the Java spotligh on the Forms Upgrade Center : http://otn.oracle.com/formsupgrade

  • Can't Import java class in form 10g

    Hi All,
    I have tried to call a web service from oracle form 10g
    so, I read your available document (How to call Web service from Form 10g)
    http://www.oracle.com/technology/obe/obe_as_10g/deploy/callws_fromforms/forms_webservice.htm#r1
    but when I've created a web service from WSDL file and I've deployed it to JAR file using Jdeveloper 10g (10.1.2.1.0).
    I tried to import it into form builder 10g but i have the error :
    java.lang.NoClassDefFoundError: oracle/jdeveloper/webservices/runtime/WrappedDocLiteralStub
    Please, can any body help me to solve this problem?

    Have you put the jar file in the classpaths??

  • Using java bean in forms

    Hi,
    I want to import data from an excel file to oracle database. for this purpose i have find a java bean on :
    http://sites.google.com/site/jvrexcelproject/version-1-5-1-english
    i have download it.
    i put the jar files on forms/java
    i ve modify formsweb.cfg
    when i open my form , a message is displayed :
    FRM-13008: Cannot find JavaBean with name 'oracle.forms.jvr.xls.Read'
    please help me,
    thanks

    add Bean area in your form and set its Implementation class to oracle.forms.jvr.xls.Read (case sensitive)
    yesterday i wrote a new blog post about java bean but very basic ....... might help u to setup the thing
    http://baigsorcl.blogspot.com/2010/02/how-to-add-java-bean-by-writing-your.html
    Baig
    [My Oracle Blog|http://baigsorcl.blogspot.com/]

  • Java bean in  form version 6.0

    Does anyone know if it's possible to put a javabean into a forms (v6) in runtime mode ie client server mode (no webforms)?.
    If it is possible ... how can i do it?
    I want to change the look and feel of my form.....how can i do it if java bean is not supporting forms 6.0 in client server mode
    Thanks in advance
    shareef

    Hello,
    You should ask this question in the Oracle Forms Forum :
    Forms
    Regards

  • How to call java classed in forms 10g

    Hi
    I am using forms 10g
    There is a java class email_class (to send emails and attachments). this java class (email_class) has further used two moere .jar files (activation.jar & mail.jar).
    Now I want to use this java class (email_class) in my form to send email and attachment.
    Could you please help me how can I do that?
    regards

    The jar file must be included in CLASSPATH which is set in the Forms default.env (or your own custom env if you created one). If you have not jar'd the class files, then the path to the class files should be included in CLASSPATH. Here is a simple example. Your CLASSPATH will contain many more entries.
    CLASSPATH=D:\oracle10g\iDS1012\j2ee\OC4J_BI_Forms\applications\formsapp\formsweb\WEB-INF\lib\frmsrv.jar;D:\oracle10g\iDS1012\jlib\share.jar;D:\oracle10g\iDS1012\jlib\utj.jar;D:\oracle10g\iDS1012\jlib\zrclient.jar;D:\oracle10g\iDS1012\forms\java\frmall.jar;D:\oracle10g\iDS1012\jlib\importer.jar;D:\oracle10g\iDS1012\forms\javaNotice that jar files are included in the path and the last entry is just a directory. In this case, if there are any class files which are not in a jar, they could be stored individually in the \java directory.
    Verify that you have at least the following included in your CLASSPATH:
    frmsrv.jar
    importer.jar
    share.jar
    utj.jar
    zrclient.jar
    Do not remove other entries which may exist as they are needed, but ensure that the list includes the above.

  • Can we run java bean from forms client server??

    Hi,
    The OLTP application we are planning to build has lot of gui e.g
    tabs, drag and drop etc. Our aim is to make it web enabled but
    the network bandwidth available is small 16 - 64K . So even
    thoughwe plan toi use applet , we seriuosly doubt how good it
    will perform on such low network bandwidth. [The system will
    have 100 users]
    Q1. What will be a reasonable bandwidth to run an oltp
    application (say maintenance )
    Hence we are thinking of developing with developer 6i and
    deploying our application in client server mode, which can
    easily be web enabled in future. But we also have to integrate
    visual interfaces like gantt chart, which are not available with
    forms. We plan to use third party java component (e.g ILOG
    jviews), so that in future we can easily web enable the entire
    application.
    Q2. Can we run forms with java bean in client server mode? If
    not, what are the products to be installed on each machine to
    run it without using 9ias?
    best regards

    Yes. We can run sql loader from client machine.
    C:\Karthik>sqlldr user/pass@database data='test.csv' control='test.ctl' log='test.log' bad='test.bad'
    You can go through the following link for better understanding.
    http://www.oreilly.com/catalog/orsqlloader/chapter/ch01.html

  • Deploying Java Beans in forms 6i

    Hi,
    Can anyone let me know that whether forms 6i alone is
    sufficient to deploy Java Beans, because i tried deploying and
    had broblems in doing.
    Thanks
    Ravi

    You'll also need a JVM in which the beans will execute....
    If have your Forms deployed on iAS then you will have enerything
    you need.
    Regards
    Grant Ronald
    Forms Product Management

  • Calling Java Bean from Form 9i

    Dear all,
    I have developed a Java Bean and I want to use it in FOrm 9i. I have imported that Bean (.jar file) sucessfully to my form. I use following code to call the Bean:
    declare
    WordDoc ora_java.jobject;
    javaException ORA_JAVA.JOBJECT;
    Begin
    WordDoc := WordBean.new;
    WordBean.OpenWord(WordDoc, true);
    EXCEPTION
    WHEN ORA_JAVA.EXCEPTION_THROWN THEN
    javaException := ORA_JAVA.LAST_EXCEPTION;
    message(Exception_.getMessage(javaException));
    ORA_JAVA.CLEAR_EXCEPTION;
    WHEN ORA_JAVA.JAVA_ERROR THEN
    message(ORA_JAVA.LAST_ERROR);
    ORA_JAVA.CLEAR_ERROR;
    end;
    But I receive the "raise unhandled Exception Ora-105100" and my form doesn't handle the errors. What am I missing in the code?
    Thanks in advance,
    Hamid Motahar

    Hi,
    You receive this error because at runtime the form can't find the jar. See note : http://metalink.oracle.com/metalink/plsql/showdoc?db=NOT&id=169529.1
    on metalink
    Greetings

  • Pass array of value to Oracle Java Beans (for forms)

    Hi,
    How I can pass a array value from oracle Form to Java bean.
    With regards
    Satheesh Kumar

    Hi,
    Thanks for your immediate response.
    I have one more doubt. I am trying to create a Hirachical tree for form using Jtree. For dynmically populating tree data I want to pass array records from oracle forms.
    In my understanding, Java importer array will work if we do importing the java beans component to oracle forms, otherwise no.
    Is it possible I can pass array variable with out importing my javacomponent.
    With regards

  • Can we Return values from Java Bean to Form

    Hi All,
    I have a Bean area defined on a Form. The Bean Area consists of a Text field which gets populated by path of a file selected using Browse button.
    Can I return this path as a parameter from the Java Bean to the form? Is there any function for this?
    Regards,
    Prathima.

    If you designed your bean to offer the ability to exact info/data from it, then yes you can get a value from the bean into the form (pl/sql) - using Get_Custom_Property
    Refer to the following which is a good example of how to build a bean. Specifically look at page 12 where is shows how to use Get_Custom_Property.
    This is NOT an Oracle supported or provided document or web site, but it is a very good example.
    http://forms.pjc.bean.over-blog.com/ext/http://sheikyerbouti.developpez.com/forms-pjc-bean/first-bean/first_bean.pdf

  • Bean in forms 10g is not displaying

    Hi All,
    I have created a simple java class
    package mypackage1;
    public class MyClass
    public String GetString(String a)
    return a;
    Make a jar myjar.jar out of it.
    Copy this jar files in $ORACLE_HOME/forms/java directory
    and set the archive.jini parameter in formsweb.cfg to
    archive_jini=frmall_jinit.jar,Myjar.jar
    Created a simple form having one button, one textbox
    Set the implementation class property of text item to mypackage1.MyClass
    on button pressed trigger, I wrote
    set_custom_property('block2.text_item4',1,'GetString','Hello World');
    Ideally, on button pressed, it should show the text "Hello World" in the text box. But on button pressed nothing is happening and in java console no error is appearing.
    My java console output is
    Loading http://asst104253:8889/forms/java/frmall_jinit.jar from JAR cache
    Loading http://asst104253:8889/forms/java/Myjar.jar from JAR cache
    proxyHost=null
    proxyPort=0
    connectMode=HTTP, native.
    Forms Applet version is : 10.1.2.0
    Could anyone please tell me what I am doing wrong?? And how do I achieve this functionality??
    Please, any help appreciated !!

    Please anybody help !!

Maybe you are looking for

  • Which is better?  2 iTunes installs wl one logon -or- One iTunes install with configured sync parameters?

    First, I'm on Windows Vista ... not a mac ... and I do not own MobleMe ... my wife and I are already users of iTunes ... so we're talking about going from where we are now to where we want to be - which will involve changes.  Thanks in advance for sh

  • FTPS with ACE 4710

    Hi, I need to configure ACE for load-balancing FTPS. And simply deploying L4 policies are not helping either. Configured the FTPS servers and both of them are working fine when accessed via physical IP, but do not work when accessed via the VIP. if i

  • HT3775 will my mac play .avi file formats?

    Hi I have a new mac and not sure on opening this format. The help section lists AVI and the file format is .avi bit it wont open. Any ideas? A

  • How much HD space after migration?

    Situation: new PB, old iMacG5. Did the migration thing, now left with 18g out of 60. Some things I wanted transfered, some not. Cleaned out iPhoto, iTunes, some docs. Feel I need more space for editing video. I see HD issues get a lot of attention he

  • Patchadd problem

    hi guys.... when i do a patchadd... i met this: patchadd 118207-42 Validating patches... Loading patches installed on the system... Cannot open pkginfo file /var/sadm/pkg/ps/pkginfo how to solve this ?