• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Web Application Won't Load. (Can't find class)

 
Bob Bilfred
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. I created a video game in java, created a .jar with all of the necessary files, and then created an html page with the following code to display the .jar.




When both the jar and the html page are located in the same folder, the html page loads the Java application as expected.

The problem I have is when I upload both the jar file, and html page to a web server in the same folder, the web application does not load properly. I receive and error that says it can not find "plainGame.class" (I can assure you that this class is located in the .jar file). I am fairly new to creating Java web applications, so perhaps I missed some crucial step? Thanks for any assistance in advance.
 
Greg Charles
Sheriff
Posts: 2989
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you upload them via FTP? Is it possible you're not turning on binary transfer mode for the jar?
 
Bob Bilfred
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am actually uploading them via FTP. Can you please explain how the binary transfer would fix the situation? Thanks.

Edit: Binary Transfer was actually turned on to begin with.
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you download the "testing.jar" file from the appropriate URL relative to the URL of the HTML file which refers to it? And when you do, does it contain the "planeGame.class" file?
 
Bob Bilfred
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I checked, and it does contain planeGame.class.
 
Maneesh Godbole
Saloon Keeper
Posts: 11096
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per this it would seem that the extension .class is not required. Also you might be required to define the fully qualified class name (depending on how it's packaged)
 
Bob Bilfred
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It didn't seem like these suggestions worked either as I have already viewed the page you have linked me to. Thanks though.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to make sure: you are able to download the jar file via HTTP? Are there any further messages in the Java Console?
 
Bob Bilfred
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Just to make sure: you are able to download the jar file via HTTP? Are there any further messages in the Java Console?


Yes, I am able to download it via HTTP. These are the details to the error.

 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I take it that in your first post "plainGame.class" vs. "planeGame.class" was just a typo during posting, and not the actual error message?
 
Bob Bilfred
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:I take it that in your first post "plainGame.class" vs. "planeGame.class" was just a typo during posting, and not the actual error message?


Correct. This wasn't the actual error message, it was just a typo.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic