2013-04-01 2 views
0

jsf 2.2가있는 WAR 파일을 배포 할 때 jboss에서 JNDI의 bean을 찾을 수 없습니다. 다음 예외가 발생합니다. 왜 이런 일이 일어나는 지 아십니까? ejb.jar의 배포에Stateless CDI Managed bean

Deployment "vfs:///C:/jboss-6.1.0.Final/server/all/deploy/web.war" is in error due to the following reason(s): java.lang.RuntimeException: Could not resolve @EJB reference: [EJB Reference: beanInterface 'se.questify.services.entities.ExamServiceBase', beanName 'null', mappedName 'null', lookupName 
'null', owning unit '[email protected]{vfs:///C:/jboss-6.1.0.Final/server/all/deploy/web.war}'] for environment entry: env/ExamService/local in unit [email protected]{vfs:///C:/jboss-6.1.0.Final/server/all/deploy/web.war} 

제이 보스 스택 (빈은 JNDI에, 나는 제이 보스가 결합 내가 검색 경로의 모든 종류 시도 것을 참조)

INFO [org.jboss.ejb3.nointerface.impl.jndi.AbstractNoInterfaceViewBinder] Binding the following entry in Global JNDI for bean:ExamServiceBase 

     ExamServiceBase/no-interface -> EJB3.1 no-interface view 

EJB

@Stateless 
@Named("examServiceBase") 
public class ExamServiceBase{ 

    public String getHello(){ 
     return "hello"; 
    } 
} 

JSF 코드

<h:body>  
    <h1>JSF 2 Demo</h1> 
    <h:form> 
     <h:outputLabel value="#{examServiceBase.hello}" /> 
    </h:form> 
</h:body> 

답변

2

당신 둘 다 가질 수는 없다. @Named@Stateless을 둘 다 가질 수는 없으며 서로 배타적입니다.

  • 그것은 EJB 구성 요소 - 정의 주석 주석 또는 EJB로 선언되지 않은 : 그것은 다음의 모든 조건을 충족하는 ... 경우 From Oracle:

    최상위 자바 클래스는 관리 빈이다 아담 비엔 따르면 EJB-jar.xml의

+0

콩 클래스는 http://www.adam-bien.com/roller/abien/entry/ejb_3_1_killed_the – Marthin

+1

@Marthin [O 가능해야 갈등이 달라지기를 바랍니다.] (http://docs.oracle.com/javaee/6/tutorial/doc/gjfzi.html) – kolossus

+0

JBoss 6보다 최신 버전을 사용해보십시오. 예전 버전이므로 사용중인 버그가있는 것 같습니다. – LightGuard

관련 문제