gpt4 book ai didi

java - 使用 Java 64 位 1.7.0_06+ 从 JNLP 启动应用程序时出现 NullPointerException

转载 作者:搜寻专家 更新时间:2023-11-01 03:54:36 25 4
gpt4 key购买 nike

以下应用与 Java 1.7.0_05 及更早版本完美兼容:

<jnlp spec="1.0+" codebase="http://localhost/demo/">
<information>
<title>BPI 4.7</title>
<vendor>Fox Technical Services Inc.</vendor>
<homepage href="/home.html"/>
<description>Fox Client</description>
<description kind="short">Fox</description>
<icon href="base/Fox64.gif" height="64" width="64"/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se href="http://java.sun.com/products/autodl/j2se" version="1.6+"/>
<jar href="base/application.jar" main="true"/>
<jar href="base/sessions.jar"/>
<jar href="base/swingSessions.jar"/>
<jar href="base/sharedClientServer.jar"/>
<jar href="base/baseLookAndFeelNoDecorations.jar"/>
<jar href="base/clientCommon2.jar"/>
<jar href="base/httpProvider.jar"/>
<jar href="base/swing.jar"/>
<jar href="base/swingImages.jar"/>
<jar href="base/glf.jar"/>
<jar href="base/vnc.jar"/>
<jar href="thirdPartyLib/TableLayout-bin-jdk1.5-2007-04-21.jar"/>
<jar href="thirdPartyLib/dbswing.jar"/>
<jar href="thirdPartyLib/dx.jar"/>
<jar href="thirdPartyLib/beandt.jar"/>
<jar href="thirdPartyLib/jnlp.jar"/>
<jar href="thirdPartyLib/alloy.jar"/>
<jar href="thirdPartyLib/commons-beanutils.jar"/>
<jar href="thirdPartyLib/commons-collections-3.1.jar"/>
<jar href="thirdPartyLib/commons-logging.jar"/>
<jar href="thirdPartyLib/commons-codec-1.3.jar"/>
<jar href="thirdPartyLib/commons-lang-2.0.jar" download="lazy"/>
<jar href="thirdPartyLib/httpclient-4.0-beta2.jar"/>
<jar href="thirdPartyLib/httpcore-4.0.jar"/>
<jar href="thirdPartyLib/log4j-1.2.15.jar" download="lazy"/>
<jar href="thirdPartyLib/jbcl.jar" download="lazy"/>
<jar href="thirdPartyLib/mail-1.4.jar" download="lazy"/>
<jar href="thirdPartyLib/activation-1.1.jar" download="lazy"/>
<jar href="base/javolution.jar" download="lazy"/>
</resources>
<application-desc>
</application-desc>
</jnlp>

当我尝试使用 Java1.7.0_06 和更新版本运行它时,出现异常:

java.lang.NullPointerException
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at com.sun.javaws.LaunchDownload.getMainClassName(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

控制台日志是:

Java Web Start 10.7.2.11
Using JRE version 1.7.0_07-b11 Java HotSpot(TM) 64-Bit Server VM
User home directory = C:\Users\val
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
0-5: set trace level to <n>
----------------------------------------------------
Match: beginTraversal
Match: digest selected JREDesc: JREDesc[version 1.6+, heap=-1--1, args=null, href=http://java.sun.com/products/autodl/j2se, sel=false, null, null], JREInfo: JREInfo for index 0:
platform is: 1.7
product is: 1.7.0_07
location is: http://java.sun.com/products/autodl/j2se
path is: C:\Program Files\Java\jre7\bin\javaw.exe
args is: null
native platform is: Windows, amd64 [ x86_64, 64bit ]
JavaFX runtime is: JavaFX 2.2.1 found at C:\Program Files\Java\jre7\
enabled is: true
registered is: true
system is: true

Match: ignoring maxHeap: -1
Match: ignoring InitHeap: -1
Match: digesting vmargs: null
Match: digested vmargs: [JVMParameters: isSecure: true, args: ]
Match: JVM args after accumulation: [JVMParameters: isSecure: true, args: ]
Match: digest LaunchDesc: null
Match: digest properties: []
Match: JVM args: [JVMParameters: isSecure: true, args: ]
Match: endTraversal ..
Match: JVM args final:
Match: Running JREInfo Version match: 1.7.0.07 == 1.7.0.07
Match: Running JVM args match: have:<> satisfy want:<>
#### Java Web Start Error:
#### null

如有任何帮助,我们将不胜感激!

最佳答案

你的application-desc元素是空的感觉很奇怪。

根据jnlp-secification它必须包含属性 ma​​in-class

<application-desc main-class="com.yourcompany.MyCoolApplication" />

关于java - 使用 Java 64 位 1.7.0_06+ 从 JNLP 启动应用程序时出现 NullPointerException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12392629/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com