ClassCastException when using ESAPI logger

Description

From gautam...@gmail.com on May 17, 2013 03:57:18

What steps will reproduce the problem? 1. Use a Maven project with Spring 3.0.3, ESAPI 2.0GA over Java 7 and Tomcat 7
2. Initialise logging
CyborgSecurityConfiguration tmpConfig = new CyborgSecurityConfiguration((DefaultSecurityConfiguration) ESAPI.securityConfiguration());

tmpConfig.setLogImplementation( "org.owasp.esapi.reference.Log4JLogFactory" );
tmpConfig.setLogLocation(logs.getAbsolutePath()File.separator"FastForward.log");
ESAPI.override(tmpConfig);

log = (Log4JLogger) ESAPI.getLogger(LoggingManager.class);
3. Initialise logger using Log4JLogger log = (Log4JLogger) ESAPI.getLogger(<classname>.class); in multiple classes What is the expected output? What do you see instead? Expected output is trace output. What is seen is java.lang.ClassCastException: org.apache.log4j.Logger cannot be cast to org.owasp.esapi.Logger
at org.owasp.esapi.reference.Log4JLogFactory.getLogger(Log4JLogFactory.java:81)
at org.owasp.esapi.ESAPI.getLogger(ESAPI.java:146)
at com.cyborg.comm2.model.manager.MenuManager.<clinit>(MenuManager.java:28)… What version of the product are you using? On what operating system? ESAPI 2.0GA on Windows 7, Tomcat 7 and Java 7 Does this issue affect only a specified browser or set of browsers? All browsers, serverside issue Please provide any additional information below.

Original issue: http://code.google.com/p/owasp-esapi-java/issues/detail?id=299

Environment

None

Status

Assignee

Unassigned

Reporter

Max Gelman

Priority

Configure