As seen from the title I am getting a class cast exception when trying to replace my log4j/slf4j logging with ESAPI logging in my code. Specifically, it happens in the following method:
private Logger log()
{
return ESAPI.getLogger(getClass());
}
The following are the imports specific to the logger:
import org.owasp.esapi.ESAPI;
import org.owasp.esapi.Logger;
What makes this mind boggling to me is that there is ESAPI logging in place in other classes which works just fine. From my understanding, I thought if log4j loggers were in place and working then that it would be a simple matter of swapping it out for ESAPI since it's an extension of it. My log4j properties file also has the loggerFactory defined --
log4j.loggerFactory=org.owasp.esapi.reference.Log4JLoggerFactory
Any ideas as to what might be going on? This is just a simple java/struts/spring app.
Loggerin your first method? It has to beorg.owasp.esapi.Logger.ClassLoaderissue where an abstract class declares thelog4j.Loggerbeforeesapi.Logger?