applet works inconsistenlty

Posted on 1999-01-25
Medium Priority
Last Modified: 2013-12-22
I have created an applet that uses Novell's JavaBeans to get a user's NDS name from the tree.  In the process of getting this to work, I experimented with signed applets, editing policy files, changing classpath, etc. on my machine.  Then I downloaded Sun's Java Plug-in.  I couldn't get that to
work, so I downloaded a couple of different versions.  Then I upgraded my Netscape to version 4.07 and tried again, and this time it worked.  I now have two applets created and compiled on my computer, and copied to our intranet server, so that when I visit their pages in Netscape, the
applets work completely.
  The problem - my computer is the only one that will run these applets.  I have tried copying the class and JavaBeans to the other computers, using the same version of Netscape, downloading both plugin versions, changing classpath, even copying files such as java.security and java.policy to their
respective places on the other machine.  None of this works.  I get 'AccessControlException' and 'PropertyPermissionError' when I try to run them.
  Please help, I have been working on this for over a week with no solution in sight.

Question by:candace
  • 6
  • 6
LVL 16

Expert Comment

ID: 1234652
probably your applet uses some third party classes that are installed only on your computer (As development enviroment)

Author Comment

ID: 1234653
I copied every base directory with .class or .jar files, and am still getting the same errors.  Any other suggestions?
LVL 16

Expert Comment

ID: 1234654
if your applet code is very simple, you can post it here.
also it will help us if you post the whole eception stacktrace ...
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 1234655
import java.awt.*;
import java.awt.event.*;
import java.awt.image.ImageObserver;
import java.net.*;
import java.io.*;
import java.util.*;
import java.applet.*;
import com.novell.beans.NWSess.*;
import com.novell.service.nds.naming.*;
import javax.naming.*;
import javax.naming.directory.*;
import javax.naming.spi.*;

public class GetNameEmail extends Applet implements Runnable {
AppletContext ac;
String fullname, shortname, shortfull, straddress;
NWNetworkName  name, connTree;
NWNetworkNames trees;
String str, treename, filename;
NWSess nwSession;
StringBuffer strbuffull, strbufdot, strbufemail;
int i, j, k;

public void init()
  try {
        nwSession = new NWSess();
      trees = nwSession.getConnectedTrees();  
      treename = new String(nwSession.getCurrentFullName());
      name = nwSession.getLoginName(treename);
      fullname = new String(name.getFullName());
      shortname = new String(name.getShortName());
      String desiredAttrs[] = {"NGW: GroupWise ID"};
      Properties systemProps = System.getProperties();
        Properties myProps = new Properties(systemProps);
      myProps.put("java.naming.provider.url", "MYTREE");
        DirContext initialCtx = new InitialDirContext(myProps);
      for (int i=0; i<3; i++)
      {      j = fullname.indexOf('\\', j);
            j++; }
      shortfull = new String(fullname.substring(j-1));
      i = shortfull.lastIndexOf('\\');
      strbufdot = new StringBuffer(shortfull.substring(i+1));
      j = i;
      i = shortfull.lastIndexOf('\\', j-1);
      while (i != -1)
      {      strbufdot.append(".");
            strbufdot.append(shortfull.substring(i+1, j));
            j = i;
            i = shortfull.lastIndexOf('\\', j-1);
      Object obj = initialCtx.lookup(strbufdot.toString());
      if (obj != null)
      {      DirContext currDSCtx = (DirContext) obj;
            Attributes attrSet=currDSCtx.getAttributes("", desiredAttrs);
            NamingEnumeration attrEnum=attrSet.getAll();
                  {             Attribute attr = (Attribute)attrEnum.next();
                           Enumeration attrValueEnum = attr.getAll();
                           {                 Object value = attrValueEnum.nextElement();
                  straddress = new String(value.toString());
      i = 0;
      i = straddress.lastIndexOf(" ");
      j = straddress.indexOf("{");
      strbufemail = new StringBuffer(straddress.substring(i+1, j));
            ac = getAppletContext();
      catch (Exception e)
      {        System.out.println(e.toString());

public void start()
            ac.showDocument(new URL(""+strbufemail.toString()));
            System.out.println("show doc");
      catch (Exception e)
      {      System.out.println(e.toString());

public void run()

The error message is:
Java(TM) Plug-in
Using JRE version 1.2
User home directory = C:\WINNT\Profiles\mistest
Proxy Configuration: Manual Configuration
     Proxy: http=;https=;ftp=;gopher=;socks=
     Proxy Overrides: *,*oracle,*help

JAR cache enabled.
Opening no proxy
No holding
CacheHandler trying caching.
CacheHandler file name: C:\Program Files\Netscape\Users\default\cache\M0O1862O.CLA
Got cached copy
java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)

Author Comment

ID: 1234656
Adjusted points to 200
LVL 16

Expert Comment

ID: 1234657
lets define the problem.

- you have the applet classes on you intranet server,
- you can see this applet on your computer, using Netscape 4.07 (downloading the applet from the intranet server)
- you can't see the applet on all the other machines (using the same software configuration).

this looks strange ...

Is your applet signed. Unsigned applets are not allowed to use this code

It seems that the applet has permissions on your machine, but does not have on the other ...

hope this helps

Author Comment

ID: 1234658
I don't think I ever successfully signed the applet - I know I experimented with creating my own certificates, but none show up under Netscape - Security - Certificates.  I edited my prefs.js file and added a line to allow the codebase to serve as a certificate.  I also added this line to the prefs file on the other computer, however.
LVL 16

Expert Comment

ID: 1234659
this statement will sure give you SecurityException.

untrusted applets are not allowed to manipulate the system properties object.
if this applet works on some computer:
- either applet is signed
- either borwser (or Java plug-in) is configured to allow applets to access System properties object.

this statement will fail on all other unconfigured computers.


Author Comment

ID: 1234660
It turns out that it was a combinations of rights issues (I had my own account on the server, and others didn't have the correct rights) and the fact that the user I was using to test didn't have the attributes that I was trying to extract (in this case, no groupwise account).  So, I finally got it to work.  Thanks so much for your help.
LVL 16

Expert Comment

ID: 1234661
so will I get some points ? :))

Author Comment

ID: 1234662
I don't know how to close a problem, or if I'm supposed to do it or someone else.  
And if it's up to me, you get the points. ;)
LVL 16

Accepted Solution

heyhey_ earned 600 total points
ID: 1234663
thanks - I am answering your question. :)

If you are really satisfied with my help, you can give me 'grade A' :))

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question