Injection of EJB3 into Annotation Based JSF2 Backing bean causing javax.naming.NameNotFoundException:

前端 未结 1 823
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-07 02:01

I have seen other thread with similar issue but was not able to work out direct link with my problem . Hopefully I am not repeating a question.My issue is this:
I am usi

相关标签:
1条回答
  • 2021-01-07 02:33

    Shared libraries are not considered for locating component-defining annotations (like @ManagedBean), so the component is not found, which means its @EJB is not found while building the java:comp namespace. Your options are:

    1. Mention the JSF bean in faces-config.xml in the WAR.
    2. Place the JSF bean in the WAR.
    3. Define the <ejb-ref> in web.xml.
    4. Define the ejb-ref with annotations in a dummy "resource producer" bean in the WAR.

    For #4, an example would be:

    @ManagedBean
    @EJBs({
       @EJB(name="helloworld.HelloBean", type=SampleService.class)
       // ... etc
    })
    public class ResourceProducerBean { }
    
    0 讨论(0)
提交回复
热议问题