0 Replies Latest reply on Feb 19, 2003 11:08 AM by Yevgen Bushuyev

    selfsigned applet and getPrincipalInfo exception

    Yevgen Bushuyev Newbie

      Hi.
      I'm trying to connect to jboss from an applet:

      Properties jndiProps = new Properties();
      String myServer = this.getCodeBase().getHost ();
      jndiProps.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory" );
      jndiProps.setProperty("java.naming.provider.url", myServer) ;
      jndiProps.setProperty("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces") ;

      I signed the applet as described in http://java.sun.com/j2se/1.4.1/docs/guide/plugin/developer_guide/rsa_signing.html
      but without importing certificate, i.e. i get "selfsigned" applet.

      When i acces this applet with browser it shows me a confirmation dialog, i choose "Always allow".
      But it still cant't connect to server throwing

      ava.security.AccessControlException: access denied (java.lang.RuntimePermission org.jboss.security.SecurityAssociation.getPrincipalInfo)
      at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
      at java.security.AccessController.checkPermission(AccessController.java:401)
      at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
      at org.jboss.security.SecurityAssociation.getPrincipal(SecurityAssociation.java:112)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:74)
      at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:198)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      at $Proxy2.create(Unknown Source)
      at lavka.applet.ItemsApplet.init(Unknown Source)
      at sun.applet.AppletPanel.run(AppletPanel.java:347)
      at java.lang.Thread.run(Thread.java:536)


      It works, when i put
      grant codeBase "http://www.mysite.com:8080/applets/-"{
      permission java.lang.RuntimePermission "org.jboss.security.SecurityAssociation.getPrincipalInfo";
      permission java.io.SerializablePermission "enableSubstitution";
      };

      to .java.policy but it's impossible to force every user to do so.

      Any ideas?

      wbr, eugen.