解决方案 »

  1.   

    补充下 程序中有用到第三方的jar包,我打包应用程序采用的是fat jar
      

  2.   

    是不是用到的所有jar包都签了
      

  3.   

    用到的所有Jar包不确定是否都签名,不过可以尝试下!
      

  4.   

    我有尝试对所有的jar包签名之后再打包,可是还是会出现这样的情况?为什么呢??
      

  5.   

    是中文的,我估计他的提示信息有做i18N local化,我有确认所有的包都签名了……
    以前也是这样用的,就没有这个警告提示,当时用的三方包不多,现在随着功能的扩展,又加了一些,就出现了这个。
    打包的方式fat jar其实是将原有的jar包拆分,然后统一打包到你需要的jar包中,这样jar包中只有class文件和包,而没有jar文件,所以签名应该是对整个jar包生效的,不存在个别jar未签名的情况(我也有尝试使用eclipse的runnable jar打包方式,将所有jar签名之后打包,但是还是不行)。
    其实oracle官方也有文章,只是他大部分介绍为什么会产生这种情况,在客户端设置避免,而并未阐述如何在打包的时候规避这个问题,链接:http://docs.oracle.com/javase/6/docs/technotes/guides/jweb/mixed_code.html
      

  6.   

    打开jar包看里面的META-INF文件夹内,有几个文件,如果只有一个MANIFEST.MF文件,就没有签名。
      

  7.   

    为了确认是不是所有jar包都签了,做一个不对外依赖的jar包,放在applet中测试
      

  8.   

    解决了,不过还是为了后来者解决问题的方便性
    公布答案
    才用半自动打包方式,手写MANIFEST.MF文件
    Manifest-Version: 1.0
    Trusted-Library: true
    Created-By: 1.6.0-internal (Sun Microsystems Inc.)重点是:Trusted-Library: true可能我里面确实有部分组件自己签名了或者是代码保护了导致了这种问题。具体的不知道。
    散分!
      

  9.   

    哦这个问题Trusted-Library AttributeFor applications and applets that are designed to allow unsigned components, the Trusted-Library attribute should be used. No warning dialog will be displayed and an application or applet may load jar files containing untrusted classes or resources. This attribute prevents signed components in an application or applet from being re-purposed with unsigned components. You can specify Trusted-Library: true in the manifest file. For example:    Manifest-Version: 1.0
        Trusted-Library: true
        Created-By: 1.6.0-internal (Sun Microsystems Inc.)All classes and resources in a jar file containing this manifest attribute must be signed and trusted.看它的介绍的话还是因为应用中涉及到了unsigned components,所以才需要这个属性
      

  10.   

    可是我确实签名了的,不然怎会显示这个:jarsigner -verify **.jar
    已验证。我都尝试过了……最终只能这样!还是谢谢啦!
      

  11.   

    没关系 只是觉得奇怪那也有可能是Trusted-Only和Trusted-Library两者必用其一,都不用可能会导致问题Trusted-Only AttributeFor applications and applets that do not require unsigned components, the Trusted-Only attribute should be used. No warning dialog will be displayed and an application or applet that loads a jar file containing this attribute will not load any untrusted classes or resources. This attribute prevents a signed application or applet from being re-purposed with unsigned components. You can specify Trusted-Only: true in the manifest file. For example:    Manifest-Version: 1.0
        Trusted-Only: true
        Created-By: 1.6.0-internal (Sun Microsystems Inc.)All classes and resources in the application or applet must be signed and trusted.
      

  12.   


    可是我确实没有用第三方jar包,又不敢你这样,害怕真有人改jar包,运行其它代码
      

  13.   

    好象是最新的版java会出现。有一台java1.7_013的都不会,但另一台最新的就会。每次打开网页,第一次js调applet方法的时候就会出现
      

  14.   

    这个问题我也遇到过,参看这个帖子,保证解决你的问题。http://blog.csdn.net/faye0412/article/details/7037078
      

  15.   

    到 深圳维瑞 去看看 Java代码数字签名使用方法。http://www.willrey.com/support/java_signing_guide.html