- This topic has 1 reply, 2 voices, and was last updated 16 years, 4 months ago by Loyal Water.
-
AuthorPosts
-
houckmanMemberHi, I have seen this question asked a few times on the net (once in this forum), but I have not really seen it answered yet, so…
I am new to MyEclipse and to Web Devellopment. I just installed everything and it all appears to be working ok. So, I thought I would write a very simple Web Application. I create a new project (Web Project) and basically followed all of the defaults. When I was done, I had a working index.jsp based app. When deployed it says “This is my first JSP Page”. I am sure most people have done this. So the, I want to add a Java screen… so, via the MyEcplise New menu, I added a new Java class, gave it a superclass of “javax.swing.JApplet” and created it. I added an override of the init(), that looks like this….
public void init() {
JLabel label = new JLabel(“Hi There”);
add(label, SwingConstants.CENTER);
}Then, I updated my index.jsp to have this line below the “This if my first JSP Page”:
<applet code=”MyWebProject.class” Width=”200″ Height=”200″></applet>MyWebProject is, of course the name of my Java class.
Runs in AppletViewer perfectly… but when I deploy to my Tomcat installation, it does not work. I still get the text (“This is my first….”), but an empty panel(?) with a red X below it. In the status bar, it says… “Applet MyWebProject noinited”.
Here is the java console trace:
load: class MyWebProject.class not found.
java.lang.ClassNotFoundException: MyWebProject.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)So, it can’t find my class…., but I am not sure how to tell it where to look. I have moved the .class file around, and have added “codebase” specifications… but to no avail.
Can anyone help? In advance, thanks!!!!!!
Loyal WaterMemberhouckman,
Im not sure what is the cause of this error. Some other user on the forum might be able to help you out. -
AuthorPosts