LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Java - HTTP Status 500 (http://www.linuxquestions.org/questions/programming-9/java-http-status-500-a-693860/)

fullgore 12-30-2008 09:58 AM

Java - HTTP Status 500
 
I have this error at a server, any clue of what could be? I dont 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.

taylor_venable 12-30-2008 10:19 AM

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].

fullgore 12-30-2008 12:12 PM

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 (Post 3391589)
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].


paulsm4 12-30-2008 02:03 PM

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

dhanyaelizabeth 01-02-2009 02:44 AM

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

fullgore 01-02-2009 11:28 AM

Quote:

Originally Posted by dhanyaelizabeth (Post 3394145)
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 Im not sure if its logging right or if Im undertanding the log.

fullgore 01-02-2009 01:01 PM

This is the log file of tomcat, Im 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)

paulsm4 01-02-2009 02:24 PM

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.

taylor_venable 01-02-2009 02:33 PM

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?

paulsm4 01-02-2009 04:20 PM

fullgore -

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


All times are GMT -5. The time now is 03:16 PM.