본문 바로가기
IBM - old/WAS 문제&해결

IBMApplicationSession 을 이용 EAR 간의 Session 공유시 NullPointerException

by freeman98 2016. 5. 6.

1. WAS 버전 : WebSphere ND v7.0.0.7

2. OS : All

3. Error 발생 시점 :  IBMApplicationSession 을 이용 EAR 간의 Session 공유를 시도해서 객체를 넣을때 NullPointerException

4. Error message :
[09. 12. 3   16:39:54:817 KST] 00000013 servlet       E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: SessionShareTestEAR01 응용프로그램에 있는 Servlet SessionShareServlet01의 서비스 메소드 중 하나에서 미발견 예외가 작성되었습니다. 작성된 예외: java.lang.NullPointerException
    at com.ibm.juwlee.session.SessionShareServlet01.doGet(SessionShareServlet01.java:40)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1583)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:870)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
    at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3799)
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:930)
    at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:182)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
    at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
    at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
    at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
    at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
    at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)

5. 예상 이유 : 여러 어플리케이션(EAR) 간의 Session 공유를 사용하고자 할 때는 IBMApplicationSession 객체를 사용해야 합니다.
         단, 이 객체를 사용하려면 개발 시에 Shared session context(공유세션 컨텍스트)이 설정되어 있으면 안됩니다.
         즉, Session 공유를 사용하려고 한다면 IBMApplicationSession 이나 sharedSessionContext, 둘 중 하나만 사용해야
         문제없이 Session 공유를 사용할 수 있습니다.

6. 조치 방안 : 개발 툴(RAD)을 이용해서 EAR 의 DD 화일을 확인하여 Shared Session Context 를 해제하면 됩니다.
         보통 ibm-application-ext.xml 이 파일안에 내용이 설정되어 있습니다.
     
Assembling so that session data can be shared
http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/tprs_sharing_data.html?resultof=%22%73%65%73%73%69%6f%6e%22%20%22%73%68%61%72%65%22%20

댓글