Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-04-2008, 03:17 PM
Member
 
Join Date: Feb 2008
Posts: 4
doflynn is on a distinguished road
Concurring Java Problem...PLease Please Help
When I run my java application this error keeps coming up when trying to log in. Yer help would be much appreciated

HTTP Status 500 -
--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Exception in JSP: /HeadNPass.jsp:19

16:
17:
18: NurseDao da = new NurseDao();
19: Nurse n = da.getNurse(userName);
20:
21: if(n != null)
22: {

Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handle JspException(JspServletWrapper.java:504)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
org.netbeans.modules.web.monitor.server.MonitorFil ter.doFilter(MonitorFilter.java:368)


root cause

java.lang.NullPointerException
hospital.NurseDao.getNurse(NurseDao.java:324)
org.apache.jsp.HeadNPass_jsp._jspService(HeadNPass _jsp.java:63)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
org.netbeans.modules.web.monitor.server.MonitorFil ter.doFilter(MonitorFilter.java:368)




--------------------------------------------------------------------------------

The code is as follows:


String userName = request.getParameter("username");
String password = request.getParameter("password");


if ((userName != null) && (password != null)){


NurseDao da = new NurseDao();
Nurse n = da.getNurse(userName);

if(n != null)
{
int pw = Integer.parseInt(password);
if(n.getStaffId() == pw)
{
request.getSession(true).setAttribute("HEADNURSE", n);
response.sendRedirect("HeadNurse.jsp");
}
else
{
response.sendRedirect("error.jsp");
}
}
else
{
response.sendRedirect("error.jsp");
}
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-14-2008, 10:46 PM
jelly's Avatar
Member
 
Join Date: Jan 2008
Location: Somerset, UK
Posts: 46
jelly is on a distinguished road
The failure is saying that you have a Null Pointer Exception in your NurseDAO code at line 324 :-
Code:
... hospital.NurseDao.getNurse(NurseDao.java:324) ...
Have a look at the code at line 324 in the NurseDAO class ( or possibly one or two lines either way. These will be in the getNurse method and it is where you are getting the exception. If you get problems post the code from that method and we'll try to help
__________________
-- Hope that helps
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Concurring Java Problem..Please Help doflynn New To Java 3 02-04-2008 05:14 PM
Concurring Java Problem doflynn NetBeans 0 02-04-2008 03:20 PM
Problem in java saytri New To Java 4 01-16-2008 11:09 PM
JAVA if problem toby New To Java 2 07-25-2007 08:58 PM
java SE 6 problem techlance Java Applets 1 06-28-2007 11:10 AM


All times are GMT +3. The time now is 05:57 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org