groovy - org.apache.commons.logging.impl.Jdk14Logger does not implement Log -
i have application deployed on websphere 8.5, class loading configured "parent last".
in application, use groovyscriptengine run groovy script file.
here groovy script:
@grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7.2' ) import groovyx.net.http.* import static groovyx.net.http.contenttype.* import static groovyx.net.http.method.* new file('grab.log').delete() file file = new file('grab.log') try{ file << '11111\n\n' def http = new httpbuilder('http://www.google.com') def html = http.get( path : '/search', query : [q:'groovy'] ) file << html file << '\n\n22222' }catch(e){ file << org.apache.commons.lang.exception.exceptionutils.getstacktrace(e) }
jars downloaded folder .groovy/grapes, code line def http = new httpbuilder('http://www.google.com')
results in error:
org.apache.commons.logging.logconfigurationexception: org.apache.commons.logging.logconfigurationexception: org.apache.commons.logging.logconfigurationexception: class org.apache.commons.logging.impl.jdk14logger not implement log @ org.apache.commons.logging.impl.logfactoryimpl.newinstance(logfactoryimpl.java:532) @ org.apache.commons.logging.impl.logfactoryimpl.getinstance(logfactoryimpl.java:272) @ org.apache.commons.logging.impl.logfactoryimpl.getinstance(logfactoryimpl.java:246) @ org.apache.commons.logging.logfactory.getlog(logfactory.java:395) @ org.apache.http.impl.client.abstracthttpclient.<init>(abstracthttpclient.java:159) @ org.apache.http.impl.client.defaulthttpclient.<init>(defaulthttpclient.java:173) @ groovyx.net.http.httpbuilder.createclient(httpbuilder.java:858) @ groovyx.net.http.httpbuilder.getclient(httpbuilder.java:842) @ groovyx.net.http.httpbuilder.dorequest(httpbuilder.java:515) @ groovyx.net.http.httpbuilder.get(httpbuilder.java:285) @ groovyx.net.http.httpbuilder.get(httpbuilder.java:255) @ groovyx.net.http.httpbuilder$get.call(unknown source) @ abc.run(abc.groovy:54) @ groovy.util.groovyscriptengine.run(groovyscriptengine.java:551) @ com.mh.test.mhgroovyscriptengine.runscript(mhgroovyscriptengine.java:218) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:88) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:55) @ java.lang.reflect.method.invoke(method.java:613) @ com.google.common.util.concurrent.simpletimelimiter$1$1.call(simpletimelimiter.java:104) @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:345) @ java.util.concurrent.futuretask.run(futuretask.java:177) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1121) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:614) @ java.lang.thread.run(thread.java:777) caused by: org.apache.commons.logging.logconfigurationexception: org.apache.commons.logging.logconfigurationexception: class org.apache.commons.logging.impl.jdk14logger not implement log @ org.apache.commons.logging.impl.logfactoryimpl.getlogconstructor(logfactoryimpl.java:416) @ org.apache.commons.logging.impl.logfactoryimpl.newinstance(logfactoryimpl.java:525) ... 24 more caused by: org.apache.commons.logging.logconfigurationexception: class org.apache.commons.logging.impl.jdk14logger not implement log @ org.apache.commons.logging.impl.logfactoryimpl.getlogconstructor(logfactoryimpl.java:412) ... 25 more
i found jdk14logger exists in these 2 places(at least), , both implement log
- .groovy\grapes\commons-logging\commons-logging\jars\commons-logging-1.1.1.jar, automatically downloaded groovy grape
- ibm\websphere\appserver\plugins\com.ibm.ws.prereq.commons-logging.jar, provided websphere
i've googled several hours , tried solutions have ever found, none of them work me.
another thing same thing works fine on tomcat.
anyone has suggestion or explanation why happens? thank you!
websphere comes it's own commons-logging, mentioned. remove local 1 (groovy) classpath no matter class loader policy use. happens because app loaded first along local resources (parent_last = local_first). since uses commons-logging internally well, , - newer - version loaded, internal components don't obvious reasons.
Comments
Post a Comment