Servlet.service() for servlet jsp threw exception java.lang.NullPointerException
2010-06-25 23:07:00,281 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/oa].[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.leftbottomFrame_jsp._jspService(org.apache.jsp.leftbottomFrame_jsp:91)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:534)
[解决办法]
上面是出错的信息,下面是原代码
<%
String userid = session.getAttribute("userid").toString();
String username=session.getAttribute("username").toString();
String deptid=session.getAttribute("deptid").toString();
String deptname= session.getAttribute("deptname").toString();
String strIp= session.getAttribute("logip").toString();
String mailHost=XmlInfoBean.getXmlData("mailHost");;
String installPath=XmlInfoBean.getXmlData("mailinstallpath");
String domainName=XmlInfoBean.getXmlData("maildomainname");
String user=userid+"@"+domainName;
String pwd=userid;
String strTemp="";
int count=0;//邮件总数
int mailCount=0;
int mailNewCount=0;
int missionCount=0;
%>
<body background="images/leftbottom.gif">
<%
try{
//连接到邮件服务器
MailServerInbox inbox= new MailServerInbox(mailHost,user,pwd);
inbox.open(MailServerInbox.READ_ONLY);
mailNewCount=inbox.getMessageCount();
//关闭邮件服务器的连接
inbox.close();
MailReceiveBox receiveBox = new MailReceiveBox(installPath,domainName,userid);
receiveBox.open();
mailCount=mailNewCount+receiveBox.getMessageFileCount();
}catch(Exception e){
mailCount=0;
mailNewCount=0;
}
try
{
String strLeaveInfo="select * from OA_MISSIONLEAVE where LEAVEFLAG='E' and LEAVEFORID='"+userid+"'";
ResultSet rsLeaveInfo=DBManage.getQuery(strLeaveInfo);
//接收普通办理任务
String strSelMisHistory="select * from OA_WF_SCHEDULER where (finish='0' and remployid='"+ userid+"') ";
String strRoleSend="select * from OA_WF_SCHEDULER where finish='-1'";
ResultSet rsRoleSend=DBManage.getQuery(strRoleSend);
while(rsRoleSend.next())
{
strTemp="select * from wf_employeerole where facilityid='"+userid+"' and roleid in(select distinct roleid from wf_noderole where nodeid='"+rsRoleSend.getString("rnodeid")+"' and jobid='"+rsRoleSend.getString("rjobid")+"')";
ResultSet rsTemp=DBManage.getQuery(strTemp);
if(rsTemp.next())
//接收角色办理任务
strSelMisHistory=strSelMisHistory+" or ( rjobid='"+rsRoleSend.getString("rjobid")+"' and rnodeid='"+rsRoleSend.getString("rnodeid")+"' and finish='-1' and dynamicparam='"+rsRoleSend.getString("dynamicparam")+"' )";
}
while(rsLeaveInfo.next())
{
//接收委托普通办理任务
strSelMisHistory=strSelMisHistory+" or ( finish='0' and remployid='"+rsLeaveInfo.getString("LEAVEID")+"' and rjobid='"+rsLeaveInfo.getString("LEAVEJOBID")+"')";
//接收委托角包办理任务
strSelMisHistory=strSelMisHistory+" or (finish='-1' and rjobid='"+rsLeaveInfo.getString("LEAVEJOBID")+"' and rnodeid in ( select distinct nodeid from wf_noderole where jobid='"+rsLeaveInfo.getString("LEAVEJOBID")+"' and roleid in(select distinct roleid from wf_employeerole where facilityid='"+rsLeaveInfo.getString("LEAVEID")+"')) ) ";
}
strSelMisHistory=strSelMisHistory+" order by BEGINTIME";
ResultSet rsHis=DBManage.getQuery(strSelMisHistory);
ResultSet rsTemp;
while(rsHis.next())
{
missionCount++;
}
}
catch(Exception ex)
{
missionCount=0;
}
//文件签收
String strNowDate = DBManage.getNowDate();
String sql0 = "select * from OA_FILEREADLOG where USERID='"+userid+"' and AUTOID in(select distinct AUTOID from OA_FILEREAD where READENDTIME>='"+strNowDate+"' and ((READFLAG='0' and READMAN like '%;"+userid+";%') or (READFLAG='1' and READDEPT='"+deptid+"') or READFLAG='2')) order by AUTOID";
//out.println(sql0);
String strReadID = "'-1'";
ResultSet rs0 = DBManage.getQuery(sql0);
while(rs0.next()) {
strReadID += ",'"+rs0.getString("AUTOID")+"'";
}
rs0.close();
//未查阅文件列表
String sql1 = "select count(*) from OA_FILEREAD where READENDTIME>='"+strNowDate+"' and ((READFLAG='0' and READMAN like '%;"+userid+";%') or (READFLAG='1' and READDEPT='"+deptid+"') or READFLAG='2') and AUTOID not in("+strReadID+") order by AUTOID desc";
ResultSet rs1 = DBManage.getQuery(sql1);
int fileCount = 0;
if(rs1.next()) fileCount = rs1.getInt(1);
//更新在线用户信息
try
{
String strTime=DBManage.getNow();
String strHour=strTime.substring(14,16);
int iHour=0;
if(strHour.substring(0,1).equals("0"))
iHour=Integer.parseInt(strHour.substring(1,2));
else
iHour=Integer.parseInt(strHour);
if(iHour>=5)
iHour=iHour-5;
if(iHour>9)
strHour=String.valueOf(iHour);
else
strHour="0"+String.valueOf(iHour);
if(iHour>=5)
{
String strDelTime=strTime.substring(0,14)+strHour+":00";
String strDelOldLog="delete from OA_SYSCURLOGINFO where logdatetime<='"+strDelTime+"'";
DBManage.sqlExecute(strDelOldLog);
}
String strCurLog="select * from OA_SYSCURLOGINFO where logid='"+userid+"' and logip='"+strIp+"'";
ResultSet rsCurLog=DBManage.getQuery(strCurLog);
if(rsCurLog.next())
{
String strCurLogUpdate="update OA_SYSCURLOGINFO set logdatetime='"+DBManage.getNow()+"',logip='"+strIp+"' where logid='"+userid+"' and logip='"+strIp+"'";
DBManage.sqlExecute(strCurLogUpdate);
}
else
{
String strCurLogInsert="insert into OA_SYSCURLOGINFO (logid,logname,logdeptid,logdeptname,logdatetime,logip) values('"+userid+"','"+username+"','"+deptid+"','"+deptname+"','"+DBManage.getNow()+"','"+strIp+"') ";
DBManage.sqlExecute(strCurLogInsert);
}
}
catch(Exception ex)
{
}
%>
[解决办法]
我就看见好多小蚂蚁在爬- -、
楼主你太强了……
[解决办法]
唉,头痛!
我的异常网推荐解决方案:Servlet.service() for servlet default threw exception,http://www.myexception.cn/eclipse/181756.html