이클립스에서 JNDI(Java Naming and Directory Interface) 연결 설정 시 나오는 다음과 같은 워닝에 대한 대처법이다.
이는 이클립스 웹 프로젝트의 WEB-INF 폴더의 'web.xml' 파일에 다음과 같이 JNDI 연결 설정을 추가하였을 때 발생한다.
<resource-ref> 엘리먼트 내부에 다음 엘리먼트를 추가해주면 워닝은 사라진다.
워닝에서 유추할 수 있듯이 <res-sharing-scope> 엘리먼트의 바디에는 'Shareable' 혹은 'Unshareable' 둘 중의 하나만 들어갈 수 있다.
이 워닝이 발생하는 이유는 명확하지 않다. 워닝의 내용은 <res-sharing-scope> 엘리먼트 바디에 유효하지 않은 값이 있다고 하는 것인데, 이것이 어떻게해서 그 엘리먼트가 존재하지도 않는데도 발생하는지 의문이다. 혹, 그 엘리먼트가 필수적으로 삽입되게 하거나, 혹은 삽입을 권장하려 한 것은 아닌가 문득 생각이 들지만, 그러려면 그런 내용을 지닌 에러 혹은 워닝을 냈어야 하는게 아닌가 한다. 아무튼 저 워닝이 발생하게 되는 명확한 이유는 알지 못하더라도, <res-sharing-scope> 엘리먼트의 의미는 다음의 문단에서 파악할 수 있지 않을까 한다.
위 문단은 "Designing Enterprise Applications with the J2EE Platform, Second Edition"라는 책에서 인용한 것이다.
* 참고
- http://younghoe.info/tag/CHKJ4019W
- http://fallacy.tistory.com/212
CHKJ4019W: Invalid res-sharing-scope; valid values are "Shareable" or "Unshareable".
이는 이클립스 웹 프로젝트의 WEB-INF 폴더의 'web.xml' 파일에 다음과 같이 JNDI 연결 설정을 추가하였을 때 발생한다.
<resource-ref>
<res-ref-name>jdbc/oracle</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<res-ref-name>jdbc/oracle</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref> 엘리먼트 내부에 다음 엘리먼트를 추가해주면 워닝은 사라진다.
<res-sharing-scope>Shareable</res-sharing-scope>
워닝에서 유추할 수 있듯이 <res-sharing-scope> 엘리먼트의 바디에는 'Shareable' 혹은 'Unshareable' 둘 중의 하나만 들어갈 수 있다.
이 워닝이 발생하는 이유는 명확하지 않다. 워닝의 내용은 <res-sharing-scope> 엘리먼트 바디에 유효하지 않은 값이 있다고 하는 것인데, 이것이 어떻게해서 그 엘리먼트가 존재하지도 않는데도 발생하는지 의문이다. 혹, 그 엘리먼트가 필수적으로 삽입되게 하거나, 혹은 삽입을 권장하려 한 것은 아닌가 문득 생각이 들지만, 그러려면 그런 내용을 지닌 에러 혹은 워닝을 냈어야 하는게 아닌가 한다. 아무튼 저 워닝이 발생하게 되는 명확한 이유는 알지 못하더라도, <res-sharing-scope> 엘리먼트의 의미는 다음의 문단에서 파악할 수 있지 않을까 한다.
The bean provider can control the extent that connections are shared. By default, other enterprise beans in the application that use the same resource in the same transaction context can share the connection. The bean provider can set the res-sharing-scope deployment descriptor element to Unshareable to indicate that a connection not be shared. Keep in mind, though, that sharing connections to a resource manager allows the container to optimize connection and local transaction use. It is recommended that connections be marked Shareable.
위 문단은 "Designing Enterprise Applications with the J2EE Platform, Second Edition"라는 책에서 인용한 것이다.
* 참고
- http://younghoe.info/tag/CHKJ4019W
- http://fallacy.tistory.com/212
'Computing > Programming' 카테고리의 다른 글
| CHKJ3000E: WAR Validation Failed: java.lang.NullPointerException (0) | 2009/04/11 |
|---|---|
| Servlet specification 2.4에서 JSP 속성 그룹에 유효한 URL 패턴 (0) | 2009/04/11 |
| 이클립스에서 [CHKJ4019W: Invalid res-sharing-scope; valid values are "Shareable" or "Unshareable".] 워닝 해결하기 (0) | 2009/04/01 |
| 이클립스에서 오라클 10g XE 연결 설정하기 (2) | 2009/03/25 |
| 우분투 8.04 HH에 오라클 10g XE 설치 (0) | 2009/03/25 |
| Java 6에서 "Type safety: Unchecked cast from Object to ~~~" 워닝 조치법 (0) | 2009/03/16 |
댓글을 달아 주세요