Hi,
Sorry for confusion . I am doing the following
Object objref = m_objContext.lookup(l_strJNDIName);
Object obj = PortableRemoteObject.narrow(objref, AccountSessionHome.class);
I am then casting this to appropriate home. I am getting the exception at
the second line.
instead of
AccountSessionHome home= (AccountSessionHome)
PortableRemoteObject.narrow(ObjectRef , AccountSesssionHome.class);
Exception is
java.lang.ClassCastException: Unable to load class:
org.omg.stub.com.ge.pms.test1._AccountSessionHome_Stub
at
com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.j
ava:269)
at
javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:136)
at
com.ge.pms.servicelocator.ServiceLocator.getHome(ServiceLocator.java:109
)
at com.ge.pms.test1.Client.InvokeService(Client.java:30)
at com.ge.pms.test1.Client.main(Client.java:46)
java.lang.NullPointerException
Ashwani Kalra
<[EMAIL PROTECTED]> To:
[EMAIL PROTECTED]
Sent by: WebSphere User Group cc: (bcc:
ashwani.kalra/Polaris)
Tech Q & A Forum Subject: Re:
ClassCastException on WebSphere 4.0
<[EMAIL PROTECTED]
-INTL.COM>
12/03/2002 10:51 AM
Please respond to WebSphere
User Group Tech Q & A Forum
I am doing it. I am returning a general class javax.ejb.EJBHome from my
serviceLocator.
My client is doing the casting. Probabably I should add more info.
I am using External java client but using IBM jdk runtime to avoid any
problems. I dont know why its looking for the stub class. Client need only
home and remote interface to work with.
Sachin Shetty
<[EMAIL PROTECTED]> To:
[EMAIL PROTECTED]
Sent by: WebSphere User Group cc: (bcc:
ashwani.kalra/Polaris)
Tech Q & A Forum Subject: Re:
ClassCastException on WebSphere 4.0
<[EMAIL PROTECTED]
-INTL.COM>
12/03/2002 10:18 AM
Please respond to WebSphere
User Group Tech Q & A Forum
U need to cast it.
Probably this should work
AccountSessionHome home= (AccountSessionHome)
PortableRemoteObject.narrow(ObjectRef , AccountSesssionHome.class);
Any if even this doesn't work check if u have the same class at two diff
Locations, both in the classpath.
--
More Later ...
Thanks and Regards,
Sachin Shetty
-----------------------------------------
"If you want to travel around the world and be invited to speak at a lot
of different places about your work, just write a Unix like operating
system."
(By Linus Torvalds)
-----Original Message-----
From: WebSphere User Group Tech Q & A Forum
[mailto:[EMAIL PROTECTED]] On Behalf Of Ashwani
Kalra
Sent: Tuesday, December 03, 2002 10:04 AM
To: [EMAIL PROTECTED]
Subject: ClassCastException on WebSphere 4.0
Hi all,
I am getting the following exception when at the code below.
AccountSessionHome home= PortableRemoteObject.narrow(ObjectRef ,
AccountSesssionHome.class);
where ObjectRef I got after looking up home object.
java.lang.ClassCastException: Unable to load class:
org.omg.stub.com.ge.pms.test1._AccountSessionHome_Stub
at
com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.j
ava:269)
at
javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:136)
at
com.ge.pms.servicelocator.ServiceLocator.getHome(ServiceLocator.java:109
)
at com.ge.pms.test1.Client.InvokeService(Client.java:30)
at com.ge.pms.test1.Client.main(Client.java:46)
java.lang.NullPointerException
Any body faced this problem before ?
Any hints will be helpfull to me
TIA
Ashwani
********************* To leave this List *******************
Write to [EMAIL PROTECTED] and, in the text of
your message (not the subject line), write: SIGNOFF WEBSPHERE
********************* To join this list ********************
Write to [EMAIL PROTECTED] and, in the text of
your message (not the subject line), write:
SUBSCRIBE WEBSPHERE yourfirstname yourlastname
********************* To leave this List *******************
Write to [EMAIL PROTECTED] and, in the text of
your message (not the subject line), write: SIGNOFF WEBSPHERE
********************* To join this list ********************
Write to [EMAIL PROTECTED] and, in the text of
your message (not the subject line), write:
SUBSCRIBE WEBSPHERE yourfirstname yourlastname
********************* To leave this List *******************
Write to [EMAIL PROTECTED] and, in the text of
your message (not the subject line), write: SIGNOFF WEBSPHERE
********************* To join this list ********************
Write to [EMAIL PROTECTED] and, in the text of
your message (not the subject line), write:
SUBSCRIBE WEBSPHERE yourfirstname yourlastname
This e-Mail may contain proprietary and confidential information and is sent for the
intended recipient(s) only.
If by an addressing or transmission error this mail has been misdirected to you, you
are requested to delete this mail immediately.
You are also hereby notified that any use, any form of reproduction, dissemination,
copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its attachment
other than by its intended recipient/s is strictly prohibited.
Visit Us at http://www.polaris.co.in