Note that there are some explanatory texts on larger screens.

plurals
  1. POJWS stack overflow error
    primarykey
    data
    text
    <p>I like to use Java Web Start to put up a demo of my Java game to the web so that user can view and interact with the game characters and so on. </p> <p>I exported the project to a jar file using Eclipse export runnable jar feature. I was then able to run it with <code>java -jar</code> successfully. I set up a <code>test.jnlp</code> file as below:</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;jnlp spec="1.0+" codebase="/home/bili/JWSdeploytest/" href="test.jnlp"&gt; &lt;information&gt; &lt;title&gt;Demo&lt;/title&gt; &lt;vendor&gt;binman&lt;/vendor&gt; &lt;description&gt;Test&lt;/description&gt; &lt;offline-allowed/&gt; &lt;/information&gt; &lt;resources&gt; &lt;jar href="LoadbonesFOrmat.jar" main="true"/&gt; &lt;extension name="Demo" href="test.jnlp" /&gt; &lt;/resources&gt; &lt;security&gt; &lt;all-permissions/&gt; &lt;/security&gt; &lt;application-desc /&gt; &lt;/jnlp&gt; </code></pre> <p>I tried to test it locally on my machine with debug turning on that I read from other post on here:</p> <pre><code>set JAVAWS_TRACE_NATIVE=1 set JAVAWS_VM_ARGS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket, address=8989,server=y,suspend=n" </code></pre> <p>But when I run <code>javaws test.jnlp</code> I got <code>StackOverflowError</code>. Below is output:</p> <pre><code>bili@bili-SFF:~/JWSdeploytest$ javaws -J test.jnlp Exception in thread "Demo" java.lang.StackOverflowError at java.util.LinkedHashMap$LinkedHashIterator.&lt;init&gt;(LinkedHashMap.java:362) at java.util.LinkedHashMap$LinkedHashIterator.&lt;init&gt;(LinkedHashMap.java:362) at java.util.LinkedHashMap$KeyIterator.&lt;init&gt;(LinkedHashMap.java:400) at java.util.LinkedHashMap$KeyIterator.&lt;init&gt;(LinkedHashMap.java:400) at java.util.LinkedHashMap.newKeyIterator(LinkedHashMap.java:413) at java.util.HashMap$KeySet.iterator(HashMap.java:891) at java.io.ExpiringCache.cleanup(ExpiringCache.java:117) at java.io.ExpiringCache.get(ExpiringCache.java:74) at java.io.UnixFileSystem.canonicalize(UnixFileSystem.java:152) at java.io.File.getCanonicalPath(File.java:576) at sun.security.provider.PolicyFile.canonPath(PolicyFile.java:1872) at java.io.FilePermission$1.run(FilePermission.java:203) at java.io.FilePermission$1.run(FilePermission.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.io.FilePermission.init(FilePermission.java:200) at java.io.FilePermission.&lt;init&gt;(FilePermission.java:266) at java.lang.SecurityManager.checkRead(SecurityManager.java:888) at net.sourceforge.jnlp.config.DeploymentConfiguration.getProperty(DeploymentConfiguration.java:269) at net.sourceforge.jnlp.SecurityDesc.getCustomTrustedPolicy(SecurityDesc.java:172) at net.sourceforge.jnlp.SecurityDesc.&lt;init&gt;(SecurityDesc.java:159) at net.sourceforge.jnlp.Parser.getSecurity(Parser.java:553) at net.sourceforge.jnlp.JNLPFile.parse(JNLPFile.java:594) at net.sourceforge.jnlp.JNLPFile.&lt;init&gt;(JNLPFile.java:178) at net.sourceforge.jnlp.JNLPFile.&lt;init&gt;(JNLPFile.java:211) at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:351) at net.sourceforge.jnlp.runtime.JNLPClassLoader.initializeExtensions(JNLPClassLoader.java:370) at net.sourceforge.jnlp.runtime.JNLPClassLoader.&lt;init&gt;(JNLPClassLoader.java:174) at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:295) at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:351) at net.sourceforge.jnlp.runtime.JNLPClassLoader.initializeExtensions(JNLPClassLoader.java:370) at net.sourceforge.jnlp.runtime.JNLPClassLoader.&lt;init&gt;(JNLPClassLoader.java:174) at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:295) at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:351) at net.sourceforge.jnlp.runtime.JNLPClassLoader.initializeExtensions(JNLPClassLoader.java:370) </code></pre> <p>The three line 295:351:370 are repeated dozen more time. It looks to me from the output as if there is some restricted access going on. I checked and verified that the Jar file, jnlp are allowed to be executed/read.</p> <p>I start to wonder if I need a web server to test it out. However few things that cast doubt in my mind as I never work with JWS before:</p> <ol> <li>Something is wrong with the jar file (I didn't export it correctly)</li> <li>The <code>test.jnlp</code> is not configured correctly</li> </ol> <p>Any pointers as to how can I solve this JWS business?</p> <p>Edit: I have removed the extention element and it throws another Exception:</p> <pre><code> bili@bili-SFF:~/JWSdeploytest$ javaws test.jnlp net.sourceforge.jnlp.LaunchException: Fatal: Launch Error: Could not launch JNLP file. at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:596) at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:887) Caused by: java.lang.IllegalArgumentException: file:/home/bili/JWSdeploytest/LoadbonesFOrmat.jar is not a cacheable resource at net.sourceforge.jnlp.cache.CacheUtil.getCacheFile(CacheUtil.java:297) at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:561) ... 1 more Caused by: java.lang.IllegalArgumentException: file:/home/bili/JWSdeploytest/LoadbonesFOrmat.jar is not a cacheable resource at net.sourceforge.jnlp.cache.CacheUtil.getCacheFile(CacheUtil.java:297) at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:561) at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:887) </code></pre> <p>This one seems more intuitive and I'm positive this timethat I haven't packed the Jar file correctly. Going to try it again later. Here is the output from JaNeLA:</p> <pre><code>content type application/xml does not equal expected type of application/x-java-jnlp-file XML encoding not known, but declared as utf-8 Codebase '/home/bili/JWSdeploytest/' is a malformed URL! Defaulting to file:/home/bili/JWSdeploytest/test.jnlp Codebase '/home/bili/JWSdeploytest/' is a malformed URL! Defaulting to file:/home/bili/JWSdeploytest/test.jnlp Codebase '/home/bili/JWSdeploytest/' is a malformed URL! Defaulting to file:/home/bili/JWSdeploytest/test.jnlp Codebase '/home/bili/JWSdeploytest/' is a malformed URL! Defaulting to file:/home/bili/JWSdeploytest/test.jnlp Downloads can be optimized by specifying a resource size for 'LoadbonesFOrmat.jar'. The resource download at LoadbonesFOrmat.jar can be optimized by removing the (default) value of download='eager'. Lazy downloads might not work as expected for LoadbonesFOrmat.jar unless the download 'part' is specified. </code></pre> <p>I've moved the security element above resource element to get rid of the cvc-complex-type.2.4.a: according to JaNeLa's help file on the website. In console, it says document is valid but the data might still be wrong!</p>
    singulars
    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