dcsimg
<strong>ClassCastException Please Help(URGENT)</strong>
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ashish_suvarna
Posted On:   Thursday, February 21, 2002 07:56 AM

Hi , I am new to EJB. I have deployed the Entity Bean. While accessing it through Servlet i am getting a error ClassCastException.I am using Weblogic6.1. Please help its urgent.I am attaching a part of my servlet code below, public void lookup(){ try{ InitialContext ic = new InitialContext(); Object objRef = ic.lookup("masterBeanJNDI"); trialweblogic.masterHome mh = (trialweblogic.masterHome)javax.rmi.PortableRemoteObject.narrow(objRef,trialweblogic.masterHome.class); }catch(Exception ex){ System.out.println("inside lookupError xx "+ex); } } The Error    More>>

Hi ,

I am new to EJB. I have deployed the Entity Bean. While accessing it through Servlet i am getting a error ClassCastException.I am using Weblogic6.1. Please help its urgent.I am attaching a part of my servlet code below,



public void lookup(){

try{

InitialContext ic = new InitialContext();


Object objRef = ic.lookup("masterBeanJNDI");


trialweblogic.masterHome mh
= (trialweblogic.masterHome)javax.rmi.PortableRemoteObject.narrow(objRef,trialweblogic.masterHome.class);


}catch(Exception ex){


System.out.println("inside lookupError xx "+ex);


}

}



The Error that i get is


inside lookup method Cannot narrow remote object to trialweblogic.masterHome

   <<Less

Re: <strong>ClassCastException Please Help(URGENT)</strong>

Posted By:   prashant_jani  
Posted On:   Friday, February 22, 2002 03:30 AM

Hi


Why dont u make a war file containing the servlet and a jar file contaiing the EJB and DD.


Package it into an ear. It should work


if the problem persists paste the complete error stack trace so that the details are known

Re: <strong>ClassCastException Please Help(URGENT)</strong>

Posted By:   Bozidar_Dangubic  
Posted On:   Thursday, February 21, 2002 08:33 AM

check the classpath. see what you got there. it is likely the problem in the classpath on the client side. code looks ok.
About | Sitemap | Contact