Thursday, July 02, 2009

WebSphere DataSource lookup시 나타나는 오류 해결법

 

WebSphere 6에서 DataSource JNDI lookup시 오류 사항.

1.Servlet 2.3스펙상에서 데이터 소스(WebSphere Application Server V4)를 사용할려고
   했을때 나타나는 오류이다.

 

Systemout.log
------------------------------------------------------------------------------
예외 스택 추적:
com.ibm.websphere.naming.CannotInstantiateObjectExction occurred while the JNDI NamingManager was processing a javax.nce object.
[Root exception is javax.naming.NamingException: Attempt.0 DataSource from a 2.3
(or higher) servlet. Invalid configuration at com.ibm.ws.naming.util.Helpers.processSerializedObjectFolpers.java:1000)
 
 
Systemerr.log
-------------------------------------------------------------------------------
[06. 8. 1   16:26:04:432 KST] 0000002a SystemErr     R 
CException : com.shift.gef.core.exception.CException:
Exception occurred while the JNDI NamingManager was processing a javax.naming.
Reference object.

 
2.Servlet 2.2스펙상에서 데이터 소스(V5)이상을 사용할려고 했을때 나타나는 오류이다.
Systemout.log
-------------------------------------------------------------------------------
예외 스택 추적:
com.ibm.websphere.naming.CannotInstantiateObjectException:
Exception occurred while the JNDI NamingManager was processing a javax.naming.
Reference object.
[Root exception is java.lang.Exception: Attempted to use a 5.0 DataSource outside of
a 2.3 servlet]

Systemerr.log
-------------------------------------------------------------------------------
[06. 8. 1   16:48:45:910 KST] 0000002d SystemErr     R 
CException : com.shift.gef.core.exception.CException:
Exception occurred while the JNDI NamingManager was processing a javax.naming.
Reference object.

해결법
-------------------------------------------------------------------------------
1.번의 상황인 경우 V5타입의 데이터소스를 사용해주면 된다.

2.번의 상황인 경우는 아래와 같이 처리를 해주면 된다.
 
웹스피어 예제 어플리케이션인 ivt를 사용했을때 web.xml이 Servlet 2.2 Spec으로 되어있다
 
망할 IBM ㅠㅠ
 
ivt쪽 web.xml의 내용
........................................................................................................................
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
 
아래와 같이 Servlet 2.4 Spec의 web.xml을 작성해 주면 된다.
 
 
Servlet 2.3 Spec
........................................................................................................................
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
 
 
Servlet 2.4 Spec
........................................................................................................................

알다가도 모를 웹스피어 짜증만땅 ㅠㅠ





No comments: