Re: tomcat error..
- From: maya <maya778899@xxxxxxxxx>
- Date: Fri, 18 Jan 2008 11:44:14 -0500
Lew wrote:
maya wrote:why does tomcat sometimes give so little info on what is causing an
error... how am I supposed to know what causes this error??
By debugging the code first, then putting it in production.
org.apache.jasper.JasperException: Unable to compile class for JSP:
[ info missing here it seems...........]
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
the stacktrace is useless if it doesn't show you line in YOUR FILE where
error is occurring.... :( this is very annoying.. (tomcat 5.5..)
Tomcat is not a development tool. It does run in a debug mode, that is, the JVM it rests on can. So smart IDEs can run your code within a Tomcat instance and breakpoint on JSP lines for you.
Remember that Tomcat doesn't execute JSPs, so it has no way of knowing where in "YOUR FILE" the error is. It only knows where in ITS FILEs there's an error, and dutifully reports that in its stack trace. Now, what, it should start reading minds? What if the class is compiled with debug options turned off, as is usual in production systems? (Or rather, would that it were usual.)
Within the loving arms of your IDE you can make these connections. The IDE itself tracks how the code transmutes from source to translated source to object to run-time.
To diagnose problems that only show up in production (or the simulated production environment of going directly to Tomcat without the IDE's intervention), develop a good logging strategy. Use java.util.logging or log4j, and think about the hapless operations folk when you design logging. The log statements can change detail levels in the field, useful when narrowing down the exact location of a fubar.
Of course, log statements cannot directly tell where in YOUR FILE an error occurred, but they can focus your attention closely enough that the brain can leap the gap.
well, the weird thing is, sometimes it shows in what line in JSP servlet the error is, I find my way to the servlet and find line causing error, which is quite useful, but sometimes it doesn't tell you anything, like example I posted above.. (tomcat "doesn't execute JSP's" what....???? tomcat is not the servlet engine???)
one of the main problems I have in general with JSP's is that sometimes they stop generating interface code "in midstream" and I have no idea why.. someone here suggested defining an error pg and stuff, which I did, but it's also not too useful, as sometimes it doesn't show error at all, it just says "Exception: " then nothing...
I don't use any IDE at all, develop in HomeSite (HTML editor) and that's it.. (if doing servlets or stand-alone classes I compile "manually" in DOS shell.. I guess it might be a good idea for me to start using Eclipse or something...;)
what IS log4j... at work we use weblogic, not tomcat.. I always see "log4j" (or something like that) in weblogic console when booting up weblogic..
ok, thank you very much..
.
- Follow-Ups:
- Re: tomcat error..
- From: Lew
- Re: tomcat error..
- From: Wojtek
- Re: tomcat error..
- References:
- tomcat error..
- From: maya
- Re: tomcat error..
- From: GArlington
- Re: tomcat error..
- From: Lew
- tomcat error..
- Prev by Date: Re: tomcat error..
- Next by Date: Re: tomcat error..
- Previous by thread: Re: tomcat error..
- Next by thread: Re: tomcat error..
- Index(es):
Relevant Pages
|
|