If you want to expose EJB locally you have to use @Local
on Interface.
If you want to expose both locally and remotely you have to created 2 Interfaces, one with @Local
and one with @Remote
.
If your JSF ManagedBean(MyBean) is running locally ie.,Running on same App server as EJB you can directly inject it using @EJB
.
If your JSF ManagedBean is running on different server, you have to use the JNDI Registry to look up and access the EJB.