Jeremy Boynes wrote: > We should not be writing things to stdout/stderr - we should be logging > to Tomcat and let it direct the messages where appropriate. I'm Ok with this please make it happen and check that with a default tomcat config if there is a issue with the sca artifacts being loaded users see some error in TC log or console. > > We should also not rewrap unchecked Exceptions in RuntimeException. I > would hope Tomcat logged unchecked Exceptions from listeners; if it > isn't we should log them to its log rather than stderr before rethrowing Same position as before. > (with a comment that this is to work around its failure to log). I have no issues changing this so it works more in line with TC. Big +1 one my part. If I knew how to do it I may have done it that (right) way in the first place. I'll be watching your changes for educational purposes :-) HOWEVER I'm a -1 to any change back to what is was before where a user has to spend 4 hours in a debugger to figure out why a bad sca.module or any issues loading the sca components failed. This needs to be reported by default console and/or log etc. Logging is not sufficient for this type of error.
> > -- > Jeremy > > [EMAIL PROTECTED] wrote: >> Author: rineholt >> Date: Tue Apr 4 05:51:48 2006 >> New Revision: 391292 >> >> URL: http://svn.apache.org/viewcvs?rev=391292&view=rev >> Log: >> We need to report configuration errors to the user. >> Currently without this change the webapp is not initialized but no errors are given to the end user. >> Logging is not sufficient for a error like this. >> >> >> Modified: >> incubator/tuscany/java/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyContextListener.java >> >> Modified: incubator/tuscany/java/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyContextListener.java >> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyContextListener.java?rev=391292&r1=391291&r2=391292&view=diff >> ============================================================================== >> --- incubator/tuscany/java/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyContextListener.java (original) >> +++ incubator/tuscany/java/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyContextListener.java Tue Apr 4 05:51:48 2006 >> @@ -81,28 +81,37 @@ >> >> try { >> loadContext(ctx); >> + moduleContext.fireEvent(EventContext.MODULE_START, null); >> + >> + // add a valve to this context's pipeline that will associate the request with the runtime >> + Valve valve = new TuscanyValve(moduleContext); >> + ctx.getPipeline().addValve(valve); >> + >> + // add the web service servlet wrapper >> + addWebServiceWrapper(ctx); >> + addJSONRPCServiceWrapper(ctx); >> + >> + // add the RuntimeContext in as a servlet context parameter >> + ServletContext servletContext = ctx.getServletContext(); >> + servletContext.setAttribute(TUSCANY_RUNTIME_NAME, runtime); >> + servletContext.setAttribute(MODULE_COMPONENT_NAME, moduleContext); >> + >> + >> } catch (ConfigurationException e) { >> + e.printStackTrace(); >> + e.printStackTrace(System.out); >> log.error("context.configError", e); >> try { >> Thread.sleep(10000); >> } catch (InterruptedException e1) { >> } >> return; >> + }catch( Exception e){ >> + e.printStackTrace(); >> + e.printStackTrace(System.out); >> + new RuntimeException(e); >> + >> } >> - moduleContext.fireEvent(EventContext.MODULE_START, null); >> - >> - // add a valve to this context's pipeline that will associate the request with the runtime >> - Valve valve = new TuscanyValve(moduleContext); >> - ctx.getPipeline().addValve(valve); >> - >> - // add the web service servlet wrapper >> - addWebServiceWrapper(ctx); >> - addJSONRPCServiceWrapper(ctx); >> - >> - // add the RuntimeContext in as a servlet context parameter >> - ServletContext servletContext = ctx.getServletContext(); >> - servletContext.setAttribute(TUSCANY_RUNTIME_NAME, runtime); >> - servletContext.setAttribute(MODULE_COMPONENT_NAME, moduleContext); >> } >> >> private void loadContext(Context ctx) throws ConfigurationException { >> >> > > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
