我使用 Clojure 和 Luminus Web 框架创建了一个微服务 PoC,并通过lein uberwar打包成一个 WAR 。
它已经过测试,可以在Immutant和Tomcat服务器中正确部署和运行。我们的生产环境是Oracle Weblogic 12c。为了避免一些错误,我在战争中创建了一个weblogic.xml文件,内容如下:
<?xml version='1.0' encoding='UTF-8'?>
<weblogic-web-app
xmlns="http://www.bea.com/ns/weblogic/90"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
<container-descriptor>
<filter-dispatched-requests-enabled>false</filter-dispatched-requests-enabled>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
但是我得到这个内部错误,好像服务器不会检测到应用程序的入口点。
<Nov 10, 2016 9:25:57 AM UTC> <Warning> <HTTP> <BEA-101162> <User defined listener mu_publisher.listener failed: java.lang.RuntimeException: could not start [#'mu-publisher.handler/init-app] due to.
java.lang.RuntimeException: could not start [#'mu-publisher.handler/init-app] due to
at mount.core$up$fn__4349.invoke(core.cljc:92)
at mount.core$up.invokeStatic(core.cljc:92)
at mount.core$up.invoke(core.cljc:90)
at mount.core$bring.invokeStatic(core.cljc:206)
at mount.core$bring.invoke(core.cljc:198)
Truncated. see log file for complete stacktrace
Caused By: java.lang.IllegalArgumentException: No implementation of method: :enabled? of protocol: #'clojure.tools.logging.impl/Logger found for class: org.slf4j.impl.JDK14LoggerAdapter
at clojure.core$_cache_protocol_fn.invokeStatic(core_deftype.clj:568)
at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:560)
at clojure.tools.logging.impl$fn__51$G__44__58.invoke(impl.clj:16)
at mu_publisher.env$fn__225.invokeStatic(env.clj:7)
at mu_publisher.env$fn__225.invoke(env.clj:6)
Truncated. see log file for complete stacktrace