Re: Re: jonas 5.1.5 jsp to ejb3 lookup issue
"Hans J. Prueller" <[email protected]> Tue, 08 Feb 2011 09:48:24 +0100
| Newsgroups | gmane.comp.java.objectweb.jonas |
|---|---|
| Organization | LBS logics GmbH |
| Message-ID | <1297154904.1832.0.camel@smithers> |
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] 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 > > > > > > >