LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 12-30-2008, 08:58 AM   #1
fullgore
Member
 
Registered: Aug 2006
Location: Brasilia, Brazil
Distribution: Slackware / Suse / FreeBSD
Posts: 55

Rep: Reputation: 15
Java - HTTP Status 500


I have this error at a server, any clue of what could be? I donīt understand anything about JAVA

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

HTTP Status 500 -

type Exception report

message

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

exception

javax.servlet.ServletException: Servlet execution threw an exception

root cause

java.lang.NoClassDefFoundError: org/hibernate/HibernateException
sismopi.NivelAcesso.getListaNivelAcesso(NivelAcesso.java:173)
sismopi.Usuario.getListaAcesso(Usuario.java:316)
sismopi.Usuario.<init>(Usuario.java:106)
Controle.doPost(Controle.java:161)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.
 
Old 12-30-2008, 09:19 AM   #2
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 40
Well, I don't know anything about Hibernate specifically, but you'll need to put the Hibernate JAR(s) somewhere in Tomcat's classpath, e.g. in the common/lib directory [of the Tomcat installation] or the WEB-INF/lib directory [of the servlet].
 
Old 12-30-2008, 11:12 AM   #3
fullgore
Member
 
Registered: Aug 2006
Location: Brasilia, Brazil
Distribution: Slackware / Suse / FreeBSD
Posts: 55

Original Poster
Rep: Reputation: 15
The lib file already is at the WEB-INF directory in fact all the needed libs are at the application WEB-INF directory.

Quote:
Originally Posted by taylor_venable View Post
Well, I don't know anything about Hibernate specifically, but you'll need to put the Hibernate JAR(s) somewhere in Tomcat's classpath, e.g. in the common/lib directory [of the Tomcat installation] or the WEB-INF/lib directory [of the servlet].
 
Old 12-30-2008, 01:03 PM   #4
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

1. "Error 500" is a generic error. It just means that something - almost *anything* - went wrong at the server side as it was trying to process a request. By itself, "Error 500" isn't terribly useful.

2. It looks like Hibernate is installed and working correctly (or you probaby wouldn't have gotten as far as you did).

3. The crux of the problem is here:
Quote:
java.lang.NoClassDefFoundError: org/hibernate/HibernateException
sismopi.NivelAcesso.getListaNivelAcesso(NivelAcesso.java:173)
sismopi.Usuario.getListaAcesso(Usuario.java:316
sismopi.Usuario.<init>(Usuario.java:106)
Controle.doPost(Controle.java:161)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
<= Look at NivelAcesso.java, line 173 and Usuario.java, 316.
Make sure you've installed all the .jar or .class files for "sismopi.NivelAcesso" and "sismopi.Usuario".
Make sure the physical subdirectory is "sismopi/Usuario" and "sismopi/NivelAcesso".
Make sure the file and path names are spelled exactly

'Hope that helps .. PSM
 
Old 01-02-2009, 01:44 AM   #5
dhanyaelizabeth
LQ Newbie
 
Registered: Jan 2009
Posts: 27

Rep: Reputation: 15
HTTP 500 is a very generic servlet error.

From the exception stack trace, it looks like you might not have included all the requisite lib files needed for your application to run properly.
Have you put all the requisite jar files pertaining to hibernate under the webapps/web-inf/lib folder?


Also, if you have a proper exception handling and logging mechanism (log4j) implemented in your application - things will be a lot more easier to troubleshoot such errors.

Linux Archive

Last edited by dhanyaelizabeth; 01-10-2009 at 03:05 PM.
 
Old 01-02-2009, 10:28 AM   #6
fullgore
Member
 
Registered: Aug 2006
Location: Brasilia, Brazil
Distribution: Slackware / Suse / FreeBSD
Posts: 55

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by dhanyaelizabeth View Post
HTTP 500 is a very generic servlet error.

From the exception stack trace, it looks like you might not have included all the requisite lib files needed for your application to run properly.
Have you put all the requisite jar files pertaining to hibernate under the webapps/web-inf/lib folder?


Also, if you have a proper exception handling and logging mechanism (log4j) implemented in your application - things will be a lot more easier to troubleshoot such errors.

I verified the the webapps/web-inf/lib folder and I found the hibernate files, I also looked at others directories and I found the hibernate config file, the hbm, class and java files of the application. I installed and cofigured log4j according to this manual http://tomcat.apache.org/tomcat-5.5-doc/logging.html but Iīm not sure if itīs logging right or if Iīm undertanding the log.
 
Old 01-02-2009, 12:01 PM   #7
fullgore
Member
 
Registered: Aug 2006
Location: Brasilia, Brazil
Distribution: Slackware / Suse / FreeBSD
Posts: 55

Original Poster
Rep: Reputation: 15
This is the log file of tomcat, Iīm sorry to put it here but I have no idea of what it means:

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

02/01/2009 09:10:13 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet Controle threw exception
java.lang.NoClassDefFoundError: org/hibernate/HibernateException
at sismopi.NivelAcesso.getListaNivelAcesso(NivelAcesso.java:173)
at sismopi.Usuario.getListaAcesso(Usuario.java:316)
at sismopi.Usuario.<init>(Usuario.java:106)
at Controle.doPost(Controle.java:161)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
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.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(Http11BaseProt ocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
 
Old 01-02-2009, 01:24 PM   #8
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Fullgore - At the risk of repeating myself ;-)
Quote:
Hi -

1. "Error 500" is a generic error. It just means that something - almost *anything* - went wrong at the server side as it was trying to process a request. By itself, "Error 500" isn't terribly useful.

2. It looks like Hibernate is installed and working correctly (or you probaby wouldn't have gotten as far as you did).

3. The crux of the problem is here:
Quote:
java.lang.NoClassDefFoundError: org/hibernate/HibernateException
sismopi.NivelAcesso.getListaNivelAcesso(NivelAcesso.java:173)
sismopi.Usuario.getListaAcesso(Usuario.java:316
sismopi.Usuario.<init>(Usuario.java:106)
Controle.doPost(Controle.java:161)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
<= Look at NivelAcesso.java, line 173 and Usuario.java, 316.
Make sure you've installed all the .jar or .class files for "sismopi.NivelAcesso" and "sismopi.Usuario".
Make sure the physical subdirectory is "sismopi/Usuario" and "sismopi/NivelAcesso".
Make sure the file and path names are spelled exactly

'Hope that helps .. PSM
Please look at my previous post; please let us know what you find.

And remember, just because Hibernate happens to be *reporting* the error, it doesn't mean that anything about Hibernate necessarily *caused* the error. My feeling is that it's probably one of your *own* classes that isn't installed correctly.

Last edited by paulsm4; 01-02-2009 at 02:19 PM.
 
Old 01-02-2009, 01:33 PM   #9
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 40
You could do something to make sure that the HibernateException class exists:
Code:
$ jar tvf hibernate3.jar | grep HibernateException
   692 Wed Sep 10 12:21:34 EDT 2008 org/hibernate/HibernateException.class
Also, what's the code around NivelAcesso.java:173 look like?
 
Old 01-02-2009, 03:20 PM   #10
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
fullgore -

Also look at this thread:
http://forum.springframework.org/showthread.php?t=18067
<= Maybe the problem *is* Hibernate configuration after all...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
500 EOF instead of reponse status line in perl script Sherlock Programming 7 05-16-2007 06:52 AM
monodoc-http gives a http 500 internal server error ernesto_cgf Linux - Software 0 05-10-2007 03:48 PM
HELP! CGI problem : HTTP 500 - Internal server error eech55 Programming 2 10-11-2004 11:27 AM
HTTP error: 500 read timeout precioso77 Linux - Software 0 11-17-2003 04:59 PM
http status 500 error pattar Linux - Software 1 02-18-2003 03:01 PM


All times are GMT -5. The time now is 12:27 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration