[Esapi-user] (no subject)

Seil, Matt matt.seil at nelnet.net
Thu Jun 19 18:43:17 UTC 2014


You need to define a factory for esapi in log4j.properties:

log4j.loggerFactory=org.owasp.esapi.reference.Log4JLoggerFactory



From: esapi-user-bounces at lists.owasp.org [mailto:esapi-user-bounces at lists.owasp.org] On Behalf Of J Noel
Sent: Thursday, June 19, 2014 1:41 PM
To: esapi-user at lists.owasp.org
Subject: [Esapi-user] (no subject)

I am getting the exception below on my application. I am using both log4J and ESAPI.Logger. Here's line # 69 in the class:
private final org.owasp.esapi.Logger logger = ESAPI.getLogger(this.getClass().getName());. It's failing here.

action.ScheduledEventAction]: Constructor threw exception; nested exception is java.lang.ClassCastException: org.apache.log4j.Logger
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:72)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:939)
    ... 153 more
Caused by: java.lang.ClassCastException: org.apache.log4j.Logger
    at org.owasp.esapi.reference.Log4JLogFactory.getLogger(Log4JLogFactory.java:88)
    at org.owasp.esapi.ESAPI.getLogger(ESAPI.java:154)
    at xxx.xxx.xxx.xxx.xxx.action.ScheduledEventAction.<init>(ScheduledEventAction.java:69)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
    ... 155 more
Thank you for any help.
------------------------------------------------------------
The information contained in this message is confidential proprietary property of Nelnet, Inc. and its affiliated companies (Nelnet) and is intended for the recipient only. Any reproduction, forwarding, or copying without the express permission of Nelnet is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to this e-mail.
------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.owasp.org/pipermail/esapi-user/attachments/20140619/39aab2af/attachment.html>


More information about the Esapi-user mailing list