This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JSP and the fly likes getting a 500 error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "getting a 500 error" Watch "getting a 500 error" New topic
Author

getting a 500 error

Patrick Mallahan
Ranch Hand

Joined: Apr 22, 2005
Posts: 69
2005-06-08 14:23:02 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at com.aga.web.globaldb.tables.EMPLOYEE.getSelectListNames(EMPLOYEE.java:367)
at com.aga.web.globaldb.EmployeeHandler.getEmployeeSelectList(EmployeeHandler.java:224)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:54)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Unknown Source)





Dont know why i am getting this error, it seems that it is having problems accessing the SQL database, but i dont know what I need to check to make sure the right path/user/connectors are there. This is from Tomcat 5.0.29 using j2sdk 1.4.2_08 and My SQL 4.1.12
Rahi Sanj
Greenhorn

Joined: Feb 13, 2003
Posts: 11
Hi,
You are getting a NullPointerException in EMPLOYEE.java at line 367. You are trying to invoke something on an object which is Null.
I dont think it is to do with accessing the database.
Make sure that you have NullPointerCheck on that particular object where it is throwing that exception.
Patrick Mallahan
Ranch Hand

Joined: Apr 22, 2005
Posts: 69
great now i gotta look for that class
Patrick Mallahan
Ranch Hand

Joined: Apr 22, 2005
Posts: 69
nope, its not an error, basically pulled all of this off of another server and it worked fine on it. It has something to do with environment.
Patrick Mallahan
Ranch Hand

Joined: Apr 22, 2005
Posts: 69
I could be wrong, but that line of code looks like this:

catch (SQLException e)
{
System.out.println("EMPLOYEE.select():SQLException: " + e);
System.out.println(" --> SQL: [" + query + "]");
}

So is the program not able to access the DB because its catching an Exception maybe?
Patrick Mallahan
Ranch Hand

Joined: Apr 22, 2005
Posts: 69
I seem to have shorten the output, here it is now:

java.lang.NullPointerException
com.aga.web.globaldb.tables.EMPLOYEE.getSelectListNames(EMPLOYEE.java:367)
com.aga.web.globaldb.EmployeeHandler.getEmployeeSelectList(EmployeeHandler.java:224)
org.apache.jsp.index_jsp._jspService(index_jsp.java:54)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60080
    
  65

java.lang.NullPointerException
com.aga.web.globaldb.tables.EMPLOYEE.getSelectListNames(EMPLOYEE.java:367)


Plain and simple: your code is performing a null reference at line 367 in EMPLOYEE.java. Why, no one here can say with what you've posted. You need to look at the code on that line to figure out what's set to null that shouldn't be, and then back-track to find out why.

Btw, it's always a good idea to follow standard Java conventions. Classes should be named like Employee,java rather than EMPLOYEE.java. It makes your code much easier for others to decipher and offer help.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Patrick Mallahan
Ranch Hand

Joined: Apr 22, 2005
Posts: 69
i know, its not my code, this guy didnt comment anywhere. I think this problem may have something to do with my CLASSPATH variable not being set, so I am in the environment variable part of XP and I am setting CLASSPATH=C:\cvsrepository ; C:\Tomcat5.0.29\common\lib\servlet-api.jar

is that right?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60080
    
  65

Tomcat pays no attention to the CLASSPATH environment variable, so I don't think that will be your problem.
Patrick Mallahan
Ranch Hand

Joined: Apr 22, 2005
Posts: 69
yea, i needed a nobody user in my SQL database
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getting a 500 error
 
Similar Threads
stratup Exception
Tomcat + NullPointerException
Getting an Exception
No suitable driver
Servlet.service() for servlet jsp threw exception