Deploy applet with JNLP file load wrong package


S

SamuelXiao

Hi all, I am deploying an applet containing a jnlp file. I follow the
instructions from
http://download.oracle.com/javase/tutorial/deployment/applet/deployingApplet.html
it is work when I tried its sample, however, when I changed the
AppletPage.html and xxx-applet.jnlp with my applet, it always loads
the wrong package and I am sure my code was compiled correctly.

From the oracle sample, it has 3 html which 2 with using JNLP while 1
using no JNLP. I can successfully run the applet (so I'm sure the jar
is correct) with no jnlp for my own program. But for the html using
jnlp, it always load the wrong package and results in classNoFound.
Below is the error from java console.

Java Plug-in 1.6.0_22
applets.MonopolyEntry。
java.lang.ClassNotFoundException: applets.MonopolyEntry
at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown
Source)
at sun.plugin2.applet.JNLP2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager
$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception:java.lang.ClassNotFoundException: applets.MonopolyEntry

My MonopolyEntry.class is under applet (no 's') folder instead of
applets folder, I tried restart the PC, clear the cache and so on, but
still has this error. Does anyone has any idea?

my jnlp:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="" href="">
<information>
<title>Simple Monopoly Board Game demo</title>
</information>
<resources>
<!-- Application Resources -->
<j2se version="1.6+"
href="http://java.sun.com/products/autodl/j2se" />
<jar href="MonopolyDemo.jar" main="true"/>
<jar href="log4j-1.2.16.jar"/>

</resources>
<applet-desc
name="Monopoly Board Game Applet"
main-class="applet.MonopolyEntry"
width="400"
height="400">
</applet-desc>
<update check="alwyas" policy="always"/>
</jnlp>

and my html:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Simple Monopoly Board Game Demo Page</title>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<h1>Monopoly Board Game Applet demo </h1>

<script src="http://www.java.com/js/deployJava.js"></script>
<script>
var attributes = { code:'applet.MonopolyEntry.class',
archive:'MonopolyDemo.jar,log4j-1.2.16.jar', width:400, height:
400} ;
var parameters = {jnlp_href: 'monopolyentry-applet.jnlp'} ;
deployJava.runApplet(attributes, parameters, '1.6');
</script>

<!-- ********** DO NOT ALTER ANYTHING BELOW THIS LINE ! *********** --<!-- Below code will send the info to Omniture server -->
<script language="javascript">var
s_code=s.t();if(s_code)document.write(s_code)</script>

<!-- End SiteCatalyst code -->
</body>
</html>

any help would be highly appreciated!
 
Ad

Advertisements

L

Lew

SamuelXiao said:
Hi all, I am deploying an applet containing a jnlp file. I follow the
instructions from http://download.oracle.com/javase/tutorial/deployment/applet/deployin...
it is work when I tried its sample, however, when I changed the
AppletPage.html and xxx-applet.jnlp with my applet, it always loads
the wrong package and I am sure my code was compiled correctly.

But for the html using
jnlp, it always load the wrong package and results in classNoFound [sic].
Below is the error from java console.

Java Plug-in 1.6.0_22
applets.MonopolyEntry。
java.lang.ClassNotFoundException: applets.MonopolyEntry
        at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown
Source)
        at sun.plugin2.applet.JNLP2ClassLoader.findClass(Unknown Source)
        at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
        at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
        at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
        at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
        at sun.plugin2.applet.Plugin2Manager
$AppletExecutionRunnable.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Exception:java.lang.ClassNotFoundException: applets.MonopolyEntry

My MonopolyEntry.class is under applet (no 's') folder instead of
applets folder,

There's your trouble right there. The program is asking for
'applets.MonopolyEntry' but you don't have any such class.

What is the 'package' declaration inside MonopolyEntry.java?

What code is trying to refer to 'applets.MonopolyEntry'? (Hint: Use
your editor's "Find" command.)
 
Ad

Advertisements

S

SamuelXiao

SamuelXiao said:
Hi all, I am deploying an applet containing a jnlp file. I follow the
instructions fromhttp://download.oracle.com/javase/tutorial/deployment/applet/deployin...
it is work when I tried its sample, however, when I changed the
AppletPage.html and xxx-applet.jnlp with my applet, it always loads
the wrong package and I am sure my code was compiled correctly.
But for the html using
jnlp, it always load the wrong package and results in classNoFound [sic].
Below is the error from java console.
Java Plug-in 1.6.0_22
applets.MonopolyEntry。
java.lang.ClassNotFoundException: applets.MonopolyEntry
        at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown
Source)
        at sun.plugin2.applet.JNLP2ClassLoader.findClass(Unknown Source)
        at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
        at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
        at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
        at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
        at sun.plugin2.applet.Plugin2Manager
$AppletExecutionRunnable.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Exception:java.lang.ClassNotFoundException: applets.MonopolyEntry
My MonopolyEntry.class is under applet (no 's') folder instead of
applets folder,

There's your trouble right there.  The program is asking for
'applets.MonopolyEntry' but you don't have any such class.

What is the 'package' declaration inside MonopolyEntry.java?

What code is trying to refer to 'applets.MonopolyEntry'?  (Hint: Use
your editor's "Find" command.)

Thanks, the issue has been resolved.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top