• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB Lookup from a servlet

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a servlet which is deployed on a webserver and I want to lookup a sesion bean fro it.
this is my code:


But this code throwing the following exception:

com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object.

I think I need to set the properties in the initial Context.
but how could I get the IIOP URI+PORT and how could I get the factory?
NOte: My directory Service is in WebSphere App Server.
 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you made following entry in web.xml.

<ejb-ref>
<ejb-ref-name>ejb/CustomerNumbersHome</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>CustomerNumbersHome</home>
<remote>CustomerNumbers</remote>
</ejb-ref>

Above entry is an example only. The home and remote interfaces in entry above should be fully qualified classname for e.g. com.example.CustomerNumbersHome. In <ejb-ref-type> put the tyoe of your bean
session or entity.

Once you make an entry here, then application server will take care of every thing, please do not bother about IIOP URI+PORT etc..It is application server's responsibility.

Lave
 
It is no measure of health to be well adjusted to a profoundly sick society. -Krishnamurti Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic