jonas 5.1.5 jsp to ejb3 lookup issue
<[email protected]> Tue, 8 Feb 2011 08:16:23 +0100 (CET)
| Newsgroups | gmane.comp.java.objectweb.jonas |
|---|---|
| Message-ID | <[email protected]> |
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