views:

21

answers:

0

I am using JSF 1.2, EJB 3 on JBoss 5.

This is my EJB:

@Local
public interface HelloServiceLocal {
    public void sayHello(String username);
}

@Stateless(name="helloService")
public class HelloService implements HelloServiceLocal {
    public void sayHello(String username) {
        // business logic 
    }
}

In a JSF backing bean I am accessing the EJB as follows:

public class HelloWorldBean {
    @EJB(name="helloService")
    private HelloService helloService;

    public void performTask() {
        helloService.sayHello(name)
    }
}

When program executes, it displays page to user to enter his/her name. When page submits it executes performTask(). It throws an javax.naming.NameNotFoundException: helloService not bound.

I have not include any JNDI references in web.xml because it is required tu use DI and I do not use any ejb-jar.xml. Do I need them in this environment?