How do I access local files in WebForms 6i using signed applets?

From: Jacob <jacmads_at_hotmail.com>
Date: Mon, 22 Jan 2001 00:09:22 +0100
Message-ID: <1YJa6.4763$A23.51190_at_news6.giganews.com>


Hi all

During the conversion of an existing Forms application to WebForms, it has been necessary to develop a new component as a JavaBean (was an ActiveX component), which is supposed to gain access to a client's local file system. This, according to Note 130431.1 on MetaLink and the "GetClientInfo" sample from TechNet, requires the use of signed JAR files.

Here's the procedure to do this, as I have understood and have followed:

1. Pack all relevant Java classes in JAR files. I have downloaded Swing
1.1.1 from Sun and installed swingall.jar in "<ORACLE_HOME>\Forms60\java".
2. In the directory "<ORACLE_HOME>\Forms60\jdk\bin" is javakey.exe.
This is used in the enclosed "cert-maker.bat", which is executed with the name of a given identity, which should be created for use on both client and server. Before I do this, I create the files "certdirective" and "signingdirective" in
a directory with the identity's name as describe in Note 130431.1. This has been done with both my own JAR file and swingall.jar. 3. Now I sign the JAR file using "jarfile-signer.bat" from the example and add an entry for the signed JAR file in the "archive=" tag in formsweb.cfg.
4. All the previous steps was executed on the Forms Server machine. Now I go to a client machine with JInitiator installed and create two identities and import the two certificates, one for my own JAR and one for swingall.jar using this procedure from the JInitiator "\bin" directory:
javakey -c <identity name>
javakey -ic <identity name> <e.g. "Swing.x509"> The code in my own JavaBean, which is packed in the signed JAR file, is as follows:

JFileChooser jfc = new JFileChooser();
ExtensionFileFilter filter = new ExtensionFileFilter(); filter.addExtension("txt");
filter.setDescription("Text files");
jfc.setFileFilter(filter);
JFrame frame = new JFrame("test");
frame.setSize(10,10);
frame.setVisible(true);
int choice = jfc.showOpenDialog(frame);
if (choice == JFileChooser.APPROVE_OPTION) { fileName = jfc.getSelectedFile().getAbsolutePath(); }

When I then watch the Java console from the client, I can see the signed JAR files being downloaded just fine. But as soon as the client tries to instantiate JFileChooser (I can see from stack trace), this exception is thrown:
[Quoted] sun.applet.AppletSecurityException: checkread

What am I doing wrong? Has this to do with BUG 1543274 on MetaLink, and if so, how do I get around it? I have tried both Forms Server "as is", patch 2 and patch 3a, JInitiator 1.1.7.27, 1.1.7.32, 1.1.8.3 without any difference. Can somebody help?

Thanks in advance!

Jacob Received on Mon Jan 22 2001 - 00:09:22 CET

Original text of this message