JNDI Name for Local interface EJB

Hello,

I have created a simple Stateless session bean in EJB 3.0 and deployed it. I use NetBeans 5.5. beta 2 to deploy that EJB application to SJSAS 9.0.

My problem is, i am unable to access it from web application running

in the same server - SJSAS.

I don't know what is thejndi name that is assigned to EJB with only

one local interface.

Your help will be very much appreciated!

Thank you,

Srikanth.

[468 byte] By [srikanthpragada] at [2007-11-26 9:26:12]
# 1
Can you post such questions in http://forums.java.net/jive/forum.jspa?forumID=56That's where all the interesting discussion on Java EE 5, EJB3 happen these days.Sahoo
sahoo at 2007-7-7 0:04:23 > top of Java-index,Application & Integration Servers,Application Servers...
# 2

Hello Srikanth,

Is the web component and the ejb part of the same application? If so,

all you have to do is to use the @EJB annotation in your servlet to

inject the StatelessSession bean. You could use the following as an example:

Assuming you StatelessSessionBean implements a business interface called

Foo, all you have to do is in you Servlet use the @EJB annotation

import javax.ejb.EJB;

MyServlet extends ...{

@EJB Foo foo;

//init and service methods for your servlet

{

.......

foo.someMethod();

}

}

regards,

-marina

marina at 2007-7-7 0:04:23 > top of Java-index,Application & Integration Servers,Application Servers...