While converting a SnoopServet to Jboss 7.1.1.Final and Richfaces 4.2.2.Final, I encountered an unexpected exception when my servlet iterated over an enumeration of servlet context attributes:

{code}

ServletContext context = getServletContext();

out.println("Context attributes:");

e = context.getAttributeNames();

while (e.hasMoreElements()) {

String key = (String)e.nextElement();

Object value = context.getAttribute(key);

try {

out.println(" " + key + " = " + value );

}

catch (NullPointerException npe) {

out.println(" " + key + " = [NullPointerException]" );

};{code}

The attributes are all correctly listed on the HTML output except for context attribute "richSkin". Prior to implementaing the try/catch for a NullPointerException that attribute always threw a NullPointerException:

The richSkin attribute was not something that I defined in my application ...... I assume it is created by richFaces itself. If so, richFaces should not create a context attribute that triggers a NullPointerException when one attempts to retrieve it.