Hi,

I had the same problem some time ago.
The problem seemed to be a bug in the WebSphere assembly tool when it generates stubs 
and skeletons. The generated class files where put in a wrong package 
(org.omg.stub.com.ge.pms.test1 doesn't seem to right eh?).
The solution for me was to manually move the stub files to the right directory 
(org.omg.stub) and redeploy.

/Johan

-----Original Message-----
From: Ashwani Kalra [mailto:[EMAIL PROTECTED]]
Sent: den 3 december 2002 07:04
To: [EMAIL PROTECTED]
Subject: Re: ClassCastException on WebSphere 4.0



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

===========================================================================
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".

Reply via email to