From: that.SelectedDude <tha...@gm...> - 2006-10-23 16:54:17
|
Hi, I'm writing some .xql files within eXist's web application. When a static error (i.e., on compiling a .xql file) occurs, it gets thrown. However, dynamic errors aren't (Jetty will output a standard "HTTP 500" error message only). I would like to have each error either being thrown or logged. I was looking into the various log files (in /webapp/WEB-INF/logs, /tools/jetty/logs, and /tools/wrapper/logs) and config files (in /, /tools/jetty/etc, /tools/wrapper/conf, and /webapp/WEB-INF), but I don't understand the logging mechanisms ^^completely. In /tools/jetty/etc/jetty.xml there is an option that looks promising, ----------------------------------------------------------- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- Configure Jetty Logging. --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- Uncomment if using jetty logging. <Call class="org.apache.commons.logging.LogFactory" name="getFactory"> <Call name="getInstance"> <Arg/> <Call name="reset"/> <Call name="add"> <Arg> <New class="org.mortbay.log.OutputStreamLogSink"> <Set name="filename"><SystemProperty name="jetty.home" default="."/>/logs/yyyy_mm_dd.jetty.log</Set> <Set name="retainDays">90</Set> <Set name="append">true</Set> <Set name="logLabels">true</Set> <Set name="logStackSize">true</Set> <Set name="logStackTrace">false</Set> <Set name="logOneLine">false</Set> <Set name="suppressStack">false</Set> <Set name="logTimeZone">GMT</Set> </New> </Arg> </Call> </Call> </Call> --> ----------------------------------------------------------- however, when I uncomment it and restart eXist, Jetty won't start, and /tools/wrapper/logs/exist.log reports: ----------------------------------------------------------- 2006-10-23 18:36:45,369 [WrapperListener_start_runner] DEBUG (XmlConfiguration.java [call]:522) - call getFactory 2006-10-23 18:36:45,369 [WrapperListener_start_runner] DEBUG (XmlConfiguration.java [call]:522) - call getInstance 2006-10-23 18:36:45,385 [WrapperListener_start_runner] WARN (Server.java [<init>]:111) - EXCEPTION java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.mortbay.xml.XmlConfiguration.call(XmlConfiguration.java:539) at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:252) at org.mortbay.xml.XmlConfiguration.call(XmlConfiguration.java:546) at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:252) at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:184) at org.mortbay.jetty.Server.<init>(Server.java:103) at org.mortbay.jetty.Server.<init>(Server.java:77) at org.exist.JettyStart.run(JettyStart.java:108) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.exist.wrapper.Main.start(Main.java:85) at org.tanukisoftware.wrapper.WrapperManager$12.run(WrapperManager.java:2788) Caused by: java.lang.NullPointerException at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.ja va:209) ... 18 more ---------------------------------------------------------- That's strange as the Jetty log config looks like it should work righton. - Anyone to shed some light on how to handle errors by either throwing or logging them? Thanks Robert |