当前位置: 代码迷 >> JBoss >> Servlet.service() for servlet jsp threw exception java.lang.NullPointerException,该如何解决
  详细解决方案

Servlet.service() for servlet jsp threw exception java.lang.NullPointerException,该如何解决

热度:5837   发布时间:2013-02-26 00:00:00.0
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);
  相关解决方案