Note that there are some explanatory texts on larger screens.

plurals
  1. POjBOSS+ ESAPI java.lang.ClassCastException: org.jboss.logmanager.log4j.BridgeLogger cannot be cast to org.owasp.esapi.Logger
    primarykey
    data
    text
    <p>I'm newbie Java developer and while trying to develop some website using JBOSS and ESAPI for security I'm getting exception</p> <pre><code>java.lang.ClassCastException: org.jboss.logmanager.log4j.BridgeLogger cannot be cast to org.owasp.esapi.Logger </code></pre> <p>when I try to use ESAPI package from OWASP.</p> <p>My Maven project consists of 2 modules: oak-parent and oak-web.</p> <p>Maven dependency tree is as follows:</p> <pre><code>[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ oak-web --- [INFO] org.me.oak:oak-web:war:0.0.1-SNAPSHOT [INFO] +- javax:javaee-api:jar:6.0:provided [INFO] +- javax.servlet:javax.servlet-api:jar:3.0.1:provided [INFO] +- log4j:log4j:jar:1.2.16:provided [INFO] +- org.reflections:reflections:jar:0.9.8:compile [INFO] | +- javassist:javassist:jar:3.12.1.GA:compile [INFO] | \- dom4j:dom4j:jar:1.6.1:compile [INFO] +- org.jboss:jboss-vfs:jar:3.0.1.GA:provided [INFO] | \- org.jboss.logging:jboss-logging:jar:3.0.0.CR1:provided [INFO] +- org.owasp.esapi:esapi:jar:2.0.1:compile [INFO] | +- commons-configuration:commons-configuration:jar:1.5:compile [INFO] | | +- commons-logging:commons-logging:jar:1.1.1:compile [INFO] | | | +- logkit:logkit:jar:1.0.1:compile [INFO] | | | +- avalon-framework:avalon-framework:jar:4.1.3:compile [INFO] | | | \- javax.servlet:servlet-api:jar:2.3:compile [INFO] | | \- commons-digester:commons-digester:jar:1.8:compile [INFO] | | \- commons-beanutils:commons-beanutils:jar:1.8.3:compile [INFO] | +- commons-beanutils:commons-beanutils-core:jar:1.7.0:compile [INFO] | +- commons-collections:commons-collections:jar:3.2:compile [INFO] | +- xom:xom:jar:1.1:compile [INFO] | | +- xerces:xmlParserAPIs:jar:2.6.2:compile [INFO] | | +- xalan:xalan:jar:2.7.0:compile [INFO] | | \- jaxen:jaxen:jar:1.1-beta-8:compile [INFO] | | \- jdom:jdom:jar:1.0:compile [INFO] | +- org.beanshell:bsh-core:jar:2.0b4:compile [INFO] | \- org.owasp.antisamy:antisamy:jar:1.4.3:compile [INFO] | +- org.apache.xmlgraphics:batik-css:jar:1.7:compile [INFO] | +- net.sourceforge.nekohtml:nekohtml:jar:1.9.12:compile [INFO] | \- commons-httpclient:commons-httpclient:jar:3.1:compile [INFO] | \- commons-codec:commons-codec:jar:1.7:compile [INFO] +- org.jsoup:jsoup:jar:0.2.2:compile [INFO] | \- commons-lang:commons-lang:jar:2.4:compile [INFO] +- xerces:xercesImpl:jar:2.11.0:compile [INFO] | \- xml-apis:xml-apis:jar:1.4.01:compile [INFO] +- org.apache.xmlgraphics:batik-codec:jar:1.7:compile [INFO] | +- org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile [INFO] | +- org.apache.xmlgraphics:batik-bridge:jar:1.7:compile [INFO] | | +- org.apache.xmlgraphics:batik-anim:jar:1.7:compile [INFO] | | +- org.apache.xmlgraphics:batik-ext:jar:1.7:compile [INFO] | | +- org.apache.xmlgraphics:batik-parser:jar:1.7:compile [INFO] | | \- org.apache.xmlgraphics:batik-script:jar:1.7:compile [INFO] | \- org.apache.xmlgraphics:batik-util:jar:1.7:compile [INFO] \- org.apache.xmlgraphics:batik-transcoder:jar:1.7:compile [INFO] +- org.apache.xmlgraphics:fop:jar:0.94:compile [INFO] | +- org.apache.xmlgraphics:xmlgraphics-commons:jar:1.2:compile [INFO] | +- commons-io:commons-io:jar:2.4:compile [INFO] | +- org.apache.avalon.framework:avalon-framework-api:jar:4.3.1:compile [INFO] | \- org.apache.avalon.framework:avalon-framework-impl:jar:4.3.1:compile [INFO] +- org.apache.xmlgraphics:batik-dom:jar:1.7:compile [INFO] +- org.apache.xmlgraphics:batik-gvt:jar:1.7:compile [INFO] +- org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile [INFO] +- org.apache.xmlgraphics:batik-svggen:jar:1.7:compile [INFO] +- org.apache.xmlgraphics:batik-xml:jar:1.7:compile [INFO] \- xml-apis:xml-apis-ext:jar:1.3.04:compile </code></pre> <p>I've already created jboss-deployment-structure.xml to try to exclude log4j (file was created in oak-parent/META-INF:</p> <pre><code>&lt;jboss-deployment-structure&gt; &lt;ear-subdeployments-isolated&gt;true&lt;/ear-subdeployments-isolated&gt; &lt;deployment&gt; &lt;exclusions&gt; &lt;module name="org.apache.log4j" /&gt; &lt;module name="org.jboss.logging" /&gt; &lt;module name="org.jboss.logmanager" /&gt; &lt;module name="org.jboss.log4j.logmanager" /&gt; &lt;module name="org.jboss.logmanager.log4j" /&gt; &lt;/exclusions&gt; &lt;/deployment&gt; &lt;sub-deployment name="oak-web.war"&gt; &lt;exclusions&gt; &lt;module name="org.apache.log4j" /&gt; &lt;module name="org.jboss.logging" /&gt; &lt;module name="org.jboss.logmanager" /&gt; &lt;module name="org.jboss.log4j.logmanager" /&gt; &lt;module name="org.jboss.logmanager.log4j" /&gt; &lt;/exclusions&gt; &lt;/sub-deployment&gt; &lt;/jboss-deployment-structure&gt; </code></pre> <p>but still it didn't help with anything.</p> <p>Do anyone of you know solution to this problem? JBoss classloader is a bit changed when comparing to jboss 5.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload