Re: Re: Re: jonas 5.1.5 jsp to ejb3 lookup issue
Florent BENOIT <[email protected]> Tue, 08 Feb 2011 10:28:21 +0100
| Newsgroups | gmane.comp.java.objectweb.jonas |
|---|---|
| Message-ID | <[email protected]> |
Hans, This is in the "server" item on the left tree and then "registry" in the tab panel located on the right. Regards, Florent Hans J. Prueller wrote: > This is interesting Florent, > > I tried to find something like a JNDI browser in jonas-admin console > but didn't find it -- where can I find this JNDI-names list in JOnAS > Admin web console ? > > regards, > Hans > > Am Dienstag, den 08.02.2011, 09:20 +0100 schrieb Florent BENOIT: >> Matthias, >> >> You could use "jonas admin -j" command to list JNDI names available. Or you could also go in JOnAS Admin web console and you can also list these JNDI names >> >> Also, the "new way" of getting EJBs is by using @EJB injection, so you don't have to know the JNDI name >> >> Regards, >> >> Florent >> >> >> >> >> >> [email protected] <mailto:[email protected]> wrote: >> > Hi friends, >> > >> > I try to access an ejb3 stateless sb from my jsp using this code: >> > >> > private static final String JNDI_NAME = "org.mfri.jonas.smtp.SendSMTPBean" >> > + "_" + SendSMTPInterface.class.getName() + "@Remote"; >> > >> > Context initialContext = null; >> > try >> > { >> > initialContext = new InitialContext(); >> > } >> > catch (NamingException e) >> > { >> > // TODO Auto-generated catch block >> > e.printStackTrace(); >> > } >> > SendSMTPInterface theSendmailInterface = null; >> > try >> > { >> > theSendmailInterface = (SendSMTPInterface) >> > initialContext.lookup(MailClientBean.JNDI_NAME); >> > } >> > catch (NamingException e) >> > { >> > // TODO Auto-generated catch block >> > e.printStackTrace(); >> > } >> > >> > I get: javax.naming.NameNotFoundException: >> > org.mfri.jonas.smtp.SendSMTPBean_org.mfri.jonas.smtp.SendSMTPInterface@Remote >> > >> > The JNDI name should be ok according to the ejb3 programming doc. >> > >> > any ideas? >> > >> > Thanks Matthias >> > >> > >> > >> >> >