Use the Java Reflections utilities. Issue myObject.getClass().getName() on the object that you are trying to cast to something and print it out... the variable you call statement... is that a JDBC statement? If it is you should not cast it to whatever the jdbc driver vendor has implemented it as.
 
regards,
Patrik Andersson
-----Original Message-----
From: Erik Sundberg [mailto:[EMAIL PROTECTED]]
Sent: den 14 november 2000 22:10
To: Orion-Interest
Subject: ClassCastException servletproblem

hi,
 
Just started doing servlet programming and using Orion.
I made this servlet which compiles just fine but at runtime
the server responde with a ClassCastException and I just
can�t understand why.  Here is where I get the errors:
 
cpool = (ConnectionPool)context.getAttribute("cpool");
 
org.gjt.mm.mysql.Statement state = (org.gjt.mm.mysql.Statement)statement;
 
the ConnectionPool class is placed in the same package as the
Servlet and the jdbc driver is in the /lib dir.
 
I hope this explains my problem, hope anyone can help me
I have spent alot of time trying to find out what can be wrong.
The casts is legal for sure.
 
thanks,
 
-erik

Reply via email to