Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in 2.1.0: Asciidoctor.Factory.create() produces a "java.util.ServiceConfigurationError" #832

Closed
allentiak opened this issue Jul 17, 2019 · 5 comments

Comments

@allentiak
Copy link

(Caveat alert: the project in which I am testing this is written in Clojure 1.10.1.)

The following invocation of Asciidoctor.Factory.create() produces a "java.util.ServiceConfigurationError" with 2.1.0. It works fine with 2.0.0.

(ns io.perun.asciidoctor
  (:require [io.perun.core :as perun]
            [clojure.java.io :as io])
  (:import [org.asciidoctor Asciidoctor Asciidoctor$Factory]))

(def container
  (Asciidoctor$Factory/create)) ;; this line fails

With 2.0.0, I have no problems.
When using 2.1.0, I get the following error:

java.util.ServiceConfigurationError: org.asciidoctor.Asciidoctor: Provider org.asciidoctor.jruby.internal.JRubyAsciidoctor could not be instantiated

You can reproduce this error by trying hashobject/perun@0fa675a

BTW: If a release is not stable yet (as 2.1.0 claims to be), I would really suggest that you please mark it as a beta on Maven Central, and as a "pre-release" on GitHub. You will gain the appreciation of many users of your library, and avoid a lot of complains about the release. Thanks!

@allentiak
Copy link
Author

Check hashobject/perun#232

@allentiak
Copy link
Author

allentiak commented Jul 17, 2019

Full error log for boot runtests. Please note the JRuby-related error message at the bottom.

                                              java.lang.Thread.run                             Thread.java:  835
                java.util.concurrent.ThreadPoolExecutor$Worker.run                 ThreadPoolExecutor.java:  628
                 java.util.concurrent.ThreadPoolExecutor.runWorker                 ThreadPoolExecutor.java: 1128
                               java.util.concurrent.FutureTask.run                         FutureTask.java:  264
                                                               ...                                              
                               clojure.core/binding-conveyor-fn/fn                                core.clj: 2030
                                                 boot.core/boot/fn                                core.clj: 1031
                                               boot.core/run-tasks                                core.clj: 1022
                                       boot.test/eval5729/fn/fn/fn                                test.clj:   93
                                       boot.test/eval5654/fn/fn/fn                                test.clj:   81
                                       boot.test/eval5690/fn/fn/fn                                test.clj:   85
                                   io.perun-test/eval7241/fn/fn/fn                          perun_test.clj:  483
                                   io.perun-test/eval6968/fn/fn/fn                          perun_test.clj:  142
                                       io.perun/content-task/fn/fn                               perun.clj:  274 (repeats 2 times)
                                   io.perun-test/eval6708/fn/fn/fn                          perun_test.clj:   57
                                   io.perun-test/eval6968/fn/fn/fn                          perun_test.clj:  142
                                       io.perun/content-task/fn/fn                               perun.clj:  274
                                       io.perun/content-task/fn/fn                               perun.clj:  239
                                    io.perun/content-task/fn/fn/fn                               perun.clj:  239
                                                  clojure.core/seq                                core.clj:  137
                                                               ...                                              
                                               clojure.core/map/fn                                core.clj: 2746
                                                  clojure.core/seq                                core.clj:  137
                                                               ...                                              
                                    io.perun/render-in-pod/iter/fn                               perun.clj:  156
                                                 boot.pod/eval-in*                                 pod.clj:  471
                                                               ...                                              
          jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke       DelegatingMethodAccessorImpl.java:   43
              jdk.internal.reflect.NativeMethodAccessorImpl.invoke           NativeMethodAccessorImpl.java:   62
             jdk.internal.reflect.NativeMethodAccessorImpl.invoke0            NativeMethodAccessorImpl.java     
       org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke             ClojureRuntimeShimImpl.java:   97
       org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke             ClojureRuntimeShimImpl.java:  104
                                                               ...                                              
                                                 boot.pod/eval-in*                                 pod.clj:  468
                                                 clojure.core/eval                                core.clj: 3214
                                                               ...                                              
                                               pod$eval1361.invoke                           NO_SOURCE_FILE     
                                         pod$eval1361.invokeStatic                           NO_SOURCE_FILE     
                                                               ...                                              
                                              clojure.core/require                                core.clj: 6007 (repeats 2 times)
                                                clojure.core/apply                                core.clj:  667
                                                               ...                                              
                                            clojure.core/load-libs                                core.clj: 5969
                                            clojure.core/load-libs                                core.clj: 5985
                                                clojure.core/apply                                core.clj:  667
                                                               ...                                              
                                             clojure.core/load-lib                                core.clj: 5928
                                             clojure.core/load-lib                                core.clj: 5947
                                          clojure.core/load-lib/fn                                core.clj: 5948
                                             clojure.core/load-one                                core.clj: 5908
                                                               ...                                              
                                                 clojure.core/load                                core.clj: 6109
                                                 clojure.core/load                                core.clj: 6125
                                              clojure.core/load/fn                                core.clj: 6126
                                                               ...                                              
          jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke       DelegatingMethodAccessorImpl.java:   43
              jdk.internal.reflect.NativeMethodAccessorImpl.invoke           NativeMethodAccessorImpl.java:   62
             jdk.internal.reflect.NativeMethodAccessorImpl.invoke0            NativeMethodAccessorImpl.java     
                        org.asciidoctor.Asciidoctor$Factory.create                        Asciidoctor.java:  485
                                    java.util.ServiceLoader$3.next                      ServiceLoader.java: 1395
                          java.util.ServiceLoader$ProviderImpl.get                      ServiceLoader.java:  723
                  java.util.ServiceLoader$ProviderImpl.newInstance                      ServiceLoader.java:  781
                                                               ...                                              
jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance  DelegatingConstructorAccessorImpl.java:   45
    jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance      NativeConstructorAccessorImpl.java:   62
   jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0       NativeConstructorAccessorImpl.java     
            org.asciidoctor.jruby.internal.JRubyAsciidoctor.<init>                   JRubyAsciidoctor.java:   52
 org.asciidoctor.jruby.internal.JRubyAsciidoctor.createRubyRuntime                   JRubyAsciidoctor.java:  132
                   org.jruby.javasupport.JavaEmbedUtils.initialize                     JavaEmbedUtils.java:   79
                                        org.jruby.Ruby.newInstance                               Ruby.java:  370
                                               org.jruby.Ruby.init                               Ruby.java: 1239
                                          org.jruby.Ruby.bootstrap                               Ruby.java: 1342
                                           org.jruby.Ruby.initCore                               Ruby.java: 1572
                                org.jruby.RubyFile.createFileClass                           RubyFile.java:  199
             java.lang.NoSuchFieldError: O_TMPFILE
    java.util.ServiceConfigurationError: org.asciidoctor.Asciidoctor: Provider org.asciidoctor.jruby.internal.JRubyAsciidoctor could not be instantiated
clojure.lang.Compiler$CompilerException: Syntax error macroexpanding at (asciidoctor.clj:7:3).
    data: {#object[clojure.lang.Keyword 0x3339b482 ":clojure.error/phase"] #object[clojure.lang.Keyword 0x49290ff8 ":execution"], #object[clojure.lang.Keyword 0x2c94d553 ":clojure.error/line"] 7, #object[clojure.lang.Keyword 0x79216e34 ":clojure.error/column"] 3, #object[clojure.lang.Keyword 0x1f8ca2bf ":clojure.error/source"] "asciidoctor.clj"}
             clojure.lang.ExceptionInfo: Syntax error macroexpanding at (asciidoctor.clj:7:3).
    line: 64

@robertpanzer
Copy link
Member

Thank you for your issue.
Of course it's always possible that errors slip through, that's unavoidable even though we do our best in the time that we can spend.

I am not able to reproduce your issue though.
I created this project that demonstrates that the call to org.asciidoctor.Asciidoctor.Factory.create() works and returns an instance that is able to convert documents: https://github.com/robertpanzer/asciidoctorjfactorytest
Can you please create a small reproducer that shows the problem?

@allentiak
Copy link
Author

allentiak commented Jul 17, 2019 via email

@robertpanzer
Copy link
Member

Please reopen the ticket when you can provide a reproducer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants