> I tried searching the archives, but the searcher just hung. Is
> there an FAQ somewhere?)
Pointers to lots of servlet resources are available at
http://www.servlets.com.
> My servlet uses a URLClassLoader to load the appropriate class
> based on a string passed to it from the applet. I am able to get
> the class loaded, but when I try to cast it to Solver, so I can
> call it's checkAttempt() method, I get a ClassCastException. Here
> is how I do the class loading:
> A check of the logs shows that the class I'm trying to instantiate
> has Solver as a Superclass, but then "theInstance" somehow does not
> end up being an actual instance of Solver, and thus not
> castable to Solver. How can this be? What am I doing wrong?
If you load class Foo in one class loader it's not the same as class
Foo loaded by a different class loader. Both their names are Foo,
but they live in different namespaces and can't be cast to each other.
I suspect you're loading two versions of Solver.
We servlet folks became familiar with this because servlet reloading
causes a similar effect with multiple versions of the same class in
different classloaders.
-jh-
--
Jason Hunter
[EMAIL PROTECTED]
Book: http://www.servlets.com/book
Article: http://www.javaworld.com/jw-12-1998/jw-12-servletapi.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html