尝试使用Jenkins进行“lein测试”“无法加载Logmanager”org.apache.juli.ClassLoaderLogManager“”

时间:2012-02-16 21:30:04

标签: linux jenkins clojure leiningen

我正在尝试用jenkins执行“lein测试”但是我得到以下错误。 但是如果我在shell中运行它(使用相同的用户'tomcat6')它就可以了。 我将不胜感激任何帮助。 我使用的是Ubuntu,Tomcat6,Jenkins 1.451,java 1.6.0_22(也试过1.7)。

[workspace] $ /bin/sh -xe /tmp/tomcat6-tmp/hudson7048679986651055690.sh
+ whoami
tomcat6
+ cd /home/dev-monster/rfz-repository/debtapp/app
+ lein --version
Leiningen 1.6.1.1 on Java 1.6.0_22 Java HotSpot(TM) 64-Bit Server VM
+ echo ""
""
+ echo /opt/jenkins/tools/1.6.0_22/jre
/opt/jenkins/tools/1.6.0_22/jre
+ echo /opt/jenkins/tools/1.6.0_22
/opt/jenkins/tools/1.6.0_22
+ lein test
Could not load Logmanager "org.apache.juli.ClassLoaderLogManager"
java.lang.ClassNotFoundException: org.apache.juli.ClassLoaderLogManager
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at java.util.logging.LogManager$1.run(LogManager.java:168)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.util.logging.LogManager.<clinit>(LogManager.java:158)
    at java.util.logging.Logger.getLogger(Logger.java:273)
    at sun.awt.AppContext.<clinit>(AppContext.java:114)
    at java.beans.Introspector.getBeanInfo(Introspector.java:157)
    at org.apache.log4j.config.PropertySetter.introspect(PropertySetter.java:76)
    at org.apache.log4j.config.PropertySetter.getPropertyDescriptor(PropertySetter.java:244)
    at org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:156)
    at org.apache.log4j.xml.DOMConfigurator.setParameter(DOMConfigurator.java:973)
    at org.apache.log4j.xml.DOMConfigurator.setParameter(DOMConfigurator.java:618)
    at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:255)
    at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:171)
    at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:184)
    at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:502)
    at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:415)
    at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:919)
    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:790)
    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:696)
    at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:471)
    at org.apache.log4j.LogManager.<clinit>(LogManager.java:125)
    at org.apache.log4j.Logger.getLogger(Logger.java:118)
    at com.mchange.v2.log.log4j.Log4jMLog.getMLogger(Log4jMLog.java:51)
    at com.mchange.v2.log.MLog.getLogger(MLog.java:145)
    at com.mchange.v2.log.MLog.<clinit>(MLog.java:72)
    at com.mchange.v2.naming.JavaBeanReferenceMaker.<clinit>(JavaBeanReferenceMaker.java:39)
    at com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase.<clinit>(PoolBackedDataSourceBase.java:203)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at korma.db$loading__4414__auto__.invoke(db.clj:1)
    at korma.db__init.load(Unknown Source)
    at korma.db__init.<clinit>(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at clojure.lang.RT.loadClassForName(RT.java:1578)
    at clojure.lang.RT.load(RT.java:399)
    at clojure.lang.RT.load(RT.java:381)
    at clojure.core$load$fn__4519.invoke(core.clj:4915)
    at clojure.core$load.doInvoke(core.clj:4914)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:4729)
    at clojure.core$load_lib.doInvoke(core.clj:4766)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:542)
    at clojure.core$load_libs.doInvoke(core.clj:4800)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:542)
    at clojure.core$require.doInvoke(core.clj:4881)
    at clojure.lang.RestFn.invoke(RestFn.java:436)
    at app.db$loading__4414__auto__.invoke(db.clj:6)
    at app.db__init.load(Unknown Source)
    at app.db__init.<clinit>(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at clojure.lang.RT.loadClassForName(RT.java:1578)
    at clojure.lang.RT.load(RT.java:399)
    at clojure.lang.RT.load(RT.java:381)
    at clojure.core$load$fn__4519.invoke(core.clj:4915)
    at clojure.core$load.doInvoke(core.clj:4914)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:4729)
    at clojure.core$load_lib.doInvoke(core.clj:4766)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:542)
    at clojure.core$load_libs.doInvoke(core.clj:4800)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:544)
    at clojure.core$use.doInvoke(core.clj:4892)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at app.models.util$loading__4414__auto__.invoke(util.clj:3)
    at app.models.util__init.load(Unknown Source)
    at app.models.util__init.<clinit>(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at clojure.lang.RT.loadClassForName(RT.java:1578)
    at clojure.lang.RT.load(RT.java:399)
    at clojure.lang.RT.load(RT.java:381)
    at clojure.core$load$fn__4519.invoke(core.clj:4915)
    at clojure.core$load.doInvoke(core.clj:4914)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:4729)
    at clojure.core$load_lib.doInvoke(core.clj:4766)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:542)
    at clojure.core$load_libs.doInvoke(core.clj:4800)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:542)
    at clojure.core$require.doInvoke(core.clj:4881)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at app.core.flow$loading__4414__auto__.invoke(flow.clj:1)
    at app.core.flow__init.load(Unknown Source)
    at app.core.flow__init.<clinit>(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at clojure.lang.RT.loadClassForName(RT.java:1578)
    at clojure.lang.RT.load(RT.java:399)
    at clojure.lang.RT.load(RT.java:381)
    at clojure.core$load$fn__4519.invoke(core.clj:4915)
    at clojure.core$load.doInvoke(core.clj:4914)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:4729)
    at clojure.core$load_lib.doInvoke(core.clj:4766)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:542)
    at clojure.core$load_libs.doInvoke(core.clj:4800)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:542)
    at clojure.core$require.doInvoke(core.clj:4881)
    at clojure.lang.RestFn.invoke(RestFn.java:1789)
    at app.actions.new_years$loading__4414__auto__.invoke(new_years.clj:5)
    at app.actions.new_years__init.load(Unknown Source)
    at app.actions.new_years__init.<clinit>(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at clojure.lang.RT.loadClassForName(RT.java:1578)
    at clojure.lang.RT.load(RT.java:399)
    at clojure.lang.RT.load(RT.java:381)
    at clojure.core$load$fn__4519.invoke(core.clj:4915)
    at clojure.core$load.doInvoke(core.clj:4914)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:4729)
    at clojure.core$load_lib.doInvoke(core.clj:4766)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:542)
    at clojure.core$load_libs.doInvoke(core.clj:4800)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:544)
    at clojure.core$use.doInvoke(core.clj:4892)
    at clojure.lang.RestFn.invoke(RestFn.java:436)
    at app.test.actions.new_years$eval61$loading__4414__auto____62.invoke(new_years.clj:1)
    at app.test.actions.new_years$eval61.invoke(new_years.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:5424)
    at clojure.lang.Compiler.eval(Compiler.java:5415)
    at clojure.lang.Compiler.load(Compiler.java:5857)
    at clojure.lang.RT.loadResourceScript(RT.java:340)
    at clojure.lang.RT.loadResourceScript(RT.java:331)
    at clojure.lang.RT.load(RT.java:409)
    at clojure.lang.RT.load(RT.java:381)
    at clojure.core$load$fn__4519.invoke(core.clj:4915)
    at clojure.core$load.doInvoke(core.clj:4914)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:4729)
    at clojure.core$load_lib.doInvoke(core.clj:4766)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:542)
    at clojure.core$load_libs.doInvoke(core.clj:4800)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:542)
    at clojure.core$require.doInvoke(core.clj:4881)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at user$eval29.invoke(NO_SOURCE_FILE:1)
    at clojure.lang.Compiler.eval(Compiler.java:5424)
    at clojure.lang.Compiler.eval(Compiler.java:5415)
    at clojure.lang.Compiler.eval(Compiler.java:5391)
    at clojure.core$eval.invoke(core.clj:2382)
    at clojure.main$eval_opt.invoke(main.clj:235)
    at clojure.main$initialize.invoke(main.clj:254)
    at clojure.main$null_opt.invoke(main.clj:279)
    at clojure.main$main.doInvoke(main.clj:354)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:369)
    at clojure.lang.AFn.applyToHelper(AFn.java:163)
    at clojure.lang.Var.applyTo(Var.java:482)
    at clojure.main.main(main.java:37)

2 个答案:

答案 0 :(得分:2)

Here is something related。看看他们给出的解决方法是否适用于您的情况。如果您正在使用Gradle,请将其禁用。看看是否有帮助。

答案 1 :(得分:0)

感谢@malenkiy_scot给出的链接,我发现在Jenkins作业/配置构建'执行shell'中取消设置JAVA_OPTS并设置JAVA_HOME解决了这个问题。请注意,我使用lein run而不是lein test

在:

lein run -m some.clojure.app
>> Could not load Logmanager "org.apache.juli.ClassLoaderLogManager"
>> java.lang.ClassNotFoundException: org.apache.juli.ClassLoaderLogManager ...

后:

unset JAVA_OPTS
export JAVA_HOME=/usr/lib/jvm/java-6-sun
lein run -m some.clojure.app
>> [SUCCESS]

设定:

  • Leiningen 1.7
  • Jenkins 1.466.2
  • Ubuntu 10.04.3 LTS
  • 不使用Gradle