您好我创建了一个JAVAFX应用程序并在我的localhost服务器上上传了Java Websart包,但是当我打开应用程序时它确实有错误。 我已将配置java安全性的url添加到例外列表中。 你能帮我解决这个错误吗?当我运行JNLP文件附带的JAR文件时,它会完美地执行。我认为它与文件权限有关吗?
Java Plug-in 11.51.2.16
Using JRE version 1.8.0_51-b16 Java HotSpot(TM) Client VM
User home directory = C:\Users\yves
----------------------------------------------------
java.lang.ExceptionInInitializerError
at Main.loadLoginScene(Unknown Source)
at Main.start(Unknown Source)
at com.sun.javafx.applet.FXApplet2$2.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$170(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$45/27634459.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$44/31215714.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$145(Unknown Source)
at com.sun.glass.ui.win.WinApplication$$Lambda$34/10055096.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "user.dir" "read")
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at sun.plugin2.applet.FXAppletSecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at Constants.<clinit>(Unknown Source)
... 13 more
Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.ExceptionInInitializerError
at com.sun.javafx.applet.FXApplet2$2.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$170(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$45/27634459.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$44/31215714.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$145(Unknown Source)
at com.sun.glass.ui.win.WinApplication$$Lambda$34/10055096.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
at Main.loadLoginScene(Unknown Source)
at Main.start(Unknown Source)
... 11 more
Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "user.dir" "read")
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at sun.plugin2.applet.FXAppletSecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at Constants.<clinit>(Unknown Source)
... 13 more
JNLP文件
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0" xmlns:jfx="http://javafx.com" href="KahayahayTaxi.jnlp">
<information>
<title>KahayahayTaxi</title>
<vendor>KahayahayTaxi</vendor>
<description>Sample JavaFX 2.0 application.</description>
<offline-allowed/>
</information>
<resources>
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
<jar href="KahayahayTaxi.jar" size="4986475" download="eager" />
<jar href="libs/controlsfx-8.40.9.jar" size="1016589" download="eager" />
<jar href="libs/mysql-connector-java-5.1.29-bin.jar" size="876733" download="eager" />
<jar href="libs/opencsv-3.3.jar" size="31217" download="eager" />
</resources>
<jfx:javafx-desc width="0" height="0" main-class="Main" name="KTBM Software" />
<update check="background"/>
</jnlp>
答案 0 :(得分:0)
安全标签是:
<security>
<all-permissions/>
</security>