webtier@glassfish.java.net

webcontainer.invalidProperty is logged too often

From: Wolfram Rittmeyer <w.rittmeyer_at_jsptutorial.org>
Date: Fri, 06 Mar 2009 23:00:22 +0100

The warning "webcontainer.invalidProperty" is logged in several places.
Two of these deal with property elements below <the sun-web-app> element.

The first is in WarHandler which logs this message for nearly all valid
properties. Actually I do not know why it is logged in WarHandler at all
- given that WebModule is treating properties anyway.

WebModule nevertheless also has a flaw in that it logs this message for
the valid elements starting with "valve_" or "listener_".

To reduce log messages to those elements that really are invalid I
propose the attached patch. If this is reviewed positively I will commit it.


--
Wolfram Rittmeyer


Index: war-util/src/main/java/com/sun/enterprise/glassfish/web/WarHandler.java
===================================================================
--- war-util/src/main/java/com/sun/enterprise/glassfish/web/WarHandler.java (revision 25174)
+++ war-util/src/main/java/com/sun/enterprise/glassfish/web/WarHandler.java (working copy)
@@ -335,12 +335,6 @@
                             useBundledJSF = Boolean.valueOf(value);
                         } else if("useBundledJsf".equalsIgnoreCase(propName)) {
                             useBundledJSF = Boolean.valueOf(value);
- } else {
- Object[] params = { propName, value };
- if (logger.isLoggable(Level.WARNING)) {
- logger.log(Level.WARNING, "webcontainer.invalidProperty",
- params);
- }
                         }
                     } else {
                         skipSubTree(name);
Index: web-glue/src/main/java/com/sun/enterprise/web/WebModule.java
===================================================================
--- web-glue/src/main/java/com/sun/enterprise/web/WebModule.java (revision 25174)
+++ web-glue/src/main/java/com/sun/enterprise/web/WebModule.java (working copy)
@@ -1342,6 +1342,10 @@
                     setUseMyFaces(ConfigBeansUtilities.toBoolean(value));
                 } else if(name.startsWith("alternatedocroot_")) {
                     parseAlternateDocBase(name, value);
+ } else if(name.startsWith("valve_") ||
+ name.startsWith("listener_")) {
+ // do nothing; these properties are dealt with
+ // in configureCatalinaProperties()
                 } else {
                     Object[] params = {name, value};
                     logger.log(Level.WARNING, "webcontainer.invalidProperty",