Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (532)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  ClassNotFound error when running applet in browser?  (Read 1343 times)
0 Members and 1 Guest are viewing this topic.
Offline RoboAwesome

Junior Newbie





« Posted 2012-12-23 22:02:14 »

Hi,
So I am trying to run a little game I made within a browser. I followed the Spin's tutorial in the wiki but I feel that it left out some important information. I have signed the jar I created from my game and I have all necessary files in the appropriate folder. The HTML is directly copied from the tutorial with the appropriate name changes. Yet I still receive this error
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
Sun Dec 23 15:41:43 EST 2012 INFO:Clear up
Sun Dec 23 15:41:43 EST 2012 ERROR:org.myorg.SpaceWalk
java.lang.ClassNotFoundException: org.myorg.SpaceWalk
   at java.net.URLClassLoader$1.run(Unknown Source)
   at java.net.URLClassLoader$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Unknown Source)
   at org.newdawn.slick.AppletGameContainer.init(AppletGameContainer.java:124)
   at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:1330)
   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$200(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$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)
This occurred while 'Initializing real applet'
Unable to create game container
java.lang.RuntimeException: Unable to create game container
   at org.newdawn.slick.AppletGameContainer.init(AppletGameContainer.java:148)
   at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:1330)
   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$200(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$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)


My HTML is here:http://pastebin.com/4fwaUsB1
And a snapshot of my GAME-LIB folder for sanity:

Offline tyeeeee1
« Reply #1 - Posted 2012-12-23 22:06:53 »

This probably won't be much help, but try using this HTML just to see if your applet actually works. (I barley know anything about HTML or applets but this is how I was told to test them. This only works if you have one class as far as I know.)

1  
2  
3  
4  
5  
6  
<html>
 <body>
 <applet code = "ClassNameHere.class" width=300 height=300>
 </applet>
 </body>
 </html>
Offline RoboAwesome

Junior Newbie





« Reply #2 - Posted 2012-12-23 22:19:15 »

Hmmm nope. Another ClassNotFound exception, I tried using both main.class and org.myorg.SpaceWalk.main.class in case it didn't know which package to look in. I should note though, that this actually displays "Error: Class Not Found" on the screen whereas my HTML simply shows a blank. Thanks for the reply though

EDIT: To be clear though, it runs correctly when I run it from eclipse
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ctomni231

JGO Wizard


Medals: 98
Projects: 1
Exp: 7 years


Not a glitch. Just have a lil' pixelexia...


« Reply #3 - Posted 2012-12-24 03:15:30 »

Yeah, you are using LWJGL. Which means you are going to need the tutorials to get that specific applet running. You might have to do a bit of looking around, but the link below will give you a good start on how.

Ninja Cave

Offline RoboAwesome

Junior Newbie





« Reply #4 - Posted 2012-12-25 07:25:58 »

Well Slick uses LWJGL's loader so I thought it would be the same? I followed a Slick tutorial this time and I had actually followed that same tutorial you linked previously and ended up with the same error. Frankly, I am starting to wonder if all this time trying to get this browser game running is worth it, with HTML 5 being the new cool kid now. Hell even Javascript looks trendier. Don't get me wrong, Java is still my language of choice and I think Slick+ Java is awesome for GameDev, but I think I might just hop on the HTML5 bandwagon for my next browser game.
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 74
Projects: 15


★★★★★


« Reply #5 - Posted 2012-12-25 14:27:03 »

Do try putting all the jars in the same folder as the html file and changing the following part of the html

from
1  
codebase="./GAME-LIB/"

to
1  
codebase="."


Your error basically says it can't find your game class files (maybe because it can't find the jars).
Offline RoboAwesome

Junior Newbie





« Reply #6 - Posted 2012-12-26 00:07:08 »

No luck Sad I tried moving everything to GAME-LIB and I tried putting all the JARS in the root of the folder with the HTML and nadda.
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 74
Projects: 15


★★★★★


« Reply #7 - Posted 2012-12-26 01:53:38 »

have you got a link to the actual applet ? should make finding the problem much easier.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (15 views)
2014-07-24 01:59:36

Riven (14 views)
2014-07-23 21:16:32

Riven (13 views)
2014-07-23 21:07:15

Riven (15 views)
2014-07-23 20:56:16

ctomni231 (43 views)
2014-07-18 06:55:21

Zero Volt (40 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (36 views)
2014-07-16 23:30:00

Cero (51 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!