2016-11-08 189 views
0

在Spring引导应用程序中使用以下库创建ascii doc文件的pdf文件时,出现异常。从Asciidoctor创建PDF文件时出现异常

org.asciidoctor:asciidoctorj:1.6.0-alpha.3 
org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.11 
org.asciidoctor:asciidoctorj-epub3:1.5.0-alpha.6 

我发现了类似的问题,以前通过设置类加载器尝试过,但没有成功。

显示的例外是

org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- asciidoctor 
     at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:944) ~[jruby-core-9.1.2.0.jar!/:?] 
     at RUBY.require(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:55) ~[?:?] 
     at RUBY.<top>(<script>:9) ~[?:?] 

我的代码看起来是这样的。路径是ascii doc存储的目录。

final Asciidoctor asciidoctor = create(); 
asciidoctor.renderDirectory(new AsciiDocDirectoryWalker(path), options().backend("pdf").get()); 
asciidoctor.shutdown(); 
+0

有什么例外?请提一下。 –

+0

欢迎来到Stack Overflow!为了给你一个很好的答案,如果你有一个[问],如果你还没有看过,它可能会帮助我们。如果你可以提供[mcve],它可能也很有用。 – Mat

回答

1

我已经从Spring引导团队获得了解决方案。请参阅Spring引导Github issue了解更多详情