Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

ClassNotFoundException in Applet

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am running an applet with the code as below:-

<!DOCTYPE html>
<html>
<head>
<style>
.pos_right
{
position:relative;
left:950px;
top:274px;
}
</style>
</head>
<body>
<div id="container" style="width:1200px">

<div id="header" style="background-color:#E55451;">
<h2 style="margin:auto;width:80%;height:50%;">CHESS GAME</h2></div>

<div id="menu" style="background-color:#E77471;height:450px;width:200px;float:left;">
</div>
<div class="pos_left" style="background-color:#EEEEEE;height:450px;width:1000px;float:left;">
<object type="application/x-java-applet" width="100" height="100">
<param name="code" value="chess.ChessClient" />
<param name="archive" value="ChessClient.jar" />
<param name="archive" value="json-simple-1.1.1_1.jar" />
Applet failed to run. No Java plug-in was found.
</object>
<div class="pos_right">
<object type="application/x-java-applet" width="50" height="70">
<param name="code" value="chat.ChatClient" />
<param name="archive" value="ChatClient.jar" />
<param name="java_arguments" value="-Djava.security.manager"/>
Applet failed to run. No Java plug-in was found.
</object>
</div>
</div>
<div id="footer" style="background-color:#E55451;clear:both;text-align:center;">
Archana Jain</div>
</div>
</body>
</html>


The ChessClient.jar is available in the directory and has the below contents:-

[root@ip-172-31-3-228 source]# jar cvfm ChessClient.jar mymanifest.txt chess
added manifest
adding: chess/(in = 0) (out= 0)(stored 0%)
adding: chess/ChessBoard$3.class(in = 796) (out= 507)(deflated 36%)
adding: chess/image/(in = 0) (out= 0)(stored 0%)
adding: chess/image/Black_king_w.jpg(in = 1621) (out= 1476)(deflated 8%)
adding: chess/image/White_pawn_c.jpg(in = 1273) (out= 1113)(deflated 12%)
adding: chess/image/Black_Knight_w.jpg(in = 1517) (out= 1365)(deflated 10%)
adding: chess/image/White_queen_w.jpg(in = 1697) (out= 1550)(deflated 8%)
adding: chess/image/Black_pawn_w.jpg(in = 1220) (out= 1059)(deflated 13%)
adding: chess/image/White_king_w.jpg(in = 1709) (out= 1568)(deflated 8%)
adding: chess/image/Black_Rook_w.jpg(in = 1457) (out= 1311)(deflated 10%)
adding: chess/image/White_queen_c.jpg(in = 1642) (out= 1498)(deflated 8%)
adding: chess/image/White_Knight_w.jpg(in = 1624) (out= 1477)(deflated 9%)
adding: chess/image/White_king_c.jpg(in = 1674) (out= 1530)(deflated 8%)
adding: chess/image/White_pawn_w.jpg(in = 1303) (out= 1131)(deflated 13%)
adding: chess/image/White_Knight_c.jpg(in = 1603) (out= 1455)(deflated 9%)
adding: chess/image/Black_Rook_c.jpg(in = 1441) (out= 1292)(deflated 10%)
adding: chess/image/Black_queen_w.jpg(in = 1550) (out= 1402)(deflated 9%)
adding: chess/image/White_Rook_w.jpg(in = 1467) (out= 1318)(deflated 10%)
adding: chess/image/Black_Knight_c.jpg(in = 1483) (out= 1330)(deflated 10%)
adding: chess/image/Black_Bishop_c.jpg(in = 1427) (out= 1275)(deflated 10%)
adding: chess/image/Black_king_c.jpg(in = 1594) (out= 1443)(deflated 9%)
adding: chess/image/Black_Bishop_w.jpg(in = 1449) (out= 1299)(deflated 10%)
adding: chess/image/White_Bishop_c.jpg(in = 1507) (out= 1359)(deflated 9%)
adding: chess/image/Black_queen_c.jpg(in = 1521) (out= 1372)(deflated 9%)
adding: chess/image/White_Rook_c.jpg(in = 1461) (out= 1315)(deflated 9%)
adding: chess/image/Black_pawn_c.jpg(in = 1208) (out= 1047)(deflated 13%)
adding: chess/image/White_Bishop_w.jpg(in = 1532) (out= 1388)(deflated 9%)
adding: chess/ChessBoard.class(in = 95986) (out= 26682)(deflated 72%)
adding: chess/ChessClient.class(in = 2240) (out= 1273)(deflated 43%)
adding: chess/ChessBoard$2.class(in = 784) (out= 484)(deflated 38%)
adding: chess/ChessBoard$cBoard.class(in = 2484) (out= 1353)(deflated 45%)
adding: chess/ChessBoard$ReadPartner2.class(in = 1881) (out= 1096)(deflated 41%)
adding: chess/ChessBoard$ReadPartner.class(in = 3104) (out= 1755)(deflated 43%)
adding: chess/ChessBoard$1.class(in = 756) (out= 478)(deflated 36%)
adding: chess/ChessBoard$sBoard.class(in = 635) (out= 392)(deflated 38%)
adding: chess/ChessBoard$coord.class(in = 417) (out= 298)(deflated 28%)
adding: chess/ChessBoard$4.class(in = 623) (out= 438)(deflated 29%)
adding: chess/ChessBoard$ReadPartner1.class(in = 1302) (out= 738)(deflated 43%)


Still I am getting the below error:-


ClassNotFoundException


chess.ChessClient

Can somebody help me regarding this?

Thanks in advance
Archana

 
Archana Jain
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One more thing I forgot to write previously is that I am running the code from AWS server. And there only I am getting the error.
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The object tag is way outdated. Use an applet tag, or one of the applet deploy JavaScripts.
 
Archana Jain
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks the issue got resolved by using an applet tag
 
When I was younger I felt like a man trapped inside a woman’s body. Then I was born. My twin is a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic