Note that there are some explanatory texts on larger screens.

plurals
  1. POJava Web Start - Ignoring/changing Jar href URL's
    primarykey
    data
    text
    <p>I have a JNLP file which is created via a PHP script. It outputs something like the following file:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt; &lt;jnlp codebase="/" spec="1.0+"&gt; &lt;information&gt; &lt;title&gt;sometitle&lt;/title&gt; &lt;vendor&gt;somevendor&lt;/vendor&gt; &lt;homepage href=""/&gt; &lt;description&gt;somedesc&lt;/description&gt; &lt;description kind="short"&gt;someshort&lt;/description&gt; &lt;/information&gt; &lt;update check="always"/&gt; &lt;security&gt; &lt;all-permissions/&gt; &lt;/security&gt; &lt;resources&gt; &lt;j2se version="1.7+"/&gt; &lt;jar href="http://fproject.localhost/getjava/jar/e43e034c49c4a24f2711d385370faaf1ef92ca76" main="true"/&gt; &lt;jar href="http://fproject.localhost/getjava/libs/lib/commons-codec-1.6.jar" main="true"/&gt; &lt;jar href="http://fproject.localhost/getjava/libs/lib/commons-logging-1.1.1.jar" main="true"/&gt; &lt;jar href="http://fproject.localhost/getjava/libs/lib/fluent-hc-4.2.3.jar" main="true"/&gt; &lt;jar href="http://fproject.localhost/getjava/libs/lib/httpclient-4.2.3.jar" main="true"/&gt; &lt;jar href="http://fproject.localhost/getjava/libs/lib/httpclient-cache-4.2.3.jar" main="true"/&gt; &lt;jar href="http://fproject.localhost/getjava/libs/lib/httpcore-4.2.2.jar" main="true"/&gt; &lt;jar href="http://fproject.localhost/getjava/libs/lib/httpmime-4.2.3.jar" main="true"/&gt; &lt;/resources&gt; &lt;application-desc main-class="Windows8.Windows8GUI"&gt; &lt;/application-desc&gt; &lt;/jnlp&gt; </code></pre> <p>The application loads and initially opens fine, however the application is slow and unresponsive, after taking a look at my apache access log there seems to be some strange happenings, well first of all, it loads all the jars successfully: </p> <pre><code>127.0.0.1 - - [22/Feb/2013:19:39:56 +0000] "GET /getjava/libs/lib/fluent-hc-4.2.3.jar HTTP/1.1" 200 24509 "-" "JNLP/1.7.0 javaws/10.13.2.20 (&lt;internal&gt;) Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:39:56 +0000] "GET /getjava/libs/lib/commons-logging-1.1.1.jar HTTP/1.1" 200 65294 "-" "JNLP/1.7.0 javaws/10.13.2.20 (&lt;internal&gt;) Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:39:56 +0000] "GET /getjava/jar/ba1df5097852421a791d095271fd48df6c79804c HTTP/1.1" 200 14060 "-" "JNLP/1.7.0 javaws/10.13.2.20 (&lt;internal&gt;) Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:39:56 +0000] "GET /getjava/libs/lib/commons-codec-1.6.jar HTTP/1.1" 200 253503 "-" "JNLP/1.7.0 javaws/10.13.2.20 (&lt;internal&gt;) Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:39:57 +0000] "GET /getjava/libs/lib/httpclient-4.2.3.jar HTTP/1.1" 200 469073 "-" "JNLP/1.7.0 javaws/10.13.2.20 (&lt;internal&gt;) Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:39:57 +0000] "GET /getjava/libs/lib/httpclient-cache-4.2.3.jar HTTP/1.1" 200 124242 "-" "JNLP/1.7.0 javaws/10.13.2.20 (&lt;internal&gt;) Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:39:57 +0000] "GET /getjava/libs/lib/httpcore-4.2.2.jar HTTP/1.1" 200 245191 "-" "JNLP/1.7.0 javaws/10.13.2.20 (&lt;internal&gt;) Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:39:57 +0000] "GET /getjava/libs/lib/httpmime-4.2.3.jar HTTP/1.1" 200 29955 "-" "JNLP/1.7.0 javaws/10.13.2.20 (&lt;internal&gt;) Java/1.7.0_13" </code></pre> <p>Then there are loads of requests for the same files but the location has changed:</p> <pre><code>127.0.0.1 - - [22/Feb/2013:19:40:02 +0000] "GET /getjava/jar/lib/fluent-hc-4.2.3.jar HTTP/1.1" 404 2011 "-" "Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:40:03 +0000] "GET /getjava/jar/lib/httpclient-4.2.3.jar HTTP/1.1" 404 2011 "-" "Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:40:03 +0000] "GET /getjava/jar/lib/httpclient-cache-4.2.3.jar HTTP/1.1" 404 2011 "-" "Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:40:03 +0000] "GET /getjava/jar/lib/httpclient-4.2.3.jar HTTP/1.1" 404 2011 "-" "Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:40:03 +0000] "GET /getjava/jar/lib/httpclient-4.2.3.jar HTTP/1.1" 404 2011 "-" "Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:40:04 +0000] "GET /getjava/jar/lib/fluent-hc-4.2.3.jar HTTP/1.1" 404 2011 "-" "Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:40:04 +0000] "GET /getjava/jar/lib/httpclient-4.2.3.jar HTTP/1.1" 404 2011 "-" "Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:40:05 +0000] "GET /getjava/jar/lib/httpclient-cache-4.2.3.jar HTTP/1.1" 404 2011 "-" "Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:40:05 +0000] "GET /getjava/jar/lib/httpcore-4.2.2.jar HTTP/1.1" 404 2011 "-" "Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:40:05 +0000] "GET /getjava/jar/lib/httpmime-4.2.3.jar HTTP/1.1" 404 2011 "-" "Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:40:06 +0000] "GET /getjava/libs/lib/httpclient-cache-4.2.3.jar HTTP/1.1" 200 124242 "-" "JNLP/1.7.0 javaws/10.13.2.20 (&lt;internal&gt;) Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:40:06 +0000] "GET /getjava/libs/lib/httpcore-4.2.2.jar HTTP/1.1" 200 245191 "-" "JNLP/1.7.0 javaws/10.13.2.20 (&lt;internal&gt;) Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:40:06 +0000] "GET /getjava/jar/lib/fluent-hc-4.2.3.jar HTTP/1.1" 404 2011 "-" "Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:40:06 +0000] "GET /getjava/jar/lib/httpclient-4.2.3.jar HTTP/1.1" 404 2011 "-" "Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:40:07 +0000] "GET /getjava/jar/lib/httpclient-cache-4.2.3.jar HTTP/1.1" 404 2011 "-" "Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:40:07 +0000] "GET /getjava/jar/lib/httpcore-4.2.2.jar HTTP/1.1" 404 2011 "-" "Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:40:07 +0000] "GET /getjava/jar/lib/httpmime-4.2.3.jar HTTP/1.1" 404 2011 "-" "Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:40:08 +0000] "GET /getjava/jar/lib/fluent-hc-4.2.3.jar HTTP/1.1" 404 2011 "-" "Java/1.7.0_13" 127.0.0.1 - - [22/Feb/2013:19:40:08 +0000] "GET /getjava/jar/lib/httpclient-4.2.3.jar HTTP/1.1" 404 2011 "-" "Java/1.7.0_13" </code></pre> <p>Notice that /getjava/libs/lib has changed to /getjava/jar/lib</p> <p>How is this so? Where is the JVM getting this URL from?</p> <p>And more so, why does the JVM request the same file over and over again?</p> <p><strong>Edit - More information</strong></p> <p>I think I've narrowed the problem down a little bit. I'm pretty sure it's to do with Netbeans. I'm using version 7.2.1.</p> <p>It seems that the URLS for the extra library requests are coming from the <code>META-INF/MANIFEST.MF</code> file in the main application Jar. In there I can see the following: </p> <pre><code>Class-Path: lib/commons-codec-1.6.jar lib/commons-logging-1.1.1.jar li b/fluent-hc-4.2.3.jar lib/httpclient-4.2.3.jar lib/httpclient-cache-4 .2.3.jar lib/httpcore-4.2.2.jar lib/httpmime-4.2.3.jar </code></pre> <p>This would explain the modified URL's and the subsequent 404 responses as these files are not available at that URL.</p> <p>I don't understand why Netbeans is creating this paths of files. I am under the impression that Java Webstart downloads its resources using the JNLP file, and with in that the <code>&lt;resources&gt;</code> node?</p> <p>How can I stop netbeans adding this <code>Class-Path</code> attribute as I believe this is the root of my problem.</p> <p><strong>Further Updates</strong></p> <p>I have found a work around to this problem through hacking through files. If I take out this line: </p> <pre><code>&lt;attribute name="Class-Path" value="${jar.classpath}"/&gt; </code></pre> <p>from this file: </p> <pre><code>nbproject\build-impl.xml </code></pre> <p>Then Netbeans compiles the Jar correctly for a Webstart App. It does not create the <code>Class-Path</code> atttribute in the <code>META-INF/MANIFEST.MF</code> file inside the Jar. After removing this the app works absolutely fine, no hangs and no bogus requests for files which do not exist.</p> <p>Now I guess the question is, why does Netbeans do this? And is there a proper work around rather than me hacking about XML config files? Bear in mind I've been using Java for about a week. I know nothing about ANT/Java really.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload