Applet可以和他的原服务器通信,也就是和保存它的class文件的那个服务器通信!不需要改安全策略文件!

解决方案 »

  1.   

    我的客户端安装的是JRE1.3.1,每次连接报异常:
    java.lang.ExceptionInInitializerError: java.security.AccessControlException:access denied (java.util.PropertyPermission jaxp.debug read)
    at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source)
             at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
             at java.lang.System.getProperty(Unknown Source)
    麻烦的就是要修改权限设置。
    “Applet可以和他的原服务器通信,不需要改安全策略文件! ”好像行不通!!
    关于数字签名,这个不太实际,也很麻烦。
      

  2.   

    我下午测试成功的!
    http://www.csdn.net/expert/topic/323/323722.shtmhtml里的标签用<object>试试!
      

  3.   

    对于JVM运行JApplet我知道要修改标记,这些是没有问题的,在我将权限配置修改成
    grant {
    permission java.security.AllPermission;
    };后,我的连接是完全可以而不会有安全异常的。对了,在JB等编辑其中使用application或者appletViewer是不会报这个异常的,只有在浏览器中才有可能注意到安全问题。
      

  4.   

    我是在JB5中完全通过测试运行正常后转到IE中运行才发现的这个问题,为什么applet打开一个URL都要受安全策略的限制???
      

  5.   

    我没改安全设置,照样成功(访问原服务器)!
    你可以看看java核心一!
    还有一本是java服务器端高级编程,有一章专门是applet与servlet的通信!
      

  6.   

    JB5是其实也是启动appletview,用appletview与在浏览器中浏览,权限是完全不同的!
      

  7.   

    我想是有权限限制的,JAVA2中看安全权限类:java.net.SocketPermission。用来控制TCP/IP Scoket的访问。
      

  8.   

    所报异常:java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.1.97:8080 connect,resolve) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkConnect(Unknown Source) at sun.plugin.protocol.jdk12.http.HttpURLConnection.connectStep1(Unknown Source) at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source) at com.eigenet.report2.ClientApplet.sendREAD(ClientApplet.java:62) at com.eigenet.report2.DataCommunication.initial(DataCommunication.java:44) at com.eigenet.report2.DataCommunication.<init>(DataCommunication.java:37) at prototype.JappletTable.arrange(JappletTable.java:91) at prototype.JappletTable.jbInit(JappletTable.java:45) at prototype.JappletTable.init(JappletTable.java:37) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
      

  9.   

    JAVA核心技术卷一没怎么讲解安全策略,我是在其他书上找到的,并且在每个客户端报的异常都不一样。有PropertyPermission,也有SocketPermission。
      

  10.   

    to redstarstar:
    那你可以给我解释一下我的异常是怎么得到的吗?部分连接代码给你:
    public InputStream sendREAD(String filePath){
        URLConnection connect=null;
        InputStream readInputStream=null;
        try{
          String readURL="http://192.168.1.97:8080/servlet/ServerServlet"+"?Action="+Message.READ_REQUEST+"&FilePath="+filePath;
          URL url=new URL(readURL);
          connect=url.openConnection();
          ObjectInputStream inputStream=new ObjectInputStream(connect.getInputStream());
          byte[] input=(byte[])inputStream.readObject();
          readInputStream=new ByteArrayInputStream(input);
        }catch(MalformedURLException e){
          System.out.println("MalformedURLException:"+e);
        }catch(IOException e){
          System.out.println("IOException:"+e);
        }catch(ClassNotFoundException noFound){
          System.out.println("ClassNotFoundException"+noFound);
        }
        return readInputStream;
    }
      

  11.   

    你是在本机测试马?在本机测试URL要写localhost。
      

  12.   

    不是在本机测试的,在其他机器上也会报这个问题,并且还有SecurityPermission的问题,很奇怪。
      

  13.   

    http://localhost:8080/servlet/ServerServlet?Action=2&FilePath=D:\\test.xmljava.lang.ExceptionInInitializerError: java.security.AccessControlException: access denied (java.util.PropertyPermission jaxp.debug read) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source)
      

  14.   

     你的servlet启动了吗?你的服务器启动了吗?