Applet Hosting Issue

So my work in progress game (forum post here) is currently hosted on a server running on my computer.



When I tried to switch it to some actual webhosting on one of my websites, I encountered a problem:



java.lang.Exception: Unable to get input stream for lwjgl.jar.pack.lzma

at org.lwjgl.util.applet.AppletLoader.getJarInputStream(AppletLoader.java:1603)

at org.lwjgl.util.applet.AppletLoader.downloadJars(AppletLoader.java:1475)

at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:871)

at java.lang.Thread.run(Unknown Source)

network: Connecting http://www.partyartisans.com/gravitygame/dist/applet/lwjgl.jar.pack.lzma with proxy=DIRECT

network: Connecting http://www.partyartisans.com:80/ with proxy=DIRECT

java.lang.Exception: Unable to get input stream for lwjgl.jar.pack.lzma

at org.lwjgl.util.applet.AppletLoader.getJarInputStream(AppletLoader.java:1603)

at org.lwjgl.util.applet.AppletLoader.downloadJars(AppletLoader.java:1475)

at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:871)

at java.lang.Thread.run(Unknown Source)

network: Connecting http://www.partyartisans.com/gravitygame/dist/applet/lwjgl.jar.pack.lzma with proxy=DIRECT

network: Connecting http://www.partyartisans.com:80/ with proxy=DIRECT

java.lang.Exception: Unable to get input stream for lwjgl.jar.pack.lzma

at org.lwjgl.util.applet.AppletLoader.getJarInputStream(AppletLoader.java:1603)

at org.lwjgl.util.applet.AppletLoader.downloadJars(AppletLoader.java:1475)

at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:871)

at java.lang.Thread.run(Unknown Source)

This occurred while ‘Downloading packages’

failed to download lwjgl.jar.pack.lzma after 3 attempts

java.lang.Exception: failed to download lwjgl.jar.pack.lzma after 3 attempts

at org.lwjgl.util.applet.AppletLoader.downloadJars(AppletLoader.java:1551)

at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:871)

at java.lang.Thread.run(Unknown Source)



Now I get if it’s connecting to an outside source there should be a security exception or whatever. However, there should be a similar exception if someone else connects to my server I am running out of my computer, and there is not. For some reason it works then, and doesn’t work if I run it off my website.



It’s hosted on GoDaddy. I can get any of the information on the capabilities of the hosting, if I know what to look for.



I really would like to be able to switch to an actual webhosting system for obvious reasons, but for some reason it aint working. Any advice would be appreciated!

Does the server have any special serving directives for .jar or class files?

@normen said:
Does the server have any special serving directives for .jar or class files?


Er. I don't know? I am posting a support ticket on godaddy to see if they have any ideas, and I asked that question in the support post.

One thing you could try is setting the http agent to something else, some web servers generally reject java applications (which report a common agent when its not changed) because many bots are written in java:



System.setProperty(“http.agent”, “My Awesome App”);



Idk how and where you can sneak that in honestly though as it has to be before lwjgl comes in and tries to load the libs :confused: Maybe best try to put it in a static{} block right in the main class as that one should be loaded first of all your code.



Edit: Narf, your own code isn’t even loaded, its in the jar :frowning:

@normen said:
One thing you could try is setting the http agent to something else, some web servers generally reject java applications (which report a common agent when its not changed) because many bots are written in java:

System.setProperty("http.agent", "My Awesome App");

Idk how and where you can sneak that in honestly though as it has to be before lwjgl comes in and tries to load the libs :/ Maybe best try to put it in a static{} block right in the main class as that one should be loaded first of all your code.

Edit: Narf, your own code isn't even loaded, its in the jar :(


It does download code.jar.

Did you try clicking the link? You can see what it loads and when it fails that way, it might give you an insight you might not otherwise have...

uh, did you really upload everything in the created applet folder?

@normen said:
uh, did you really upload everything in the created applet folder?


I uploaded the whole dist folder. Then I uploaded it a second time just in case there was a problem.

Well, investigate along the lines I indicated. Does it work when you open the html file locally?

@normen said:
Does it work when you open the html file locally?


I am not sure how to interpret your question, so I'll interpret it a few ways.
1) It opens and runs the game when I click on run-applet.html on my computer (the one located in the folder I uploaded to the website)
2) It opens and runs the game when I go to my server running off my computer using dynamic dos (which is where my kongregate version is being run from)
3) When i access the file on my website, it runs and then hits that block when it tries to access lwjgl.jar.pack.lzma

As for the investigation... if you mean about finding out if it the hosting has special directives for .class and .jar files, I already asked godaddy's support team, so I'm waiting on a response from them.

…and the agent thing.

@normen said:
..and the agent thing.


So I should try putting this (or something like it) in a static block above my main class?
System.setProperty(“http.agent”, “My Awesome App”);

What would a call like that do exactly? It looks like a rename sort of thing?

Edit: I did that exact thing, and now it crashes on my computer when I run the applet html, but not when I run it in the SDK.

The crash is at the bottom of this log (of course), but I thought some of the stuff before it was interesting as well, for instance some of those security messages?



Java Plug-in 1.6.0_35
Using JRE version 1.6.0_35-b10 Java HotSpot(TM) Client VM
User home directory = C:UsersJesus

c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to

security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.definition value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.
security: property package.definition new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws
security: property package.definition value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws
security: property package.definition new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy
security: property package.definition value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy
security: property package.definition new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
security: property package.definition value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.definition new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
basic: Plugin2ClassLoader.addURL parent called for file:/C:/Users/Jesus/Desktop/euo/experimentJME/GravityArenaDemo/dist/Applet/lwjgl_util_applet.jar
basic: Plugin2ClassLoader.addURL parent called for file:/C:/Users/Jesus/Desktop/euo/experimentJME/GravityArenaDemo/dist/Applet/lzma.jar
network: Cache entry not found [url: file:/C:/Users/Jesus/Desktop/euo/experimentJME/GravityArenaDemo/dist/Applet/lwjgl_util_applet.jar, version: null]
security: Accessing keys and certificate in Mozilla user profile: null
security: Loading Root CA certificates from C:Program FilesJavajre6libsecuritycacerts
security: Loaded Root CA certificates from C:Program FilesJavajre6libsecuritycacerts
security: Loading Deployment certificates from C:UsersJesusAppDataLocalLowSunJavaDeploymentsecuritytrusted.certs
security: Loaded Deployment certificates from C:UsersJesusAppDataLocalLowSunJavaDeploymentsecuritytrusted.certs
security: Loading certificates from Deployment session certificate store
security: Loaded certificates from Deployment session certificate store
security: Validate the certificate chain using CertPath API
security: Obtain certificate collection in Root CA certificate store
security: Obtain certificate collection in Root CA certificate store
security: No timestamping info available
security: Found jurisdiction list file
security: Start checking trusted extension for this certificate
security: Start comparing to jurisdiction list with this certificate
security: The CRL support is disabled
security: The OCSP support is disabled
security: This OCSP End Entity validation is disabled
security: Checking if certificate is in Deployment denied certificate store
security: Checking if certificate is in Deployment permanent certificate store
network: Cache entry not found [url: file:/C:/Users/Jesus/Desktop/euo/experimentJME/GravityArenaDemo/dist/Applet/lwjgl_util_applet.jar, version: null]
network: Cache entry not found [url: file:/C:/Users/Jesus/Desktop/euo/experimentJME/GravityArenaDemo/dist/Applet/lwjgl_util_applet.jar, version: null]
security: Loading certificates from Deployment session certificate store
security: Loaded certificates from Deployment session certificate store
security: Validate the certificate chain using CertPath API
security: Obtain certificate collection in Root CA certificate store
security: Obtain certificate collection in Root CA certificate store
security: No timestamping info available
security: Found jurisdiction list file
security: Start checking trusted extension for this certificate
security: Start comparing to jurisdiction list with this certificate
security: The CRL support is disabled
security: The OCSP support is disabled
security: This OCSP End Entity validation is disabled
security: Checking if certificate is in Deployment denied certificate store
security: Checking if certificate is in Deployment permanent certificate store
network: Cache entry not found [url: file:/C:/Users/Jesus/Desktop/euo/experimentJME/GravityArenaDemo/dist/Applet/lwjgl_util_applet.jar, version: null]
basic: Plugin2ClassLoader.getPermissions CeilingPolicy allPerms
security: Loading certificates from Deployment session certificate store
security: Loaded certificates from Deployment session certificate store
security: Validate the certificate chain using CertPath API
security: Obtain certificate collection in Root CA certificate store
security: Obtain certificate collection in Root CA certificate store
security: No timestamping info available
security: Found jurisdiction list file
security: Start checking trusted extension for this certificate
security: Start comparing to jurisdiction list with this certificate
security: The CRL support is disabled
security: The OCSP support is disabled
security: This OCSP End Entity validation is disabled
security: Checking if certificate is in Deployment denied certificate store
security: Checking if certificate is in Deployment permanent certificate store
basic: Applet loaded.
basic: Applet resized and added to parent container
basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 281458 us, pluginInit dt 604408 us, TotalTime: 885866 us
basic: Loaded image: file:/C:/Users/Jesus/Desktop/euo/experimentJME/GravityArenaDemo/dist/Applet/appletprogress.gif
network: Cache entry not found [url: file:/C:/Users/Jesus/Desktop/euo/experimentJME/GravityArenaDemo/dist/Applet/lzma.jar, version: null]
security: Loading certificates from Deployment session certificate store
security: Loaded certificates from Deployment session certificate store
security: Validate the certificate chain using CertPath API
security: Obtain certificate collection in Root CA certificate store
security: Obtain certificate collection in Root CA certificate store
security: No timestamping info available
security: Found jurisdiction list file
security: Start checking trusted extension for this certificate
security: Start comparing to jurisdiction list with this certificate
security: The CRL support is disabled
security: The OCSP support is disabled
security: This OCSP End Entity validation is disabled
security: Checking if certificate is in Deployment denied certificate store
security: Checking if certificate is in Deployment permanent certificate store
network: Cache entry not found [url: file:/C:/Users/Jesus/Desktop/euo/experimentJME/GravityArenaDemo/dist/Applet/lzma.jar, version: null]
network: Cache entry not found [url: file:/C:/Users/Jesus/Desktop/euo/experimentJME/GravityArenaDemo/dist/Applet/lzma.jar, version: null]
security: Loading certificates from Deployment session certificate store
security: Loaded certificates from Deployment session certificate store
security: Validate the certificate chain using CertPath API
security: Obtain certificate collection in Root CA certificate store
security: Obtain certificate collection in Root CA certificate store
security: No timestamping info available
security: Found jurisdiction list file
security: Start checking trusted extension for this certificate
security: Start comparing to jurisdiction list with this certificate
security: The CRL support is disabled
security: The OCSP support is disabled
security: This OCSP End Entity validation is disabled
security: Checking if certificate is in Deployment denied certificate store
security: Checking if certificate is in Deployment permanent certificate store
network: Cache entry not found [url: file:/C:/Users/Jesus/Desktop/euo/experimentJME/GravityArenaDemo/dist/Applet/lzma.jar, version: null]
basic: Plugin2ClassLoader.getPermissions CeilingPolicy allPerms
basic: Applet initialized
basic: Applet made visible
basic: Starting applet
basic: completed perf rollup
basic: Applet started
basic: Told clients applet is started
network: Cache entry not found [url: file:/C:/Users/Jesus/AppData/Local/Temp/lwjglcache/localhost/MyGame/code.jar, version: null]
null
null
This occurred while 'Initializing real applet'
access denied (java.util.PropertyPermission http.agent write)
java.security.AccessControlException: access denied (java.util.PropertyPermission http.agent write)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.System.setProperty(Unknown Source)
at mygame.Main.(Main.java:84)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at com.jme3.app.AppletHarness.createCanvas(AppletHarness.java:108)
at com.jme3.app.AppletHarness.init(AppletHarness.java:154)
at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:1326)
at org.lwjgl.util.applet.AppletLoader$2.run(AppletLoader.java:909)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Ah, seems like you’re not allowed to set that as an applet.

@normen said:
Ah, seems like you're not allowed to set that as an applet.


Maybe in the Applet.cfg file? Is that something that can be set there?

No idea, :google: is your friend. If it works locally but not on your server its the server.

@normen said:
No idea, :google: is your friend. If it works locally but not on your server its the server.


Okay well I'll wait and see what godaddy has to say before freaking out too much.

I still haven’ t gotten this to work and had a similar problem with a different hosting service.

So far I’ve tried HostMySite and GoDaddy, on both I’ve put the applet folder from the dist (which runs from my computer) and they both give me the same error about having problems with the input stream with lwjgl.jar.pack.lzma.

The console says:

java.lang.Exception: Unable to get input stream for lwjgl.jar.pack.lzma
at org.lwjgl.util.applet.AppletLoader.getJarInputStream(AppletLoader.java:1603)
at org.lwjgl.util.applet.AppletLoader.downloadJars(AppletLoader.java:1475)
at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:871)
at java.lang.Thread.run(Unknown Source)
java.lang.Exception: Unable to get input stream for lwjgl.jar.pack.lzma
at org.lwjgl.util.applet.AppletLoader.getJarInputStream(AppletLoader.java:1603)
at org.lwjgl.util.applet.AppletLoader.downloadJars(AppletLoader.java:1475)
at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:871)
at java.lang.Thread.run(Unknown Source)
java.lang.Exception: Unable to get input stream for lwjgl.jar.pack.lzma
at org.lwjgl.util.applet.AppletLoader.getJarInputStream(AppletLoader.java:1603)
at org.lwjgl.util.applet.AppletLoader.downloadJars(AppletLoader.java:1475)
at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:871)
at java.lang.Thread.run(Unknown Source)
This occurred while ‘Downloading packages’
failed to download lwjgl.jar.pack.lzma after 3 attempts
java.lang.Exception: failed to download lwjgl.jar.pack.lzma after 3 attempts
at org.lwjgl.util.applet.AppletLoader.downloadJars(AppletLoader.java:1551)
at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:871)
at java.lang.Thread.run(Unknown Source)

Maybe register a MIME type for these files so they are definitely transferred as binary files?

1 Like
@normen said: Maybe register a MIME type for these files so they are definitely transferred as binary files?

Thanks for responding, I’ll give that a try, though I need help understanding what to do.

I have 2 questions, along with some reference material about what I’m doing.

Here’s “how to add custom mime types” for godaddy

Questions:
For the extension… do I want .jar.pack.lzma? Just .lzma?

And as for the mimeType=“TYPE/SUBTYPE” bit…
do I just put binary or what?

This recommends application/octet-stream

Does that seem to make sense?

Oh and I did manage to find that .jar’s type is application/java-archive

application/something should be fine.

1 Like
@normen said: application/something should be fine.

Yeah that makes sense, but what about the extension. Is it that whole mess .jar.pack.lzma or just the .lzma?