简体   繁体   English

使用Glassfish 4.1和Java7签名的Java Web Start应用程序

[英]Signed Java web start application with Glassfish 4.1 and Java7

I am trying to run a web start application with GlassFish 4.1, JDK 1.7 update 51 locally and I encountered the "Application Blocked by Security Settings" message. 我试图在本地运行带有GlassFish 4.1,JDK 1.7 update 51的Web Start应用程序,并且遇到“应用程序被安全设置阻止”消息。

Here is what I tried to make it work: 这是我尝试使其工作的方法:
1. Added http://hostname.localdomain.com:8080 to the Exception Site List in Java control panel. 1.在Java控制面板的“例外站点列表”中添加了http://hostname.localdomain.com:8080 Also tried http://hostname.localdomain.com:8080/___JWSappclient/ and http://hostname.localdomain.com:8080/clientName.jnlp 还尝试了http://hostname.localdomain.com:8080/___JWSappclient/http://hostname.localdomain.com:8080/clientName.jnlp


2. Exported the s1as key from Glassfish's keystore.jks and imported it in to JRE cacerts: $ keytool -exportcert -keystore keystore.jks -alias s1as -file server.csr $ keytool -importcert -keystore jre/lib/security/cacerts -alias s1as -file server.csr 2.从Glassfish的keystore.jks中导出s1as密钥,并将其导入到JRE cacerts中: $ keytool -exportcert -keystore keystore.jks -alias s1as -file server.csr $ keytool -importcert -keystore jre/lib/security/cacerts -alias s1as -file server.csr

I could see the jars signed with the s1as key, but javaws still complains. 我可以看到用s1as键签名的jar,但是javaws仍然抱怨。 The JNLP is generated by Glassfish automatically using the settings from our sun-application-client.xml JNLP由Glassfish使用我们sun-application-client.xml中的设置自动生成。

Appreciate any help on how to get around this error. 感谢有关如何解决此错误的任何帮助。 I realize this works fine if I use JRE7 update 21 on the client-side but I would like to try with Java 8 later on so cannot stick to Java 7. If it matters, I am using Ubuntu. 我意识到如果我在客户端使用JRE7 update 21可以正常工作,但是我想稍后再尝试使用Java 8,所以不能坚持使用Java7。如果有关系,我正在使用Ubuntu。

I have replicated your problem and have a workaround. 我已经复制了您的问题,并且有一种解决方法。

It seems the problem is related to the glassfish 4.1 automatically generated jnlp file and the new java security jdk 1.7 u 25 or later. 看来问题与glassfish 4.1自动生成的jnlp文件和新的Java安全性jdk 1.7 u 25或更高版本有关。

If you install java 1.7.0_21 or earlier your Java Web Start Application will start by using the javaws in the earlier distribution. 如果安装Java 1.7.0_21或更早版本,则Java Web Start应用程序将通过使用较早发行版中的javaws来启动。

I have simplified this problem using netbeans 8.0.2, java 1.8_31 and GF 4.1. 我使用netbeans 8.0.2,java 1.8_31和GF 4.1简化了此问题。 I created a Java EE "Enterprise Application Client" with no code changes. 我创建了Java EE“企业应用程序客户端”,未更改任何代码。 Deploy it and you cannot run it from the glassfish console nor any javaws from 7.1 u25 or later. 部署它,您将无法从glassfish控制台或7.1 u25或更高版本的任何javaws中运行它。 However, if you use javaws 7.1 u21 or earlier from the command line it will start. 但是,如果从命令行使用javaws 7.1 u21或更早版本,它将启动。 Interestingly, the application is running in a java 1.8 u31 environment. 有趣的是,该应用程序在Java 1.8 u31环境中运行。

Must be a bug in glassfish. 一定是玻璃鱼中的虫子。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM