<div dir="ltr">Try adding it as shared library<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 7, 2014 at 2:24 PM, tekman <span dir="ltr"><<a href="mailto:tekvisle@hotmail.com" target="_blank">tekvisle@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">What's the correct way to configure slf4j + log4j on WebSphere 8.5. My<br>
approach was:<br>
* Include slf4j-api in WEB-INF\lib of the war files of the applications<br>
* Include the binding ja slf4j-log4j in WebSphere lib<br>
* Include log4j.xml in JVM classpath external to the war file.<br>
<br>
Only problem is that it doesn't work. It fails with an error on<br>
initializing. Guess my approach is wrong?<br>
<br>
Thanks for any assistance!<br>
<br>
Here's the stack trace. Note that slfj-api is found in WEB-INF\lib of the<br>
WAR file:<br>
Caused by: java.lang.NoClassDefFoundError: org.slf4j.spi.LoggerFactoryBinder<br>
        at java.lang.ClassLoader.defineClassImpl(Native Method)<br>
        at java.lang.ClassLoader.defineClass(ClassLoader.java:295)<br>
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:154)<br>
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:711)<br>
        at java.net.URLClassLoader.access$400(URLClassLoader.java:92)<br>
        at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1159)<br>
        at java.security.AccessController.doPrivileged(AccessController.java:314)<br>
        at java.net.URLClassLoader.findClass(URLClassLoader.java:594)<br>
        at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:204)<br>
        at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:116)<br>
        at java.lang.ClassLoader.loadClass(ClassLoader.java:690)<br>
        at<br>
com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:62)<br>
        at<br>
com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:58)<br>
        at<br>
com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:616)<br>
        at java.lang.ClassLoader.loadClass(ClassLoader.java:690)<br>
        at<br>
com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:584)<br>
        at java.lang.ClassLoader.loadClass(ClassLoader.java:690)<br>
        at<br>
com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:584)<br>
        at java.lang.ClassLoader.loadClass(ClassLoader.java:690)<br>
        at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)<br>
        at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)<br>
        at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268)<br>
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)<br>
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:254)<br>
        at<br>
no.klp.minside.handler.SoapLoggingHandler.<clinit>(SoapLoggingHandler.java:28)<br>
        at java.lang.J9VMInternals.initializeImpl(Native Method)<br>
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:236)<br>
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)<br>
        at<br>
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:80)<br>
        at<br>
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57)<br>
        at java.lang.reflect.Constructor.newInstance(Constructor.java:539)<br>
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)<br>
        at<br>
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:110)<br>
        at<br>
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:280)<br>
        ... 113 more<br>
Caused by: java.lang.ClassNotFoundException:<br>
org.slf4j.spi.LoggerFactoryBinder<br>
        at java.net.URLClassLoader.findClass(URLClassLoader.java:599)<br>
        at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:204)<br>
        at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:116)<br>
        at java.lang.ClassLoader.loadClass(ClassLoader.java:690)<br>
        ... 147 more<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://slf4j.42922.n3.nabble.com/SLF4j-and-Log4j-on-WebSphere-8-5-What-is-correct-configuration-tp4025748.html" target="_blank">http://slf4j.42922.n3.nabble.com/SLF4j-and-Log4j-on-WebSphere-8-5-What-is-correct-configuration-tp4025748.html</a><br>

Sent from the slf4j - user mailing list archive at Nabble.com.<br>
_______________________________________________<br>
slf4j-user mailing list<br>
<a href="mailto:slf4j-user@qos.ch">slf4j-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/slf4j-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/slf4j-user</a><br>
</blockquote></div><br></div>