It could be that you load the class with two different class loaders - see
whether you have the file both in you component jar and e.g. your system
class path.
____________________________________________________________________
Stefan Tilkov -- stefan(dot)tilkov(at)innoq(dot)com -- www.innoQ.com
> -----Ursprungliche Nachricht-----
> Von: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]Im Auftrag von Saurabh Khare
> Gesendet: Donnerstag, 17. August 2000 19:50
> An: [EMAIL PROTECTED]
> Betreff: ClassCastError
>
>
> Having tried for half a day.. I have resorted to the mailing list.!
> Basically, I have a servlet thats using an EJB, so I have this lookup
> procedure (below) in the performTask method of the servlet class...
>
> ....
> Object object = ctx.lookup("Sample");
> sampleHome =
> (ejb_cics_sample.SampleHome)javax.rmi.PortableRemoteObject.narrow(
(org.omg.CORBA.Object)object,
>
> ejb_cics_sample.SampleHome.class);
> ....
>
> and I keep getting a runtime error of:
>
> java.lang.ClassCastException
> at
> javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:330)
> at sample.SampleServlet.performTask(SampleServlet.java:136)
> at sample.SampleServlet.doPost(SampleServlet.java:64)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:566)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:639)
> at
> com.ibm.servlet.engine.webapp.StrictServletInstance.doService(Serv
> letManager.java:557)
> at
> com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(Stri
> ctLifecycleServlet.java:160)
> at
> com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifec
> ycleServlet.java:287)
> at
> com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(Stric
> tLifecycleServlet.java:105)
> at
> com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManag
> er.java:349)
> at
> com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(
> ServletManager.java:705)
> at
> com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(Se
> rvletManager.java:631)
> at
> com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebApp
> Dispatch(WebApp.java:1129)
> at
> com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(Web
> App.java:1001)
> at
> com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebA
> pp.java:960)
> at
> com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebG
> roup.java:681)
> at
> com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocatio
> n(CachedInvocation.java:67)
> at
> com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(S
ervletRequestProcessor.java:139)
> at
> com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(O
> SEListener.java:300)
> at
> com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunna
> ble.run(SQEventListenerImp.java:230)
> at
> com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEven
> t(SQEventListenerImp.java:104)
> at
> com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notif
> yEvent(SQEventSource.java:202)
> at
> com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSourc
> e$SelectRunnable.notifyService(SQWrapperEventSource.java:347)
> at
> com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSourc
> e$SelectRunnable.run(SQWrapperEventSource.java:216)
> at
> com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRu
> nnable.run(OutOfProcThread.java:248)
> at java.lang.Thread.run(Thread.java:472)
>
> Any ideas anyone? I have tried even without the (org.omg.CORBA.Object)
> bit.. no good! Thanx in advance!
>
>
> Saurabh Khare
>
> ==================================================================
> =========
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".