Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem with using Java Bean and jar files in Forms6i[Solved]

SujoyJun 4 2008 — edited Nov 20 2008
Hi All,

First things first, I am using Forms6i(yes, its an old world out here), Oracle 9iaS and JDeveloper 10g.

My Requirement:
I need a custom form in Oracle Applications with which I want to open Notepad.exe in the client machine.

My Form:
The custom form has a button and a Bean Area.The Bean has the implementation class set to oracle.forms.fd.OpenNotepad and the java code I have written for the Bean is as follows:
package oracle.forms.fd;
import java.io.*;
import java.util.StringTokenizer;
import oracle.forms.handler.IHandler; 
import oracle.forms.ui.CustomEvent; 
import oracle.forms.properties.ID; 
import oracle.forms.ui.VBean; 

public class OpenNotepad extends VBean 

{ 
  static IHandler mHandler; 
  // properties you can set
  protected static final ID SET_PROG = ID.registerProperty("SET_PROG");

  public OpenNotepad() 
  { 
    super(); 
  }

  public void init(IHandler handler) 
  { 
    super.init(handler); 
    mHandler = handler;
    // put your initialisation instructions here 
  }

  public boolean setProperty(ID property, Object value) 
  { 
    if(property == SET_PROG) 
    { 
      String s=(String)value;
      if( s.equals("true") )
      {
        Runtime run = Runtime.getRuntime();
        try
        {
          Process pp =run.exec("C:\\WINDOWS\\system32\\notepad.exe");
        }
        catch (Exception e) 
        {
           e.printStackTrace();
           System.out.println(e.getMessage());
        }
      }
      return true;
    }
    else 
    { 
      return super.setProperty(property, value); 
    }
  }
  public void dispatch_event( ID id )
  { 
    CustomEvent ce = new CustomEvent(mHandler, id); 
    dispatchCustomEvent(ce);
  }

}
The when-button-pressed trigger of the button has the following line
Set_Custom_item_Property('WBSEBBN','SET_PROG','true');
There is no other triggers or code in the form.

Steps for the jar files and stuff:
1. Copied the oracle directory and all its subdirectories(which contains the java class files) to <ORACLE_HOME>/forms60/java.
2. Created the jar file(callNotepad.jar) and signed it by following the document "Oracle9i Forms:JAR File Signing for JInitiator 1.3".
3. Resigned the f60all_jinit.jar file in <ORACLE_HOME>/forms60/java.
4. Included callNotepad.jar in the archive_jini tag of the formsweb.cfg in <ORACLE_HOME>/forms60/server.


Finally the moment of truth...I open the form and click on the Button....nothing happens, absolutely nothing.

The jinitiator console shows this:
Oracle JInitiator: Version 1.3.1.21
Using JRE version 1.3.1.21-internal Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\196998


...Blah!Blah!Blah!...


Loading http://xxxxxxxxxxxxxxxxxxxx/OA_JAVA/oracle/apps/fnd/jar/fndforms.jar from JAR cache

Loading http://xxxxxxxxxxxxxxxxxxxx/OA_JAVA/oracle/apps/fnd/jar/fndformsi18n.jar from JAR cache

Loading http://xxxxxxxxxxxxxxxxxxxx/OA_JAVA/oracle/apps/fnd/jar/fndewt.jar from JAR cache

Loading http://xxxxxxxxxxxxxxxxxxxx/OA_JAVA/oracle/apps/fnd/jar/fndswing.jar from JAR cache

Loading http://xxxxxxxxxxxxxxxxxxxx/OA_JAVA/oracle/apps/fnd/jar/fndbalishare.jar from JAR cache

Loading http://xxxxxxxxxxxxxxxxxxxx/OA_JAVA/oracle/apps/fnd/jar/fndaol.jar from JAR cache

Loading http://xxxxxxxxxxxxxxxxxxxx/OA_JAVA/oracle/apps/fnd/jar/fndctx.jar from JAR cache

Loading http://xxxxxxxxxxxxxxxxxxxx/OA_JAVA/oracle/apps/fnd/jar/fndlist.jar from JAR cache

connectMode=Socket

serverHost=wxxxxxxxxxxxxxxxxxxxx

serverPort=9001

Forms Applet version is : 60825

Loading http://xxxxxxxxxxxxxxxxxxxx/OA_JAVA/oracle/apps/fnd/jar/fndutil.jar from JAR cache

java.lang.ClassNotFoundException: java.io.IOException: open HTTP connection failed.

at sun.applet.AppletClassLoader.getBytes(Unknown Source)

at sun.applet.AppletClassLoader.access$100(Unknown Source)

at sun.applet.AppletClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at sun.applet.AppletClassLoader.findClass(Unknown Source)

at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.applet.AppletClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Unknown Source)

at oracle.forms.handler.UICommon.instantiate(Unknown Source)

at oracle.forms.handler.UICommon.onCreate(Unknown Source)

at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)

at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)

at oracle.forms.engine.Runform.processMessage(Unknown Source)

at oracle.forms.engine.Runform.processSet(Unknown Source)

at oracle.forms.engine.Runform.onMessageReal(Unknown Source)

at oracle.forms.engine.Runform.sendDeferredMessages(Unknown Source)

at oracle.forms.engine.Runform.onMessage(Unknown Source)

at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)

at oracle.forms.engine.Runform.startRunform(Unknown Source)

at oracle.forms.engine.Main.createRunform(Unknown Source)

at oracle.forms.engine.Main.start(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)


Any ideas what is happening or how do I debug the problem.

Regds,
Sujoy

Message was edited by:
Sujoy
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 18 2008
Added on Jun 4 2008
17 comments
7,747 views