Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 64738 invoked from network); 1 May 2006 11:49:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 May 2006 11:49:05 -0000 Received: (qmail 314 invoked by uid 500); 1 May 2006 11:49:05 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 289 invoked by uid 500); 1 May 2006 11:49:04 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 278 invoked by uid 99); 1 May 2006 11:49:04 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 May 2006 04:49:04 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 01 May 2006 04:49:03 -0700 Received: (qmail 61829 invoked by uid 65534); 1 May 2006 11:48:43 -0000 Message-ID: <20060501114843.61828.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r398577 - in /geronimo/branches/1.1/modules: jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Date: Mon, 01 May 2006 11:48:42 -0000 To: scm@geronimo.apache.org From: jsisson@apache.org X-Mailer: svnmailer-1.0.8 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jsisson Date: Mon May 1 04:48:36 2006 New Revision: 398577 URL: http://svn.apache.org/viewcvs?rev=398577&view=rev Log: GERONIMO-1949 - Some Tomcat & Jetty web app deployment errors do not identify web app module name associated with the error Modified: geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Modified: geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?rev=398577&r1=398576&r2=398577&view=diff ============================================================================== --- geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java (original) +++ geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java Mon May 1 04:48:36 2006 @@ -206,7 +206,10 @@ WebAppDocument webAppDoc = SchemaConversionUtils.convertToServletSchema(parsed); webApp = webAppDoc.getWebApp(); } catch (XmlException xmle) { - throw new DeploymentException("Error parsing web.xml", xmle); + // Output the target path in the error to make it clearer to the user which webapp + // has the problem. The targetPath is used, as moduleFile may have an unhelpful + // value such as C:\geronimo-1.1\var\temp\geronimo-deploymentUtil22826.tmpdir + throw new DeploymentException("Error parsing web.xml for "+ targetPath, xmle); } check(webApp); @@ -277,7 +280,7 @@ try { rawPlan = XmlBeansUtil.parse(path); } catch (FileNotFoundException e1) { - log.warn("Web application does not contain a WEB-INF/geronimo-web.xml deployment plan. This may or may not be a problem, depending on whether you have things like resource references that need to be resolved. You can also give the deployer a separate deployment plan file on the command line."); + log.warn("Web application " +targetPath + " does not contain a WEB-INF/geronimo-web.xml deployment plan. This may or may not be a problem, depending on whether you have things like resource references that need to be resolved. You can also give the deployer a separate deployment plan file on the command line."); } } } @@ -298,7 +301,7 @@ } return jettyWebApp; } catch (XmlException e) { - throw new DeploymentException("xml problem", e); + throw new DeploymentException("xml problem for web app "+targetPath, e); } } @@ -318,7 +321,7 @@ ENCConfigBuilder.registerMessageDestinations(earContext.getRefContext(), module.getName(), messageDestinations, gerMessageDestinations); if ((webApp.getSecurityConstraintArray().length > 0 || webApp.getSecurityRoleArray().length > 0) && !gerWebApp.isSetSecurityRealmName()) { - throw new DeploymentException("web.xml includes security elements but Geronimo deployment plan is not provided or does not contain element necessary to configure security accordingly."); + throw new DeploymentException("web.xml for web app " + module.getName() + " includes security elements but Geronimo deployment plan is not provided or does not contain element necessary to configure security accordingly."); } if (gerWebApp.isSetSecurity()) { if (!gerWebApp.isSetSecurityRealmName()) { @@ -482,7 +485,7 @@ JspConfigType[] jspConfigArray = webApp.getJspConfigArray(); if (jspConfigArray.length > 1) { - throw new DeploymentException("At most one jsp-config element, not " + jspConfigArray.length); + throw new DeploymentException("Web app "+ module.getName() +" cannot have more than one jsp-config element. Currently has " + jspConfigArray.length +" jsp-config elements."); } Map tagLibMap = new HashMap(); for (int i = 0; i < jspConfigArray.length; i++) { @@ -496,7 +499,7 @@ LoginConfigType[] loginConfigArray = webApp.getLoginConfigArray(); if (loginConfigArray.length > 1) { - throw new DeploymentException("At most one login-config element, not " + loginConfigArray.length); + throw new DeploymentException("Web app "+ module.getName() +" cannot have more than one login-config element. Currently has " + loginConfigArray.length +" login-config elements."); } if (loginConfigArray.length == 1) { LoginConfigType loginConfig = loginConfigArray[0]; @@ -544,7 +547,9 @@ ServletMappingType servletMappingType = servletMappingArray[i]; String servletName = servletMappingType.getServletName().getStringValue().trim(); if (!knownServlets.contains(servletName)) { - throw new DeploymentException("Servlet mapping refers to servlet '" + servletName + "' but no such servlet was found!"); + throw new DeploymentException("Web app " + module.getName() + + " contains a servlet mapping that refers to servlet '" + servletName + + "' but no such servlet was found!"); } String urlPattern = servletMappingType.getUrlPattern().getStringValue().trim(); if (!knownServletMappings.contains(urlPattern)) { @@ -748,7 +753,7 @@ } catch (DeploymentException de) { throw de; } catch (Exception e) { - throw new DeploymentException("Unable to initialize webapp GBean", e); + throw new DeploymentException("Unable to initialize webapp GBean for "+module.getName(), e); } } @@ -839,13 +844,13 @@ try { servletClass = webClassLoader.loadClass(servletClassName); } catch (ClassNotFoundException e) { - throw new DeploymentException("Could not load servlet class " + servletClassName, e); + throw new DeploymentException("Could not load servlet class " + servletClassName, e); // TODO identify web app in message } Class baseServletClass; try { baseServletClass = webClassLoader.loadClass(Servlet.class.getName()); } catch (ClassNotFoundException e) { - throw new DeploymentException("Could not load javax.servlet.Servlet in web classloader", e); + throw new DeploymentException("Could not load javax.servlet.Servlet in web classloader", e); // TODO identify web app in message } if (baseServletClass.isAssignableFrom(servletClass)) { servletData = new GBeanData(servletAbstractName, JettyServletHolder.GBEAN_INFO); @@ -856,7 +861,7 @@ //let the web service builder deal with configuring the gbean with the web service stack Object portInfo = portMap.get(servletName); if (portInfo == null) { - throw new DeploymentException("No web service deployment info for servlet name " + servletName); + throw new DeploymentException("No web service deployment info for servlet name " + servletName); // TODO identify web app in message } getWebServiceBuilder().configurePOJO(servletData, moduleFile, portInfo, servletClassName, webClassLoader); } @@ -866,7 +871,7 @@ //TODO MAKE THIS CONFIGURABLE!!! Jetty uses the servlet mapping set up from the default-web.xml servletData.setAttribute("servletClass", "org.apache.jasper.servlet.JspServlet"); } else { - throw new DeploymentException("Neither servlet class nor jsp file is set for " + servletName); + throw new DeploymentException("Neither servlet class nor jsp file is set for " + servletName); // TODO identify web app in message } // link to previous servlet, if there is one, so that we @@ -904,7 +909,7 @@ try { earContext.addGBean(servletData); } catch (GBeanAlreadyExistsException e) { - throw new DeploymentException("Could not add servlet gbean to context", e); + throw new DeploymentException("Could not add servlet gbean to context", e); // TODO identify web app in message } return servletAbstractName; } Modified: geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=398577&r1=398576&r2=398577&view=diff ============================================================================== --- geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java (original) +++ geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Mon May 1 04:48:36 2006 @@ -151,7 +151,10 @@ WebAppDocument webAppDoc = SchemaConversionUtils.convertToServletSchema(parsed); webApp = webAppDoc.getWebApp(); } catch (XmlException xmle) { - throw new DeploymentException("Error parsing web.xml", xmle); + // Output the target path in the error to make it clearer to the user which webapp + // has the problem. The targetPath is used, as moduleFile may have an unhelpful + // value such as C:\geronimo-1.1\var\temp\geronimo-deploymentUtil22826.tmpdir + throw new DeploymentException("Error parsing web.xml for "+targetPath, xmle); } check(webApp); @@ -224,7 +227,7 @@ try { rawPlan = XmlBeansUtil.parse(path); } catch (FileNotFoundException e1) { - log.warn("Web application does not contain a WEB-INF/geronimo-web.xml deployment plan. This may or may not be a problem, depending on whether you have things like resource references that need to be resolved. You can also give the deployer a separate deployment plan file on the command line."); + log.warn("Web application "+ targetPath + " does not contain a WEB-INF/geronimo-web.xml deployment plan. This may or may not be a problem, depending on whether you have things like resource references that need to be resolved. You can also give the deployer a separate deployment plan file on the command line."); } } } @@ -245,7 +248,7 @@ } return tomcatWebApp; } catch (XmlException e) { - throw new DeploymentException("xml problem", e); + throw new DeploymentException("xml problem for web app "+targetPath, e); } } @@ -266,7 +269,7 @@ ENCConfigBuilder.registerMessageDestinations(earContext.getRefContext(), module.getName(), messageDestinations, gerMessageDestinations); if((webApp.getSecurityConstraintArray().length > 0 || webApp.getSecurityRoleArray().length > 0) && !gerWebApp.isSetSecurityRealmName()) { - throw new DeploymentException("web.xml includes security elements but Geronimo deployment plan is not provided or does not contain element necessary to configure security accordingly."); + throw new DeploymentException("web.xml for web app " + module.getName() + " includes security elements but Geronimo deployment plan is not provided or does not contain element necessary to configure security accordingly."); } if (gerWebApp.isSetSecurity()) { if (!gerWebApp.isSetSecurityRealmName()) { @@ -384,7 +387,7 @@ String servletClassName = servletType.getServletClass().getStringValue().trim(); Object portInfo = portMap.get(servletName); if (portInfo == null) { - throw new DeploymentException("No web service deployment info for servlet name " + servletName); + throw new DeploymentException("No web service deployment info for servlet name " + servletName +" in web app "+module.getName()); } WebServiceContainer wsContainer = configurePOJO(webModule.getModuleFile(), portInfo, servletClassName, moduleClassLoader); @@ -443,7 +446,7 @@ } catch (DeploymentException de) { throw de; } catch (Exception e) { - throw new DeploymentException("Unable to initialize webapp GBean", e); + throw new DeploymentException("Unable to initialize GBean for web app "+module.getName(), e); } }