简体   繁体   English

尝试启动JWS应用程序时发生NullPointerException

[英]NullPointerException when attempting to start JWS application

I am trying to start the JNLP located at http://gparyani.com/beatbox.jnlp , but I get a NullPointerException in an internal class when I try to do so: 我正在尝试启动位于http://gparyani.com/beatbox.jnlp的JNLP,但是当我尝试这样做时,我在内部类中得到了NullPointerException:

java.lang.NullPointerException
    at com.sun.deploy.security.SandboxSecurity.showSandboxDialog(Unknown Source)
    at com.sun.deploy.security.SandboxSecurity.checkSignedSandboxSecurity(Unknown Source)
    at com.sun.deploy.security.SandboxSecurity.isPermissionGranted(Unknown Source)
    at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResourcesHelper(Unknown Source)
    at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResources(Unknown Source)
    at com.sun.javaws.Launcher.prepareResources(Unknown Source)
    at com.sun.javaws.Launcher.prepareAllResources(Unknown Source)
    at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
    at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
    at com.sun.javaws.Launcher.launch(Unknown Source)
    at com.sun.javaws.Main.launchApp(Unknown Source)
    at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
    at com.sun.javaws.Main.access$000(Unknown Source)
    at com.sun.javaws.Main$1.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

Here's the JNLP: 这是JNLP:

<jnlp spec="1.0+" codebase="http://gparyani.com/">
  <information>
    <title>BeatBox</title>
    <vendor>Gaurav Paryani, Nick Hoang, and Harrison Qi</vendor>
    <offline-allowed/>
  </information>
  <update check="background" policy="prompt-run"/>
  <resources>
    <j2se version="1.7+"/>
    <jar href="beatbox.jar" main="true"/>
  </resources>
  <application-desc main-class="com.gparyani.beatbox.GUIMaker"/>
</jnlp>

What is the problem here? 这里有什么问题?

Certainly not the most helpful error message is it. 当然不是最有用的错误消息了。

I was able to get past it by fixing the codebase URL. 我可以通过修复代码库URL来克服它。 Your actual code is hosted at: 您的实际代码托管在:

http://www.rohitleena.com/gparyani/

but the codebase in your JNLP file is: 但是您的JNLP文件中的代码库是:

http://gparyani.com/

In summary the fix is to modify the jnlp element in your JNLP file to: 总之,解决方法是将JNLP文件中的jnlp元素修改为:

<jnlp spec="1.0+" codebase="http://www.rohitleena.com/gparyani/">

This was detected as a warning by Janela which may help you debug these issues in the future. Janela将其检测为警告,它可能会帮助您将来调试这些问题。

By changing the codebase to the first URL the NullPointerException went away. 通过将代码库更改为第一个URL,NullPointerException消失了。 My suspicion is that it is trying to validate the URL using certificates and that certificate validation is getting confused when trying to figure out which URL it needs to validate. 我的怀疑是,它正在尝试使用证书来验证URL,并且在试图确定需要验证哪个URL时,证书验证变得混乱。

Fixing this gets past the NullPointerException and immediately throws another exception but that appears to be a different problem (your application requesting the change the default runtime handler without having the permissions to do so). 解决此问题的方法已超过NullPointerException,并立即引发另一个异常,但这似乎是一个不同的问题(您的应用程序在没有权限的情况下请求更改默认运行时处理程序)。

Not sure about bug in Java, found this text on many blogs. 不确定Java中的错误,因此在许多博客中都找到了此文字。 How I solved this: I was able to launch other Jenkins slave node with name "WinXp-32bit-101" in WinXP Machine, with same Java version. 我如何解决这个问题:我能够在WinXP Machine中以相同的Java版本启动其他名为“ WinXp-32bit-101”的Jenkins从节点。 But other node which i have created for Win7 machine with the name "win7-64bit - 113" I am not able to launch at Win7 machine with the same error. 但是我为Win7机器创建的名称为“ win7-64bit-113”的其他节点却无法在Win7机器上启动,并且出现相同的错误。 I tried the same launching at WinXp machine and got the same error. 我在WinXp机器上尝试了相同的启动,并遇到了相同的错误。 I also tried launching old node "WinXp-32bit-101" in win7 machine and it worked there. 我还尝试在win7机器中启动旧节点“ WinXp-32bit-101”,并且在那里工作。

This means error is not with Java, not even with windows OS version as same error in both machine. 这意味着错误不是Java引起的,甚至不是Windows OS版本,因为这是两台计算机中的相同错误。

Solution: I just compared the configuration differences for both the nodes and removed the spaces in name. 解决方案:我只是比较了两个节点的配置差异,并删除了名称中的空格。 From "win7-64bit - 113" to "win7-64bit-113" 从“ win7-64bit-113”到“ win7-64bit-113”

and it worked. 而且有效。

How this will help to others as well 这也将如何帮助他人

暂无
暂无

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

相关问题 尝试访问对象数组时发生NullPointerException - NullPointerException when attempting to access array of objects 尝试访问数据库时导致NullPointerException - NullPointerException resulting when attempting to access database 尝试在Text对象上使用.setText时发生NullPointerException - NullPointerException when attempting to use .setText on a Text object 尝试 ConcurrentHashMap.get() 时出现 NullPointerException - NullPointerException when attempting ConcurrentHashMap.get() 我可以从 Java 应用程序中删除下载的 JNLP 文件(Java web start/JWS)吗? - Can I delete downloaded JNLP file (Java web start/JWS) from Java application? 尝试在Weblogic 10.2中启动应用程序时com.bea.content.manager.internal.ContentUpgradeListener的ClassNotFoundException - ClassNotFoundException for com.bea.content.manager.internal.ContentUpgradeListener when attempting to start application in Weblogic 10.2 JWS应用程序被安全性阻止 - JWS Application blocked by Security Setteings 尝试从SQLite数据库获取数据时发生NullPointerException / CursorOutOfBoundsException - NullPointerException / CursorOutOfBoundsException when attempting to get data from SQLite db 尝试从JDialog框中将项目插入数组时发生NullPointerException - NullPointerException when attempting to insert items into array from JDialog box 删除后尝试重新平衡AVL树时出现NullPointerException - NullPointerException when attempting to re-balance AVL tree after deletion
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM