aspose file tools*
The moose likes Servlets and the fly likes Question Regarding HTTP Status 500 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Question Regarding HTTP Status 500" Watch "Question Regarding HTTP Status 500" New topic
Author

Question Regarding HTTP Status 500

Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
Hello I am researching a problem with a class file which utilizes about four (4) other servlets.

I have not done anything to these servlets, but all of a sudden, I am getting a HTTP Status 500 error.


type Exception report

message

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

exception

javax.servlet.ServletException
bcc.lib.BaseBccServlet.doPost(BaseBccServlet.java:106)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


root cause

javax.servlet.ServletException
bcc.lib.BasePageJQuery.doServletFunction(BasePageJQuery.java:48)
bcc.lib.BaseBccServlet.doPost(BaseBccServlet.java:102)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


root cause

java.lang.NullPointerException
bcc.lib.Context.getDisplayLifeReviewForUser(Context.java:932)
bcc.lib.NavBar._generateHTML(NavBar.java:145)
bcc.lib.NavBar.getHTML(NavBar.java:114)
bcc.lib.Context.getNavBarHTML(Context.java:1098)
bcc.lib.BasePageJQuery.getNavBar(BasePageJQuery.java:312)
bcc.lib.BasePageJQuery.buildPage(BasePageJQuery.java:84)
bcc.lib.BasePageJQuery.doServletFunction(BasePageJQuery.java:42)
bcc.lib.BaseBccServlet.doPost(BaseBccServlet.java:102)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

I researched the log file and it is stating this:

(I never touched the servlet and I cannot figure out why it is doing this. This happens repeatedly.)

2012-08-09 10:56:52,473 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/].[SelectReporting]] Servlet.service() for servlet SelectReporting threw exception
java.lang.NullPointerException
at bcc.lib.Context.getDisplayLifeReviewForUser(Context.java:932)
at bcc.lib.NavBar._generateHTML(NavBar.java:145)
at bcc.lib.NavBar.getHTML(NavBar.java:114)
at bcc.lib.Context.getNavBarHTML(Context.java:1098)
at bcc.lib.BasePageJQuery.getNavBar(BasePageJQuery.java:312)
at bcc.lib.BasePageJQuery.buildPage(BasePageJQuery.java:84)
at bcc.lib.BasePageJQuery.doServletFunction(BasePageJQuery.java:42)
at bcc.lib.BaseBccServlet.doPost(BaseBccServlet.java:102)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
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:96)
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.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
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:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
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:595)
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Well, did anyone update the server ?

Maybe change/update some jars?

Start tracking changes back.

WP
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61433
    
  67

Or do something crazy like look at the source where the exception is occurring.

java.lang.NullPointerException
at bcc.lib.Context.getDisplayLifeReviewForUser(Context.java:932)


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
Hello I opened the Java Track Trace Console in Eclipse Helios and pasted the log file exception into that window.

I then clicked on the blue hyperlinks, which brought the individual .java class files into the Eclipse IDE.

What I noticed is that all the above referenced servlets that were contained in that log file exception with the blue hyperlinks suddenly had a bunch of red squares on them all of a sudden.

What does that mean?

I am going through the .java files trying to fix the red squares, but my question is, how come these did not show up until I opened the Java Stack Trace Console?

Thanks,
Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
I forgot to mention the following:

On my main class that is the root cuase, it is saying that the

import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;

"The import javax.servlet cannot be resolved"

I followed the directions on this:

http://tech.amikelive.com/node-269/eclipse-quick-tip-resolving-error-the-import-javaxservlet-cannot-be-resolved/

and I noticed it rebuilt my project after I saved, but the red squares remain.

Will these red squares go away after I resolve each problem? Or will they stay the same? I am not sure, and that's why I am asking.
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi,

Add servlet-api.jar in your class path and see if its working or not.




Regards
Jatan
Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
Ok I got the classes working so there are no more red squares.

I have an error on this line: { below public String getDisplayFullBioForHome



Any ideas on what might be the problem?

Thanks,
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Michele Smith wrote:Ok I got the classes working so there are no more red squares.

I have an error on this line: { below public String getDisplayFullBioForHome



Any ideas on what might be the problem?



What error are you getting? Why does the method throw Exception, which is generic?
This method looks like a not so good implementation to me. Don't you need thread safety?


SCJP, SCWCD.
|Asking Good Questions|
Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
Hello and thank you so much for taking the time to submit feedback.

What could I do to invoke thread safe methodologies on this project?

By the way, I am thinking of doing this:

If I invoke setHome(1) method, this should load the objects member variables that is if the BcSQLAgent agt is valid.

Not sure what BcSQLAgent contains. I am going to remote debug and see if it is valid. Do you have any other ideas?




public void setHome( int homeId )

{

releaseHome();

_homeId = homeId;

Logger.fine( this, "setHome", "HomeId=" + homeId );

} // setHome()
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Question Regarding HTTP Status 500