0

I already have the application run on my first server... and now i want try to run this application on the backup server.
I have installed the tomcat 6.0.14, sql server 2005 and jre1.5.0_12.
when i try to run this application this error was come...

Can somebody tell me what is the problem?
Can you tell me step by step how should i install the tomcat 6.0.14, sql server 2005 and jre.1.5.0_12? Did i missed some procedure?
Thx...

exception

org.apache.jasper.JasperException: An exception occurred processing JSP page /chklogin.jsp at line 26

23:  User user = new User();
24:  Audit audit = new Audit();
25:  
26:  if(Integer.parseInt(sysconfig1.getSCValue()) <= loginfailcount)
27:  {
28: 		loginfailcount=loginfailcount+1;
29: 		session.putValue("loginfailcount",String.valueOf(loginfailcount));


Stacktrace:
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:435)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

java.lang.NullPointerException
	org.apache.jsp.chklogin_jsp._jspService(chklogin_jsp.java:142)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

chklogin.jsp

<%@ include file="incoming/common.jsp"%>
<%
 String username = request.getParameter("username");
 String password = request.getParameter("password");
 String errmsg;

 String _loginfailcount = (String)session.getValue("loginfailcount");

 if(_loginfailcount==null)
	_loginfailcount="0";

 int loginfailcount = Integer.parseInt(_loginfailcount);


 SysConfig sysconfig = new SysConfig();
 SysConfig sysconfig1 = sysconfig.FindByName("PerSeAlowCunt");

 SysConfig sysconfig2 = sysconfig.FindByName("AcrSeAlowCunt");

 SysConfig sysconfig3 = sysconfig.FindByName("PwdRenwFreqcy");

 User user = new User();
 Audit audit = new Audit();
 
 if(Integer.parseInt(sysconfig1.getSCValue()) <= loginfailcount)
 {
		loginfailcount=loginfailcount+1;
		session.putValue("loginfailcount",String.valueOf(loginfailcount));

		audit.Add(username,"SessionLock","Login","","");

		errmsg="sessionlock";
		response.sendRedirect("login.jsp?errmsg="+errmsg);
		return;
 }

Edited by __avd: Added [code] tags. Encase your code in: [code] and [/code]

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by masijade
0

What does "User" constructor do? (IOW It's code, please.) As I find it very hard to believe that that line will throw an NPE, unless the constructor is catching one then rethrowing it, maybe, and then it should be the "throw" line in the constructor that is listed rather than that line. I believe that that is not the line throwing the NPE, and I don't believe that the exception got the line number wrong.

As a side not, you should definately not be using scriptlets in your JSP pages. Break that stuff out into external classes, or, in this case, a Filter may be better.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.