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

Run in OSGi #94

Open
akera-io opened this issue Jul 4, 2023 · 0 comments
Open

Run in OSGi #94

akera-io opened this issue Jul 4, 2023 · 0 comments

Comments

@akera-io
Copy link

akera-io commented Jul 4, 2023

Hi guys, trying to upgrade to latest versions since 1.6.x is quite old already and not going to be maintained anymore. The problem we have is that we use this in an OSGi environment, we're loading all the 'gems' from asciidoctor and asciidoctor-pdf jars by passing the list to the Factory create method. This was/is working fine in 1.6.x version, it stops working since 2.0.x (as I've tried to go down backward trying to find a combination that could work)., the error originates from theme_loader.rb:
org.jruby.exceptions.SystemCallError: (ENOTDIR) Not a directory - uri:classloader:/gems/asciidoctor-pdf-2.3.7/data/themes at org.jruby.RubyDir.initialize(org/jruby/RubyDir.java:146) at org.jruby.RubyClass.new(org/jruby/RubyClass.java:917) at org.jruby.RubyDir.children(org/jruby/RubyDir.java:488) at org.jruby.RubyDir.children(org/jruby/RubyDir.java:483) at RUBY.<class:ThemeLoader>(uri:classloader:/gems/asciidoctor-pdf-2.3.7/lib/asciidoctor/pdf/theme_loader.rb:16) at RUBY.<module:PDF>(uri:classloader:/gems/asciidoctor-pdf-2.3.7/lib/asciidoctor/pdf/theme_loader.rb:8) at RUBY.<module:Asciidoctor>(uri:classloader:/gems/asciidoctor-pdf-2.3.7/lib/asciidoctor/pdf/theme_loader.rb:7) at RUBY.<main>(uri:classloader:/gems/asciidoctor-pdf-2.3.7/lib/asciidoctor/pdf/theme_loader.rb:6) at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1057) at org.jruby.RubyKernel.require_relative(org/jruby/RubyKernel.java:1084) at RUBY.<main>(uri:classloader:/gems/asciidoctor-pdf-2.3.7/lib/asciidoctor/pdf.rb:15) at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1057) at org.jruby.RubyKernel.require_relative(org/jruby/RubyKernel.java:1084) at RUBY.<main>(uri:classloader:/gems/asciidoctor-pdf-2.3.7/lib/asciidoctor-pdf.rb:3)

Trying to debug this one when the script tries to load the themes the themes folder resolves to uri:classloader:/gems/asciidoctor-pdf-2.3.7/data/themes which looks fine imho. However this doesn't load anything under it so it looks like is not a folder, hence the exception :(

The difference being in 2.x version the theme loaded tries to get all bundled themes (BundledThemeNames = (::Dir.children ThemesDir).map {|it| it.slice 0, it.length - 10 }), and this fails - maybe a .jrubydir flag-file could solve this issue? The listClassLoaderFiles method in URIResource does look for it. Otherwise the bundle class loader can't resolve gems/asciidoctor-pdf-2.3.7/data/themes. Anything that we might need to change to make it work, is this still possible to run in an OSGi environment?

Thanks

@mojavelinux mojavelinux transferred this issue from asciidoctor/asciidoctor-pdf Jul 4, 2023
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

1 participant