wood burning stoves 2.0*
The moose likes Applets and the fly likes Java Web Application Won't Load. (Can't find class) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Java Web Application Won Watch "Java Web Application Won New topic
Author

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

Bob Bilfred
Greenhorn

Joined: Nov 01, 2011
Posts: 7
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

Joined: Oct 01, 2001
Posts: 2771
    
  10

Do you upload them via FTP? Is it possible you're not turning on binary transfer mode for the jar?
Bob Bilfred
Greenhorn

Joined: Nov 01, 2011
Posts: 7
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
Bartender

Joined: Oct 14, 2005
Posts: 18155
    
    8

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

Joined: Nov 01, 2011
Posts: 7
I checked, and it does contain planeGame.class.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9995
    
    7

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)


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Bob Bilfred
Greenhorn

Joined: Nov 01, 2011
Posts: 7
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
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
Just to make sure: you are able to download the jar file via HTTP? Are there any further messages in the Java Console?


Ping & DNS - updated with new look and Ping home screen widget
Bob Bilfred
Greenhorn

Joined: Nov 01, 2011
Posts: 7
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
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
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

Joined: Nov 01, 2011
Posts: 7
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Web Application Won't Load. (Can't find class)
 
Similar Threads
Thoroughly Confused about ClassLoading in JAVA
Webspere 345 exam questions
File path issues while reading an xsl file in java
Cannot load applet
Run JAR file in Applet