Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!
  • 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:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

ClassCastException when casting to home interface

 
Ranch Hand
Posts: 701
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have the following code on my Delegate class:


I get a ClassCastException on





Debugging code in Eclipse I see that "initContext.lookup(JNDIName)" is an object type "_RecursoHome_Stub". So the error should't happen, isn't it?


I use Sun One Appication Server 7, Struts and EJB. The application structure is the same as it was in JBoss, on which worked fine.

Follwing the contents of ejb-jar.xml, sun-ejb-jar.xml, sun-web.xml and web.xml:

ejb-jar.xml:



sun-ejb-jar.xml:




sun-web.xml:

web.xml:




Thanks in advance
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am not sure if it works..but try doing a explicit type cast of the object returned by initialContext into your Remote Home Interface.

User PortableRemoteObject.narrow() and check if it still gives the same exception.

Ashwini
 
Rogerio Kioshi
Ranch Hand
Posts: 701
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

Tried to do:



But the ClassCastException still happens. Any other idea?


Following the complete class code:

[ June 07, 2006: Message edited by: Oscar Kinto ]
 
Rogerio Kioshi
Ranch Hand
Posts: 701
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've solved the problem! The packaging structure used in JBoss does not work at SunOne.
I put the remote and bean classes in the same package (ejb), and put this at ejb jar.
 
expectation is the root of all heartache - shakespeare. tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic