• 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
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

javax.naming.NameNotFound Exception

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

I tried several options to run my client Program but failed.
I have deployed my addressbook.ear in to Orion Server.
below is the Deployment Descriptor ejb-jar.xml configured with ejbname, Home ,Remote and Ejb Bean

<ejb-name>AddressEntry</ejb-name>
<home>addressbook.ejb.AddressBook</home>
<remote>addressbook.ejb.AddressEntry</remote>
<ejb-class>addressbook.ejb.AddressEntryBean</ejb-class>

and the application-client.xml is configured as

<application-client>
<display-name>SessionClient</display-name>
<ejb-ref>
<ejb-ref-name>ejb/AddressEntry</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>addressbook.ejb.AddressBook</home>
<remote>addressbook.ejb.AddressEntry</remote>
</ejb-ref>
</application-client>



and in my client program i am trying to get the HomeRefence as

try{
Context initial = getInitialContext();
Object homeref = initial.lookup("java:comp/env/ejb/AddressEntry");
AddressBook home = (AddressBook)PortableRemoteObject.narrow(homeref,AddressBook.class);

}


and getInitialContext() is set as
try{

//ht.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.ApplicationClientInitialContextFactory");
ht.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.rmi.RMIInitialContextFactory");
ht.put(Context.PROVIDER_URL,"ormi://localhost");
ht.put(Context.SECURITY_PRINCIPAL,"admin");
ht.put(Context.SECURITY_CREDENTIALS,"admin");
ctx = new InitialContext(ht);
}
return ctx;


Each time i am getting the same message by running my Client as:

MESSAGE:java:comp/env/ejb/AddressEntry not found in <global>
at com.evermind.server.rmi.RMIContext.lookup(.:121)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at addressbook.ejb.SessionClient.main(Unknown Source)


can any body give a lead to find where i am going wrong

Regards
phani
[ December 15, 2004: Message edited by: Phani M ]
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With every appserver I have worked with there has to be a vendor-specific descriptor accompanying the ejb-jar.xml. In JBoss this file is jboss.xml, and I guess that there must be one for Orion too.
In this file you have to map the ejb names to the JNDI names. Here is an example from jboss.xml.



The thing to remember here is that the ejb-name tag in ejb-jar.xml is NOT the JNDI name. Maybe this is the solution to your problem.
 
It's hard to fight evil. The little things, like a nice sandwich, really helps. Right tiny ad?
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic