게시판을 이용해 주셔서 감사합니다.
다음양식에 맞게 입력해주세요.
* 고객시스템명 : 경영시스템
* GAUCE 버전 : GAUCE 3.5
* WAS 종류(WebLogic 등등) : weblogic 8.1.2
* DB 종류 : oracle
* 문의 유형(질문/요청/참조) : 질문
* 내용 :
연락처입니다. 019-355-8441 이종건입니다
context = service.getContext();
req = service.getGauceRequest(); <- 이부분에서 에러발생
res = service.getGauceResponse();
<Dec 6, 2007 2:04:30 PM KST> <Error> <HTTP> <BEA-101020> <[ServletContext(id=134
5076175,name=gpms04,context-path=/temp)] Servlet failed with Exception
java.lang.NullPointerException
at com.sdi.au.bcauplc101t_r.service(bcauplc101t_r.java:246)
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code
))
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java(Inlined Compiled Code))
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java(Compiled Code))
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java(Inlined Compiled Code))
at weblogic.servlet.ServletServlet.service(ServletServlet.java(Compiled
Code))
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code
))
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java(Inlined Compiled Code))
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java(Compiled Code))
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java(Inlined Compiled Code))
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java(Compiled Code))
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java(Compiled Code))
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java(
Inlined Compiled Code))
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java(Compiled Code))
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java(Compiled Code))
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java(Compiled Cod
e))
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java(Compiled Code))
>
소스입니다.
package com.sdi.au;
import com.gauce.*;
import com.gauce.engine.LifeCycleException;
import com.gauce.io.GauceRequest;
import com.gauce.io.GauceResponse;
import com.sdi.common.AuUtil;
import com.sdi.common.LoggableStatement;
import com.sdi.common.SdiString;
import com.sdi.common.SdiUtil;
import com.sdi.common.comFunc;
import org.apache.log4j.Logger;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class bcauplc101t_r extends HttpServlet
{
private static final Logger logger = Logger.getLogger(bcauplc101t_r.class);
public void service(HttpServletRequest request, HttpServletResponse response) throws IOException
{
ServiceLoader loader = new ServiceLoader(request, response);
GauceService service = null;
GauceContext context = null;
GauceDataSet dSet = null;
GauceDataSet dSet_manainfo = null;
GauceDataSet dSet_fileinfo = null;
GauceDataSet dSet_delfileinfo = null;
GauceDataSet dSet_secinfo = null;
GauceDataSet dSet_code = null;
GauceRequest req = null;
GauceResponse res = null;
Connection conn = null;
String TR_TYPE = null;
String ipaddr = "";
String uid = "";
try{
service = loader.newService(comFunc.getProperty("GS_DOMAIN"));
context = service.getContext();
req = service.getGauceRequest();
res = service.getGauceResponse();
conn = SdiUtil.getSdiConnection(comFunc.getProperty("GS_DB_01"));
TR_TYPE = req.getParameter(comFunc.getProperty("GS_TR_TYPE"));
ipaddr = request.getRemoteAddr();
uid = req.getParameter("UID");
/*과제코드 생성용인지(CODE),과제데이타 등록용(DATA)인지 구분*/
String TRAN_TYPE = req.getParameter("TRAN_TYPE");
if (!comFunc.checkSystem(req.getParameter(comFunc.getProperty("GS_SYS_KEY")),request.getRemoteAddr()))
throw new IllegalArgumentException("System Key Check Failure");
// Select Type
if (TR_TYPE.equals(comFunc.getProperty("GS_SELECT"))){
PreparedStatement select = null;
dSet = new GauceDataSet();
res.enableFirstRow(dSet);
String l_code = req.getParameter("L_CODE") == null ? "": request.getParameter("L_CODE");
String pln_ver = req.getParameter("PLN_VER") == null ? "": request.getParameter("PLN_VER");
String s_select = " SELECT PLN_VER,SAUPBU,SAUPTEAM,FLD_CODE,H_CODE,M_CODE,T_TYPE,S_TYPE,rn"
+ " H_CODE,M_CODE,L_CODE,L_TEXT,S_FLAG,SIGMA_CODE,EXEC_ID,EXEC_NM,EXEC_JIK,rn"
+ " ACT_ID,ACT_NM,ACT_JIK,FR_YYMM,TO_YYMM,rn"
+ " L_DESC1,L_DESC2,APPR_STATUS,PROG_STATUS,REG_DATE,REG_ID,REG_NM,rn"
+ " MOD_DATE,MOD_ID,MOD_NM,RSN_TYPE,NEW_FLAG,'' B01_CODE rn"
+ " FROM BCAUPLC101T rn"
+ " WHERE PLN_VER = ? rn"
+ " AND L_CODE = ? rn";
if(logger.isDebugEnabled()) {// use a switch to toggle logging.
select = new LoggableStatement(conn, s_select);
}else{
select = conn.prepareStatement(s_select);
}
select.setString(1, pln_ver);
select.setString(2, l_code);
if (logger.isDebugEnabled()) {
logger.debug("service() - s_select : rn" + ((LoggableStatement)select).getQueryString() );
}
select.executeQuery();
ResultSet rSet = select.getResultSet();
SdiUtil.makeSdiDataSet_EncID(rSet, dSet); // Make DataSet Header
SdiUtil.setSdiDataSet_EncID(rSet, dSet,request.getRemoteAddr()); // Fill DataSet from ResultSet
select.close();
dSet.flush();
res.commit();
res.close();
}else if (TR_TYPE.equals(comFunc.getProperty("GS_POST"))){
dSet = req.getGauceDataSet(comFunc.getProperty("GS_POST_KEY"));
dSet_manainfo = req.getGauceDataSet("MANAINFO"); // 관리지표
dSet_fileinfo = req.getGauceDataSet("FILEINFO"); // 첨부파일 정보
dSet_delfileinfo = req.getGauceDataSet("DELFILEINFO"); // 첨부 삭제파일정보
dSet_secinfo = req.getGauceDataSet("SECINFO"); // 첨부 보안등급
dSet_code = req.getGauceDataSet("PLANCODE"); // 과제코드
String code = req.getParameter("L_CODE");
String s_user = SdiUtil.sdiDecode(uid,ipaddr);
String c_gubun =req.getParameter("PROG_STATUS") == null ? "": req.getParameter("PROG_STATUS");
if (TRAN_TYPE.equals("CODE")) {
code = bcauplc101t_NewCode(conn,dSet,s_user,ipaddr);
} else {
/*과제코드가 넘어오지 않은 경우*/
if (code.equals("null")) {
GauceDataRow[] rows = dSet.getDataRows();
String m_code = rows[0].getString(dSet.indexOfColumn("M_CODE"));
code = AuUtil.getMaxCode2("BCAUPLC101T",m_code);
}
if (c_gubun.equals("Z1")){
/*과제중단 처리*/
AuUtil.bcauplx101t_z1_tran(conn,dSet,code,s_user,ipaddr,"L");
} else {
/*과제정보 등록*/
bcauplc101t_tran(conn,dSet,code,s_user,ipaddr,TRAN_TYPE);
AuUtil.bcauplx201t_tran_del(conn,dSet_manainfo,code,"L");
/*관리지표 등록 계획 */
AuUtil.bcauplx201t_tran(conn,dSet_manainfo,code,"L");
/*관리지표 등록 실적 등록 */
AuUtil.bcauplx201t_tran_ac(conn,dSet_manainfo,"L",code);
/*파일정보 정보 등록(삭제된 파일정보 등록)*/
AuUtil.bcaupls301t_tran(conn,dSet_fileinfo,dSet_delfileinfo,code);
/*인가자 정보 등록*/
AuUtil.bcaupls302t_tran(conn,dSet_secinfo,ipaddr,code);
}
}
dSet_code = req.getGauceDataSet("PLANCODE");
res.enableFirstRow(dSet_code);
dSet_code.addDataColumn(new GauceDataColumn("L_CODE", GauceDataColumn.TB_STRING));
GauceDataRow row = null;
row = dSet_code.newDataRow();
row.addColumnValue(code);
dSet_code.addDataRow(row);
dSet_code.flush();
res.commit();
res.close();
conn.commit();
}
} catch (SQLException se){
res.writeException("Native", "8000", se.getMessage());
res.commit();
res.close();
comFunc.rollback(conn);
logger.error("service(HttpServletRequest, HttpServletResponse)", se);
}catch (LifeCycleException e){
res.writeException("Native", "8000", e.getMessage());
res.commit();
res.close();
comFunc.rollback(conn);
logger.error("service(HttpServletRequest, HttpServletResponse)", e);
}catch (Exception e){
res.writeException("Native", "8000", e.getMessage());
res.commit();
res.close();
comFunc.rollback(conn);
logger.error("service(HttpServletRequest, HttpServletResponse)", e);
}finally{
if (conn != null) {
try {conn.setAutoCommit(true); conn.close();} catch (Exception e) {}
}
loader.restoreService(service);
}
if (logger.isDebugEnabled()) {
logger.debug("service(HttpServletRequest, HttpServletResponse) - end");
}
}
JSP소스입니다. 내용이 길어 정리해서 올립니다.
<%@ page import="com.sdi.common.comFunc" %>
<%@ page import="com.sdi.common.*" %>
<%@ page import="com.sdi.au.*" %>
<%@ include file = "/Apps/common/com_obj_au.js" %>
%>
<%@ include file = "/Apps/common/com_tableTxt.jsp" %>
<SCRIPT Language = "JavaScript">
function lfn_Start() {
<%@ include file = "/Apps/common/com_auth.js" %>
//PlnVer.innerText = ls_pln_ver.substring(0,4);
/*화면정보*/
lfn_SetTextInfo();
/*첨부파일 업로드 환경설정*/
gfn_SetUploadInfo2();
/*조회조건*/
lfn_SetDefault();
/*TR 정보*/
lfn_SetTransInfo();
/*과제코드정보가 있는지 체크, 과제정보를 화면에 뿌리기*/
/*해당코드의 데이타는 'tbds_OperDiv event=onLoadCompleted' 에서 가져옴*/
lfn_LoadBasicinfo();
<%/* 관리지표 정보는 사업부정보가 필요해서 */
/* tbds_OperDiv event=onLoadCompleted 에서 호출 */ %>
/*첨부파일 정보*/
lfn_bcaupls301t_fileinfo();
/*보안등급 정보*/
lfn_bcaupls302t_secinfo();
/*인가자 데이타 조회*/
lfn_bcaupls302t_secinfo_sel();
/*화면 ReSize*/
gfn_Resize();
}
function lfn_SetTransInfo() {
/*과제코드 생성용*/
gfn_SetGauceTR(tbtr_TRNS_02, "bcauplc101t_r");
tbtr_TRNS_02.Parameters += ",TRAN_TYPE=CODE,UID=" + gfn_GetGV("gs_user_enc");
}
/*과제코드를 미리 생성 */
function lfn_MakeCode() {
/*입력항목체크*/
if(!lfn_FldCheck('1')) return;
if(!gfn_MsgBox(79,"C")) return;
/*Transaction 정보 설정(과제코드 다시 설정)*/
lfn_SetTransInfo();
tbtr_TRNS_02.post();
}
function lfn_Query() {}
<script language=JavaScript for=tbtr_TRNS_01 event=onFail>
alert(gfn_ErrorMsg(tbtr_TRNS_01,"8000"));
</script>
<OBJECT CLASSID=CLSID:223216F6-B9FE-406d-9ED6-143FCE3A07B8 ID=tbtr_TRNS_02>
<PARAM name=Protocol value="1">
<PARAM name=KeyName value="Toinb_dataid4">
<PARAM name=KeyValue value="JSP(I:DETAIL=tbds_bcauplc101t_r,O:PLANCODE=tbds_PlanCode)">
</OBJECT>
<OBJECT CLASSID=CLSID:AF989B7C-8AC3-40bc-B749-EB335BDFD190 ID=tbds_PlanCode>
<param name=SyncLoad value=true>
</OBJECT>
</HEAD>