• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

PortableRemoteObject.narrow - ClassCastException

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I migrated my EJB from Weblogic 7.0 to S1AS 7.
I have an servlet client accessing the an EJB.
I am getting the following exception when Servlet tries to marshel the Home object.
I verified the classpath in conifg\server.xml of the app server instance is correct.
SEVERE: StandardWrapperValve[keyservlet]: Servlet.service() for servlet keyservlet threw exception java.lang.ClassCastException
at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
at it.eng.securitymanager.authentication.servlet.GetAccessServlet.doPost(GetAccessServlet.java:100)
Any idea what I am missing?
Thanks
Satish
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
why are you using
"PortableRemoteObject.narrow(...."
rather you can use
"objInitialContext.lookup("java:comp/env/ejb/...");"
It will not generate ClassCastException and successfully looks the bean up.
sadheman
 
sadheman
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Satish,
i need your help. i also shifted my EJB architecture from weblogic server to Sun ONE AS 7. Can you please guide me regarding following things:
1. how to generate the deployment descriptors?
2. did u generate your deployment descriptors for sun server using sun studio?
3. why database driver you have used?
i am asking the question as i am facing some svere problems in it.
waiting for your kind help. thanks in advance.
sadheman,
 
Satish Vohra
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> 1. how to generate the deployment descriptors?
I looked into the samples of S1AS and converted the descriptors manually, since I had few EJBs.
You can also take a look at Sun One Migration tool.
> 2. did u generate your deployment descriptors for sun server using sun studio?
No
> 3. why database driver you have used?
I am using mySQL connector-j .
Hope it helps.
Satish
 
Satish Vohra
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I resolved the ClassCastException problem with PortableRemoteObject.narrow() by putting the Client Jar (with Stub/Skeleton) in the classpath.
Satish
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic