我们曾经在一个使用 Java 6 构建和编译的 Alfresco 应用程序中有一个小程序。由于我们的系统需要更新到 Java7 JVM,小程序启动开始显示所有那些令人讨厌的安全消息,这对我们的用户来说是相当痛苦的。
我们阅读了 Java7 的指南,似乎我们只需要使用 CA 证书对小程序中涉及的 jar 进行签名。我们这样做了,现在我们所有的 jar 都按照 Java 7 指南并使用 Keystore 工具正确地使用证书进行了签名。然而,我们现在发现所有调用这些签名 jar 的小程序存在两个问题(对于这个例子,我将只展示我们的一个小程序)
1) 现在加载小程序需要很多时间(在签名之前和在 Java6 JVM 中过去需要 15 秒,现在我们正在谈论几分钟!!!)。
2) 我们发现 ClassNotfoundException 问题导致我们的小程序无法正常工作。
对我们来说最重要的问题是第二个问题“ClassNotFoundException”,因为在花了几天时间阅读可能的解决方案后,我们无法让它发挥作用。
我们的小程序是在一个jsp页面中插入这样的代码
<applet code="uk.co.mmscomputing.application.imageviewer.MainApp.class"
codebase="<%= scan.getUrlAlfrescoApplet() %>"
archive="scan-plugin-mmsc_v1.2.jar, alfresco-web-service-client.jar, jai_core.jar, jai_codec.jar, activation.jar, alfresco-core.jar, axis-1.4.jar, bcprov-jdk15-137.jar, commons-discovery-0.2.jar, commons-logging-1.1.jar, jaxrpc.jar, mail.jar, opensaml-1.0.1.jar, saaj.jar, wsdl4j-1.5.1.jar, wsdl4j-1.6.2.jar, wss4j.jar, xalan.jar, xercesImpl-2.8.0.jar, xmlsec-1.4.1.jar"
width="100%" height="600" name="Veritas Scan">
<PARAM name="scanFile" value="<%= scan.getFileName() %>">
<PARAM name="container" value="<%= scan.getSpaceNodeRef().getId() %>">
<PARAM name="multipage" value="<%= scan.getFactMultipage() %>">
<PARAM name="urlAlfrescoWS" value="<%= scan.getUrlAlfrescoWS() %>">
<PARAM name="ocr" value="<%= scan.getOcr() %>">
<PARAM name="cif" value="<%= scan.getCIF() %>">
<PARAM name="user" value="<%= scan.getUserName() %>">
<PARAM name="ticket" value="<%= scan.getTicket() %>">
<PARAM name="sessionId" value="<%= scan.getSessionId() %>">
<PARAM name="java_arguments" value="-Xmx256m">
<PARAM name="java_version" value="1.6*">
<PARAM name="separate_jvm" value="true">
Your browser does not support the <code>applet</code> tag.
</applet>
并且签名的罐子在
Tomcat/露天/小程序
但是,当我们尝试在最后的 jsp 页面中启动这个小程序时,我们会收到以下错误消息:
ClassNotFoundException
uk.co.mmscomputing.application.imageviewer.MainApp.class
我们在 java 控制台中看到的是这样的:
Java Plugin 10.55.2.13
Usando versión de JRE 1.7.0_55-b13 Java HotSpot(TM) Client VM
Directorio de inicio del usuario = C:\Documents and Settings\Dolores Sanguinetti
----------------------------------------------------
c: borrar ventana de consola
f: finalizar objetos en la cola de finalización
g: recopilación de basura
h: mostrar este mensaje de ayuda
l: volcar lista de classloader
m: imprimir uso de memoria
o: disparar registro
q: ocultar consola
r: recargar configuración de política
s: volcar propiedades del sistema y de despliegue
t: volcar lista de threads
v: volcar pila de threads
x: borrar caché de classloader
0-5: definir nivel de rastreo en <n>
----------------------------------------------------
CacheEntry[http://IP_SERVER:8080/alfresco/applets/scan-plugin-mmsc_v1.2.jar]: updateAvailable=true,lastModified=Thu Jun 16 11:51:52 CEST 2011,length=6280199
CacheEntry[http://IP_SERVER:8080/alfresco/applets/scan-plugin-mmsc_v1.2.jar]: updateAvailable=true,lastModified=Thu Jun 16 11:51:52 CEST 2011,length=6280199
CacheEntry[http://IP_SERVER:8080/alfresco/applets/alfresco-web-service-client.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:51:54 CET 2013,length=418382
CacheEntry[http://IP_SERVER:8080/alfresco/applets/alfresco-web-service-client.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:51:54 CET 2013,length=418382
CacheEntry[http://IP_SERVER:8080/alfresco/applets/jai_core.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:30 CEST 2010,length=1966212
CacheEntry[http://IP_SERVER:8080/alfresco/applets/jai_core.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:30 CEST 2010,length=1966212
CacheEntry[http://IP_SERVER:8080/alfresco/applets/jai_codec.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:30 CEST 2010,length=267173
CacheEntry[http://IP_SERVER:8080/alfresco/applets/jai_codec.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:30 CEST 2010,length=267173
CacheEntry[http://IP_SERVER:8080/alfresco/applets/activation.jar]: updateAvailable=true,lastModified=Mon May 05 23:35:34 CEST 2014,length=59420
CacheEntry[http://IP_SERVER:8080/alfresco/applets/activation.jar]: updateAvailable=true,lastModified=Mon May 05 23:35:34 CEST 2014,length=59420
CacheEntry[http://IP_SERVER:8080/alfresco/applets/alfresco-core.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:51:39 CET 2013,length=173167
CacheEntry[http://IP_SERVER:8080/alfresco/applets/alfresco-core.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:51:39 CET 2013,length=173167
CacheEntry[http://IP_SERVER:8080/alfresco/applets/axis-1.4.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:52:13 CET 2013,length=1689344
CacheEntry[http://IP_SERVER:8080/alfresco/applets/axis-1.4.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:52:13 CET 2013,length=1689344
CacheEntry[http://IP_SERVER:8080/alfresco/applets/bcprov-jdk15-137.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:26 CEST 2010,length=1528841
CacheEntry[http://IP_SERVER:8080/alfresco/applets/bcprov-jdk15-137.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:26 CEST 2010,length=1528841
CacheEntry[http://IP_SERVER:8080/alfresco/applets/commons-discovery-0.2.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:53:01 CET 2013,length=79805
CacheEntry[http://IP_SERVER:8080/alfresco/applets/commons-discovery-0.2.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:53:01 CET 2013,length=79805
CacheEntry[http://IP_SERVER:8080/alfresco/applets/commons-logging-1.1.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:53:15 CET 2013,length=58414
CacheEntry[http://IP_SERVER:8080/alfresco/applets/commons-logging-1.1.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:53:15 CET 2013,length=58414
CacheEntry[http://IP_SERVER:8080/alfresco/applets/jaxrpc.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:53:40 CET 2013,length=39674
CacheEntry[http://IP_SERVER:8080/alfresco/applets/jaxrpc.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:53:40 CET 2013,length=39674
CacheEntry[http://IP_SERVER:8080/alfresco/applets/mail.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:55:43 CET 2013,length=364719
CacheEntry[http://IP_SERVER:8080/alfresco/applets/mail.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:55:43 CET 2013,length=364719
CacheEntry[http://IP_SERVER:8080/alfresco/applets/opensaml-1.0.1.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:55:02 CET 2013,length=112773
CacheEntry[http://IP_SERVER:8080/alfresco/applets/opensaml-1.0.1.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:55:02 CET 2013,length=112773
CacheEntry[http://IP_SERVER:8080/alfresco/applets/saaj.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:28 CEST 2010,length=22324
CacheEntry[http://IP_SERVER:8080/alfresco/applets/saaj.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:28 CEST 2010,length=22324
CacheEntry[http://IP_SERVER:8080/alfresco/applets/wsdl4j-1.5.1.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:28 CEST 2010,length=136990
CacheEntry[http://IP_SERVER:8080/alfresco/applets/wsdl4j-1.5.1.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:28 CEST 2010,length=136990
CacheEntry[http://IP_SERVER:8080/alfresco/applets/wsdl4j-1.6.2.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:54:19 CET 2013,length=165762
CacheEntry[http://IP_SERVER:8080/alfresco/applets/wsdl4j-1.6.2.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:54:19 CET 2013,length=165762
CacheEntry[http://IP_SERVER:8080/alfresco/applets/wss4j.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:54:41 CET 2013,length=323332
CacheEntry[http://IP_SERVER:8080/alfresco/applets/wss4j.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:54:41 CET 2013,length=323332
CacheEntry[http://IP_SERVER:8080/alfresco/applets/xalan.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:28 CEST 2010,length=3175437
CacheEntry[http://IP_SERVER:8080/alfresco/applets/xalan.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:28 CEST 2010,length=3175437
CacheEntry[http://IP_SERVER:8080/alfresco/applets/xercesImpl-2.8.0.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:28 CEST 2010,length=1280498
CacheEntry[http://IP_SERVER:8080/alfresco/applets/xercesImpl-2.8.0.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:28 CEST 2010,length=1280498
CacheEntry[http://IP_SERVER:8080/alfresco/applets/xmlsec-1.4.1.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:55:23 CET 2013,length=455842
CacheEntry[http://IP_SERVER:8080/alfresco/applets/xmlsec-1.4.1.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:55:23 CET 2013,length=455842
CacheEntry[http://IP_SERVER:8080/alfresco/applets/scan-plugin-mmsc_v1.2.jar]: updateAvailable=true,lastModified=Thu Jun 16 11:51:52 CEST 2011,length=6280199
CacheEntry[http://IP_SERVER:8080/alfresco/applets/scan-plugin-mmsc_v1.2.jar]: updateAvailable=true,lastModified=Thu Jun 16 11:51:52 CEST 2011,length=6280199
CacheEntry[http://IP_SERVER:8080/alfresco/applets/alfresco-web-service-client.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:51:54 CET 2013,length=418382
CacheEntry[http://IP_SERVER:8080/alfresco/applets/alfresco-web-service-client.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:51:54 CET 2013,length=418382
CacheEntry[http://IP_SERVER:8080/alfresco/applets/jai_core.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:30 CEST 2010,length=1966212
CacheEntry[http://IP_SERVER:8080/alfresco/applets/jai_core.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:30 CEST 2010,length=1966212
CacheEntry[http://IP_SERVER:8080/alfresco/applets/jai_codec.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:30 CEST 2010,length=267173
CacheEntry[http://IP_SERVER:8080/alfresco/applets/jai_codec.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:30 CEST 2010,length=267173
CacheEntry[http://IP_SERVER:8080/alfresco/applets/activation.jar]: updateAvailable=true,lastModified=Mon May 05 23:35:34 CEST 2014,length=59420
CacheEntry[http://IP_SERVER:8080/alfresco/applets/activation.jar]: updateAvailable=true,lastModified=Mon May 05 23:35:34 CEST 2014,length=59420
CacheEntry[http://IP_SERVER:8080/alfresco/applets/alfresco-core.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:51:39 CET 2013,length=173167
CacheEntry[http://IP_SERVER:8080/alfresco/applets/alfresco-core.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:51:39 CET 2013,length=173167
CacheEntry[http://IP_SERVER:8080/alfresco/applets/axis-1.4.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:52:13 CET 2013,length=1689344
CacheEntry[http://IP_SERVER:8080/alfresco/applets/axis-1.4.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:52:13 CET 2013,length=1689344
CacheEntry[http://IP_SERVER:8080/alfresco/applets/bcprov-jdk15-137.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:26 CEST 2010,length=1528841
CacheEntry[http://IP_SERVER:8080/alfresco/applets/bcprov-jdk15-137.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:26 CEST 2010,length=1528841
CacheEntry[http://IP_SERVER:8080/alfresco/applets/commons-discovery-0.2.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:53:01 CET 2013,length=79805
CacheEntry[http://IP_SERVER:8080/alfresco/applets/commons-discovery-0.2.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:53:01 CET 2013,length=79805
CacheEntry[http://IP_SERVER:8080/alfresco/applets/commons-logging-1.1.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:53:15 CET 2013,length=58414
CacheEntry[http://IP_SERVER:8080/alfresco/applets/commons-logging-1.1.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:53:15 CET 2013,length=58414
CacheEntry[http://IP_SERVER:8080/alfresco/applets/jaxrpc.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:53:40 CET 2013,length=39674
CacheEntry[http://IP_SERVER:8080/alfresco/applets/jaxrpc.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:53:40 CET 2013,length=39674
CacheEntry[http://IP_SERVER:8080/alfresco/applets/mail.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:55:43 CET 2013,length=364719
CacheEntry[http://IP_SERVER:8080/alfresco/applets/mail.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:55:43 CET 2013,length=364719
CacheEntry[http://IP_SERVER:8080/alfresco/applets/opensaml-1.0.1.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:55:02 CET 2013,length=112773
CacheEntry[http://IP_SERVER:8080/alfresco/applets/opensaml-1.0.1.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:55:02 CET 2013,length=112773
CacheEntry[http://IP_SERVER:8080/alfresco/applets/saaj.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:28 CEST 2010,length=22324
CacheEntry[http://IP_SERVER:8080/alfresco/applets/saaj.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:28 CEST 2010,length=22324
CacheEntry[http://IP_SERVER:8080/alfresco/applets/wsdl4j-1.5.1.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:28 CEST 2010,length=136990
CacheEntry[http://IP_SERVER:8080/alfresco/applets/wsdl4j-1.5.1.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:28 CEST 2010,length=136990
CacheEntry[http://IP_SERVER:8080/alfresco/applets/wsdl4j-1.6.2.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:54:19 CET 2013,length=165762
CacheEntry[http://IP_SERVER:8080/alfresco/applets/wsdl4j-1.6.2.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:54:19 CET 2013,length=165762
CacheEntry[http://IP_SERVER:8080/alfresco/applets/wss4j.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:54:41 CET 2013,length=323332
CacheEntry[http://IP_SERVER:8080/alfresco/applets/wss4j.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:54:41 CET 2013,length=323332
CacheEntry[http://IP_SERVER:8080/alfresco/applets/xalan.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:28 CEST 2010,length=3175437
CacheEntry[http://IP_SERVER:8080/alfresco/applets/xalan.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:28 CEST 2010,length=3175437
CacheEntry[http://IP_SERVER:8080/alfresco/applets/xercesImpl-2.8.0.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:28 CEST 2010,length=1280498
CacheEntry[http://IP_SERVER:8080/alfresco/applets/xercesImpl-2.8.0.jar]: updateAvailable=true,lastModified=Fri Oct 01 12:17:28 CEST 2010,length=1280498
CacheEntry[http://IP_SERVER:8080/alfresco/applets/xmlsec-1.4.1.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:55:23 CET 2013,length=455842
CacheEntry[http://IP_SERVER:8080/alfresco/applets/xmlsec-1.4.1.jar]: updateAvailable=true,lastModified=Fri Nov 29 12:55:23 CET 2013,length=455842
关于如何让我们的小程序恢复并在 Java7 中顺利运行的任何想法???我们非常需要这个:-(。
非常感谢。