[4711] in java-interest

home help back first fref pref prev next nref lref last post

retrieving custom classes at runtime

daemon@ATHENA.MIT.EDU (John D. Kane)
Thu Jan 11 13:14:49 1996

From: "John D. Kane" <john@insightnews.com>
To: "' java@java.sun.com'" <java@java.sun.com>,
        "'java-interest@java.sun.com'" <java-interest@java.sun.com>,
        "'jug@solect.com'" <jug@solect.com>
Date: Thu, 11 Jan 96 11:11:00 PST


__My Problem__
The problem I'm having occurs at runtime. I get the following error in 
Netscape's Java console:

# Applet exception: exception: xclass.RemoteRetrieval
java.lang.ClassNotFoundException: xclass.RemoteRetrieval
     at 
netscape.applet.AppletClassLoader.findClass(AppletClassLoader.java:170)
     at 
netscape.applet.AppletClassLoader.loadClass(AppletClassLoader.java:121)
     at
     at 
netscape.applet.EmbeddedAppletFrame.run(EmbeddedAppletFrame.java:281)
     at java.lang.Thread.run(Thread.java:289)

RemoteRetrieval is my own class to quickly grab a remote file from the 
server back to the client by encapsulating a lot of the URL and 
URLConnection methods. From now own I'll refer to RemoteRetrieval as 
myObject, just to make life easier.


__My directory structure__
I've created a directory off the root called \xjava\ to store all my own 
java source and classes. \xjava\ has one subdirectory for the .java files 
called xsrc\ and one subdirectory for the .class files called xclass\


__About the source and compiled objects I use:__
I've also included D:\xjava to my CLASSPATH environment variable. I compile 
my source files by the syntax 'javac -d \xjava\ myObject.java'. In addition, 
my source files include the 'package xclass;' statement to place the 
compiled classes in their appropriate places.

My main applet is in another directory off the web site with the .htm 
document in the same directory. I can easily include my own classes from 
that \xjava\ directory. For example:

   import xclass.myObject;

   public class myApplet extends Applet implements Runnable {
      myObject anObj = null;
     ... // all the methods ...
   }

So I have assumed there is no problem with the CLASSPATH environment 
variable, the directory structures and packages, or the code because my 
applet (myApplet.java) compiles perfectly, bringing in my own classes from 
the \xjava\xclass directory structure.


So why do I have this runtime error? I figure I can't play around with any 
of the aforementioned issues because they all seem to be working correctly. 
What more must I do so that my class will be found at runtime? I can't see 
why this runtime thing is an issue because the class has already been 
imported into my source.

John
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post