• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Getting Class cast exception while Lookup EJB2.1 session bean using JNDI name in WAS6.1

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Problem Statement is :

Following Client Program is running fine:



But if i am trying to do the same stuff for other session bean using JNDI name specified in WAS6.1 i am getting

Caught an unexpected exception!
java.lang.ClassCastException: Unable to load class: com.infy.display._DisplayHome_Stub
at com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:372)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:156)
at DisplayClient.main(DisplayClient.java:41)

The Code for this is :



After debugging for entire one day i have come to know that In ConverterClient(running program) when class coming as a result of "LOOKUP IS : com.infy.converter._ConverterHome_Stub" WHILE IN SECOND CASE IT IS:" org.omg.stub.java.rmi._Remote_Stub" BUT IT should be something like this com.infy.display._DisplayHome_Stub" and also the Classloader is null.Kindly let me know How can i resolve this issue.
 
author & internet detective
Posts: 40487
823
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've added [ code ] tags to your post to make it easier to read.


Are you sure this is your JNDI name. Usually they begin with ejb/
 
ketaki gujarathi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jeanne,
I was able to resolve the classcast exception .
Following was the issue::
I was using eclipse and in the classpath of the WS i was referring to the jre of WAS on which my ear was deployed.
However after i moved back to the default jre provided by eclipse things started working as per the expectations.

Thanks a lot ...
 
please buy this thing and then I get a fat cut of the action:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic