Win a copy of TDD for a Shopping Website LiveProject this week in the Testing 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

EJB Local Home interface look up in RAD with WebSphere 5.0 test environment.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have RAD 6.0. I'm installing one application with stateless and stateful session beans. I have local home interfaces for each of the beans.
I can deply them without any errors. I can test them with UTC. In UTC interface it is showing local home interfaces in local EJB beans folder. When I use that JNDI name to look up the Local home interface, it giving me home interface instead of localhome interface and hence the classcastexception. Do you anybody had same problem with RAD and local home interfaces?
Please let me know.
Thanks,
Kiran.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I think you get remote home objects after the lookup since the universal test client is a different application and is not part of your ear (where your application is). You can only use local interfaces within the boundaries of one ear (one application). To me this sounds doesn't sound like a RAD problem. Try accessing the local home interface through some bean in the same application. Just make yourself some dummy bean that makes the lookup and check what kind of interface you get. I hope this helps.

Cheers,
Vladimir M.
 
author & internet detective
Posts: 41073
848
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
Kiran,
If it works in the UTC (as it should), but not in the JNDI lookup, something is wrong with the JNDI string. Are you using the format:
"local:ejb/ejb/com/..." ?

If you don't have the "local:" part, WebSphere assumes you want the remote interface.
 
Jeanne Boyarsky
author & internet detective
Posts: 41073
848
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
And welcome to JavaRanch!
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't ever use the local: context from application code. The local: context is a hidden, internal implementation aspect of WAS and it may change or be eliminated at any time. The only supported mechanism for looking up local EJB homes in WAS is to create an ejb-local-ref and ejb-link in the calling component, point the ejb-link at the target EJB, and look up the local home in the java:comp/env namespace at whatever name was assigned to the ejb-local-ref.

Randy Schnier
IBM WebSphere

Originally posted by Jeanne Boyarsky:
Kiran,
If it works in the UTC (as it should), but not in the JNDI lookup, something is wrong with the JNDI string. Are you using the format:
"local:ejb/ejb/com/..." ?

If you don't have the "local:" part, WebSphere assumes you want the remote interface.

 
Blueberry pie is best when it is firm and you can hold in your hand. Smell it. And smell this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic