users@glassfish.java.net

How to reference a Local EJB from JSF ManagedBean

From: <glassfish_at_javadesktop.org>
Date: Sun, 16 Dec 2007 14:37:59 PST

I am trying to get a fairly simple web application to run using EJB 3.0 and java server faces, but am having very little luck. I guess the first question would be do you need and ejb jar file or can the EJB classes and interfaces be in the war itself.

I have the following classes:

@Local
public interface InfoChannelManagerLocal {
}

@Stateless
public class InfoChannelManager implements InfoChannelManagerLocal {
   ...
}

In my JSF Managed bean I have the following:

public InfoChannelFacade {
   @EJB private InfoChannelManagerLocal infoChannelManager
   ...
}

I have seen a number of posts that state that local interfaces are not automatically registered for JNDI, and have tried altering the @EJB annotation on my InfoChannelFacade, but am still unable to get the application to deploy properly. The Actual Exception being thrown is:

Caused by: java.lang.RuntimeException: Cannot resolve reference Unresolved Ejb-Ref infochannelmanagerejbref_at_jndi: @null_at_us.ks.k12.topeka.news.ejb.InfoChannelManagerLocal_at_Session@null
        at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:430)
        at com.sun.enterprise.deployment.WebBundleDescriptor.visit(WebBundleDescriptor.java:1406)
        at com.sun.enterprise.deployment.archivist.WebArchivist.validate(WebArchivist.java:188)
        at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openArchive(ApplicationArchivist.java:790)
        at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openArchive(ApplicationArchivist.java:744)
        at com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:349)
        ... 10 more

Any help would be appreciated as I am not understanding why what I am reading is not working.
[Message sent by forum member 'chadws' (chadws)]

http://forums.java.net/jive/thread.jspa?messageID=250316