Asciidoctorj 不适用于 WildFly 8.2。0.Final
Asciidoctorj doesn't work on WildFly 8.2.0.Final
我按照此文档的说明操作,但它不起作用。
http://asciidoctor.org/docs/asciidoctorj/#running-asciidoctorj-on-wildfly-as
首先,我使用 jboss-cli:
将 Asciidoctorj 模块安装到 WildFly 中
module add \
--name=org.asciidoctor \
--resources=/tmp/asciidoctorj-1.5.2.jar,/tmp/jcommander-1.35.jar,/tmp/jruby-complete-1.7.16.1.jar \
--resource-delimiter=, \
--dependencies=javax.management.j2ee.api,javax.api
然后我部署了一个简单的 WAR,其中包含一个调用 Asciidoctor.Factory.create()
的 servlet。我还检查它确实包含 MANIFEST.MF
中的 Dependencies: org.asciidoctor
。 whole project is available in my GitHub repo.
但是没用。怎么了?有人让 Asciidoctorj 在 WildFly 上工作吗?
我的环境是:
- WildFly 8.2.0.Final
- Asciidoctorj 1.5.2
- 甲骨文 JDK8u20
这是堆栈跟踪:
2015-01-12 23:23:06,764 ERROR [io.undertow.request] (default task-3) UT005023: Exception handling request to /asciidoctortest-1.0-SNAPSHOT/: java.lang.NoClassDefFoundError: Could not initialize class org.asciidoctor.internal.JRubyAsciidoctor
at org.asciidoctor.Asciidoctor$Factory.create(Asciidoctor.java:647) [asciidoctorj-1.5.2.jar:1.5.2]
at asciidoctortest.MyServlet.doGet(MyServlet.java:17) [classes:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.access[=12=]0(ServletInitialHandler.java:76) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.handleRequest(ServletInitialHandler.java:166) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:197) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.HttpServerExchange.run(HttpServerExchange.java:759) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_20]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_20]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_20]
我错过了前面的堆栈跟踪,但我从中找到了解决方案。似乎缺少一些依赖项。我也很奇怪 java.lang.NoClassDefFoundError: sun/misc/Unsafe
但我在 this conversation 之后也解决了它。现在我的 module.xml 是:
<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.1" name="org.asciidoctor">
<resources>
<resource-root path="asciidoctorj-1.5.2.jar"/>
<resource-root path="jcommander-1.35.jar"/>
<resource-root path="jruby-complete-1.7.16.1.jar"/>
</resources>
<dependencies>
<module name="sun.jdk" export="true" >
<imports>
<include path="sun/misc/Unsafe" />
</imports>
</module>
<module name="javax.management.j2ee.api"/>
<module name="javax.api"/>
<module name="org.slf4j"/>
</dependencies>
</module>
我创建了一个名为 asciidoctor-wildfly-docker 的新 github 项目,以验证 运行 Asciidoctor 到 WildFly 所需的配置。
该项目使您可以在 Docker 容器中执行测试,并验证 Asciidoctor 是否可以将 AsciiDoc 内容转换为 HTML 和 PDF 输出。
我很乐意收到您的反馈:
https://github.com/mgreau/asciidoctor-wildfly-docker
马克西姆
我按照此文档的说明操作,但它不起作用。
http://asciidoctor.org/docs/asciidoctorj/#running-asciidoctorj-on-wildfly-as
首先,我使用 jboss-cli:
将 Asciidoctorj 模块安装到 WildFly 中module add \
--name=org.asciidoctor \
--resources=/tmp/asciidoctorj-1.5.2.jar,/tmp/jcommander-1.35.jar,/tmp/jruby-complete-1.7.16.1.jar \
--resource-delimiter=, \
--dependencies=javax.management.j2ee.api,javax.api
然后我部署了一个简单的 WAR,其中包含一个调用 Asciidoctor.Factory.create()
的 servlet。我还检查它确实包含 MANIFEST.MF
中的 Dependencies: org.asciidoctor
。 whole project is available in my GitHub repo.
但是没用。怎么了?有人让 Asciidoctorj 在 WildFly 上工作吗?
我的环境是:
- WildFly 8.2.0.Final
- Asciidoctorj 1.5.2
- 甲骨文 JDK8u20
这是堆栈跟踪:
2015-01-12 23:23:06,764 ERROR [io.undertow.request] (default task-3) UT005023: Exception handling request to /asciidoctortest-1.0-SNAPSHOT/: java.lang.NoClassDefFoundError: Could not initialize class org.asciidoctor.internal.JRubyAsciidoctor
at org.asciidoctor.Asciidoctor$Factory.create(Asciidoctor.java:647) [asciidoctorj-1.5.2.jar:1.5.2]
at asciidoctortest.MyServlet.doGet(MyServlet.java:17) [classes:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.access[=12=]0(ServletInitialHandler.java:76) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.handleRequest(ServletInitialHandler.java:166) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:197) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.HttpServerExchange.run(HttpServerExchange.java:759) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_20]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_20]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_20]
我错过了前面的堆栈跟踪,但我从中找到了解决方案。似乎缺少一些依赖项。我也很奇怪 java.lang.NoClassDefFoundError: sun/misc/Unsafe
但我在 this conversation 之后也解决了它。现在我的 module.xml 是:
<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.1" name="org.asciidoctor">
<resources>
<resource-root path="asciidoctorj-1.5.2.jar"/>
<resource-root path="jcommander-1.35.jar"/>
<resource-root path="jruby-complete-1.7.16.1.jar"/>
</resources>
<dependencies>
<module name="sun.jdk" export="true" >
<imports>
<include path="sun/misc/Unsafe" />
</imports>
</module>
<module name="javax.management.j2ee.api"/>
<module name="javax.api"/>
<module name="org.slf4j"/>
</dependencies>
</module>
我创建了一个名为 asciidoctor-wildfly-docker 的新 github 项目,以验证 运行 Asciidoctor 到 WildFly 所需的配置。 该项目使您可以在 Docker 容器中执行测试,并验证 Asciidoctor 是否可以将 AsciiDoc 内容转换为 HTML 和 PDF 输出。
我很乐意收到您的反馈: https://github.com/mgreau/asciidoctor-wildfly-docker
马克西姆