• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Applet not inited

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a java applet (a Roulette)

And a php server-side.

So, I want to start applet and it fails:

The code to start applet:


The applet is inited locally:
start.html ( contains the code as above )
Roulette.jar

If I want to launch it on my local server:

the code is:


/Roulette.jar - as the .jar is located at DocRoot

So, when I open the sites's page, I have:
java.lang.NoClassDefFoundError: Roulette (wrong name: Roulette/Roulette)

That's about IE6, FF2

In Opera Applet is actually loaded! - but without sound.

Can anyone tell me the reason for such behaviour?

Thanks for answers in advance.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

It sounds as if you have a Roulette class in a package called Roulette (that's what "wrong name: Roulette/Roulette" hints at), while the code attribute of the applet tag specifies that the Roulette class is not in any package. If the class actually is in a package called Roulette, use code="Roulette.Roulette".
 
Alex Grakoff
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are right, but now I got another message:



somewhere I read that "Incompatible magic value" can happen because of the JRE.

I'm using jre1.6 and the code was compiled using 1.4 - so probably I should compile it with jre1.6 ?

Thank you for the previous reply!
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, there should be no need to recompile. Anything compiled with 1.4 is usable with 1.6. The other way around it wouldn't work.

But this is a different error message anyway. I'm guessing that the jar file you uploaded is corrupt (maybe you used FTP in ASCII mode instead of binary mode?). Download the jar file to your machine and see if a ZIP utility can open it.
 
Alex Grakoff
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Dear Ulf!

the jar if OK.

it is not corrupted, and in fact I can start it locally (without webserver)

Locally: i.e. there is an .html file and .jar in the same dir.

HTML:


So, when I open HTML - Applet is loaded correctly.

When I try to open it via webserver, I got:




Incompatible magic value 1008813135

where can I have a look to solve that problem?

Thank you in advance!
 
Alex Grakoff
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
besides, if the file had beed corrupted, I think it wouldn't loaded.

but it loads correctly on my PC.

btw: I test everything on my local PC. i.e. Webserver is on my PC.

and the file is located at the same place.

I just put .html at

/roulette/start.html
/roulette/Roulette.jar

and the URL to open via server:
http://app.server.name/games/Roulette/Roulette.jar
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic