applet works inconsistenlty

Posted on 1999-01-25
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 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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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.util.*;
import java.applet.*;
import com.novell.beans.NWSess.*;
import com.novell.service.nds.naming.*;
import javax.naming.*;
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);
                           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 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 200 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This video teaches viewers about errors in exception handling.

705 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