Java WebStart无法在服务器中加载资源

时间:2016-01-27 04:14:33

标签: java javafx jar classpath java-web-start

我想用webstart启动我的应用程序,netbeans创建“dist”文件夹,如果我从我的计算机运行HTML,程序运行正常,但如果我上传HTML,JNLP,JAR和lib文件夹全部在我的服务器中的jar库程序抛出一个错误,我猜测jar试图找到lib文件夹中的依赖项,但路径中的斜杠存在问题,因为服务器在linux上运行,这是错误:< / p>

  

ExitException [3] com.sun.deploy.net.FailedDownloadException:无法加载资源:http://www.abaxomol.com/dist/lib \ commons-io-2.4.jar

问题不在JNLP中,因为我在资源标记中声明了这样的资源:

<jar href="http://www.abaxomol.com/dist/lib/commons-io-2.4.jar" size="185140" download="eager" />

在“project.properties”中我发现了这个

  

$ {file.reference.commons-IO-2.4.jar}:\

我认为这是问题,但我不确定,不知道发生了什么事情?

编辑:完整的JNLP

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0" xmlns:jfx="http://javafx.com" href="ContenedoresChart.jnlp">
  <information>
    <title>ContenedoresChart</title>
    <vendor>Diego</vendor>
    <description>null</description>
    <offline-allowed/>
  </information>
  <resources>
    <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
    <jar href="ContenedoresChart.jar" size="2200844" download="eager" />
    <jar href="http://www.abaxomol.com/dist/lib/commons-io-2.4.jar" size="198396" download="eager" />
    <jar href="http://www.abaxomol.com/dist/lib/guava-18.0.jar" size="2410298" download="eager" />
    <jar href="http://www.abaxomol.com/dist/lib/json-simple-1.1.1.jar" size="26301" download="eager" />
  </resources>
<security>
  <all-permissions/>
</security>
  <applet-desc  width="800" height="600" main-class="com.javafx.main.NoJavaFXFallback"  name="ContenedoresChart" >
    <param name="requiredFXVersion" value="8.0+"/>
  </applet-desc>
  <jfx:javafx-desc  width="800" height="600" main-class="contenedoreschart.ContenedoresChart"  name="ContenedoresChart" />
  <update check="always"/>
</jnlp>

完整的project.properties:

annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
annotation.processing.processors.list=
annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
application.title=ContenedoresChart
application.vendor=Diego
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
compile.on.save=true
compile.on.save.unsupported.javafx=true
# Uncomment to specify the preferred debugger connection transport:
#debug.transport=dt_socket
debug.classpath=\
    ${run.classpath}
debug.test.classpath=\
    ${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/ContenedoresChart.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
file.reference.commons-io-2.4.jar=src\\contenedoreschart\\commons-io-2.4.jar
file.reference.guava-18.0.jar=src\\contenedoreschart\\guava-18.0.jar
file.reference.json-simple-1.1.1.jar=src\\contenedoreschart\\json-simple-1.1.1.jar
includes=**
# Non-JavaFX jar file creation is deactivated in JavaFX 2.0+ projects
jar.archive.disabled=true
jar.compress=false
javac.classpath=\
    ${javafx.classpath.extension}:\
    ${file.reference.commons-io-2.4.jar}:\
    ${file.reference.guava-18.0.jar}:\
    ${file.reference.json-simple-1.1.1.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.processorpath=\
    ${javac.classpath}
javac.source=1.8
javac.target=1.8
javac.test.classpath=\
    ${javac.classpath}:\
    ${build.classes.dir}
javac.test.processorpath=\
    ${javac.test.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
javafx.application.implementation.version=1.0
javafx.binarycss=false
javafx.classpath.extension=\
    ${java.home}/lib/javaws.jar:\
    ${java.home}/lib/deploy.jar:\
    ${java.home}/lib/plugin.jar
javafx.deploy.adddesktopshortcut=false
javafx.deploy.addstartmenushortcut=false
javafx.deploy.allowoffline=true
# If true, application update mode is set to 'background', if false, update mode is set to 'eager'
javafx.deploy.backgroundupdate=false
javafx.deploy.disable.proxy=false
javafx.deploy.embedJNLP=true
javafx.deploy.includeDT=true
javafx.deploy.installpermanently=false
javafx.deploy.permissionselevated=true
# Set true to prevent creation of temporary copy of deployment artifacts before each run (disables concurrent runs)
javafx.disable.concurrent.runs=false
# Set true to enable multiple concurrent runs of the same WebStart or Run-in-Browser project
javafx.enable.concurrent.external.runs=false
# This is a JavaFX project
javafx.enabled=true
javafx.fallback.class=com.javafx.main.NoJavaFXFallback
# Main class for JavaFX
javafx.main.class=contenedoreschart.ContenedoresChart
javafx.preloader.class=
# This project does not use Preloader
javafx.preloader.enabled=false
javafx.preloader.jar.filename=
javafx.preloader.jar.path=
javafx.preloader.project.path=
javafx.preloader.type=none
# Set true for GlassFish only. Rebases manifest classpaths of JARs in lib dir. Not usable with signed JARs.
javafx.rebase.libs=false
javafx.run.height=600
javafx.run.width=800
javafx.signing.blob=false
javafx.signing.enabled=true
javafx.signing.type=self
# Pre-JavaFX 2.0 WebStart is deactivated in JavaFX 2.0+ projects
jnlp.enabled=false
# Main class for Java launcher
main.class=com.javafx.main.Main
# For improved security specify narrower Codebase manifest attribute to prevent RIAs from being repurposed
manifest.custom.codebase=*
# Specify Permissions manifest attribute to override default (choices: sandbox, all-permissions)
manifest.custom.permissions=
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false
native.bundling.enabled=false
platform.active=default_platform
run.classpath=\
    ${dist.jar}:\
    ${javac.classpath}:\
    ${build.classes.dir}
run.test.classpath=\
    ${javac.test.classpath}:\
    ${build.test.classes.dir}
source.encoding=UTF-8
src.dir=src
test.src.dir=test

2 个答案:

答案 0 :(得分:0)

我不得不手动将生成的HTML和JNLP中的所有内容复制到新文件中,将这些文件上传到服务器并删除旧文件,并且由于某种原因它可以工作。可能有一个bug?我不知道。

答案 1 :(得分:0)

尝试从Java控制面板中删除Java缓存。