Separate JSF and EJB applications

综合编程 2018-05-14

How do I use a deployed EJB app from a separate JSF application?

I'm attempting to separate the two applications and access the EJB through the remote interface. To do this I have two eclipse projects - one contains the EJB and persistence logic, tested independently and works. I then created a JSF project that references the EJB project (so I gain access to the remote interface), however this fails when attempting to either inject the EJB instance or lookup the JNDI name (I've tried several variants to no avail). This is what my JSF backing bean contains:

@EJB(lookup="java:global/LocEJB/LocalityEJB!com.ame.business.LocalityEJBRemote") private LocalityEJBRemote locality;

This is on Glassfish, and I am only referencing the EJB project and not packaging it with the JSF project. When I do the latter, I receive error initializing EJB container problems on the JSF project. So, how do I access the remote EJB and does the way I'm approaching this make any sense?

Thanks in advance!

Hello, buddy!

责编内容by:Hello, buddy! (源链)。感谢您的支持!

您可能感兴趣的

Poor RichFaces RichFaces is one of the most popular component libraries for JavaServer Faces (JSF). In the past, two vulnerabilities (CVE-2013-2165 and CVE-2015-0...
JSF Tutorial – Add Ajax Support to the Application... Ajax has been used for many years since web 2.0. Its primary goal is to provide a refresh-free experience. Using ajax technology is very easy in JS...
Integration test of the local EJB on Glassfish I am a little confused about integration testing of a simple EJB. If I want to test the EJB's local interface/no-interface do I need to use Arquill...
Why can not state horns be exposed as web services... I have been reading about Stateful and Stateless session beans and came across a sentence that states that: Stateful session beans cannot be expo...
How do I access EJB implementing a remote interfac... I am using Netbeans 6.8 and Glassfish v3.0. I created an ejb module and created entity classes from database and then created stateless session bean...