내가의 예제 코드를 입력 한 후 내가 http://docs.oracle.com/javaee/7/tutorial/doc/jsf-facelets005.htm#GIQZR는 java.util.concurrent.ConcurrentHashMap.putIfAbsent
에서 자바 EE 7 튜토리얼을 읽는 오전 java.lang.NullPointerException이 발생합니다 장 8.5 복합 구성 요소 내 IDE와 GlassFish4.0의 예제를 실행, 나는
java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.putIfAbsent(ConcurrentHashMap.java:1078)
at com.sun.faces.util.Cache.get(Cache.java:116)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.getComponentMetadata(FaceletViewHandlingStrategy.java:237)
at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:951)
at javax.faces.application.ApplicationWrapper.createComponent(ApplicationWrapper.java:648)
가 그럼 난이 튜토리얼의 이전 버전을 확인 오류가있어, 나는 차이를 발견했다. 나는 자바 EE 6 버전으로 코드를 변경 한 후
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:composite="http://xmlns.jcp.org/jsf/composite"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:head>
<title>This content will not be displayed</title>
</h:head>
<h:body>
<composite:interface>
<composite:attribute name="value" required="false"/>
</composite:interface>
<composite:implementation>
<h:outputLabel value="Email id: "></h:outputLabel>
<h:inputText value="#{cc.attrs.value}"></h:inputText>
</composite:implementation>
</h:body>
</html>
을하지만 자바 EE 6 버전
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>This content will not be displayed</title>
</h:head>
<h:body>
<composite:interface>
<composite:attribute name="value" required="false"/>
</composite:interface>
<composite:implementation>
<h:outputLabel value="Email id: "></h:outputLabel>
<h:inputText value="#{cc.attrs.value}"></h:inputText>
</composite:implementation>
</h:body>
</html>
에 : 자바 EE 7 버전 email.xhtml 코드에서
은 다음과 같다 , 오류가 사라집니다. 차이점은 네임 스페이스입니다. 이 튜토리얼의 문제인지 여부는 알 수 없습니다. 알고 있니?
링크에서 jar Mojarra 2.2.2를 다운로드하여/modules에 넣습니다. 하지만 여전히 같은 문제가 있습니다. GlassFish 4.1을 기다려야한다고 생각합니다. 어쨌든, 귀하의 회신에 감사드립니다. – Chris
수정되지 않은 GF4 설정에서 문제를 재현 할 수있었습니다. Mojarra 2.2.2로 업그레이드 한 후에 유스 케이스가 나를 위해 일하기 시작했습니다. GF4 작업/캐시/배포 폴더를 정리 했습니까? 어떻게 서버를 관리하고 있습니까? 독립형 또는 IDE를 통해? 내가 직접 확인/경험하지 않은 경우에는 일반적으로 답변을 게시하지 않습니다. – BalusC
첫 번째 의견에 사과드립니다. jar 파일의 이름을 변경하여 GlassFish가 먼저로드하도록하십시오. 이제 작동합니다. 감사합니다 – Chris