-
Notifications
You must be signed in to change notification settings - Fork 172
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
(LoadError) no such file to load -- asciidoctor-diagram (Use after fat Jar deployment) #1286
Comments
That's it, but I see you have |
PS: if this is going to end-up in a Docker image, I strongly suggest using the provided buildpack for it to avoid further classpath issues, see this section in the blog https://spring.io/guides/gs/spring-boot-docker#_build_a_docker_image_with_maven |
Thank you for the hints. But I tried to adapt it my Build plugin like you said and used this instead : I redeployed it as a systemd service and it was running and active , but i get the same error again by calling a pdf generation Api [transaction.id= trace.id= span.id=] ERROR [https-jsse-nio-7083-exec-2] [org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[dispatcherServlet]] - Servlet.ser>vice() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.jruby.exceptions.LoadError: (LoadError) no such file to load -- asciidoctor-diagram] with root cause and the .adoc file is still being created .. |
I was able to reproduce it. The issue is that transitive dependencies need to be added too: <requiresUnpack>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj</artifactId>
</dependency>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj-pdf</artifactId>
</dependency>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj-diagram</artifactId>
</dependency>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj-diagram-plantuml</artifactId>
</dependency>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj-diagram-batik</artifactId>
</dependency>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj-diagram-ditaamini</artifactId>
</dependency>
</requiresUnpack>
</configuration> To be honest, not very easy to manage. If I may, I'd suggest 2 alternatives:
bootJar {
requiresUnpack '**/asciidoctorj-*.jar'
} |
Sorry for the late feedback , i wasn't able to test the solutions on the weekend. |
No problem at all, glad to help. |
Thank you for the heads-up ! I’ll definitely look into upgrading soon :D |
Ive been working on a Spring boot project lately that uses the asciidoctor and keep having this problem so hopefully someone is familiar with it and could say something about it ..
Its a basic projekt to creates different types of reports. Locally using a IDE (ECLIPSE) everything works fine but after the deployment , some problems start to happen. I am using java 17 and Apach Maven 3.9.1 locally .
The project is built into a fat executable Jar which is used for deployment (Linux Ubuntu (Java 17 too)) using these dependencies and build plugins
I double checked after the successful build, that the asciidoctor-diagramm is unpacked and existant (at xxx1.0.0.jar\BOOT-INF\classes\gems\asciidoctor-diagram-2.3.1).
After the deployment , calling an Api to generate a pdf report , I keep getting this error :
[org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[dispatcherServlet]] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.jruby.exceptions.LoadError: (MissingSpecError) Gem::MissingSpecError] with root cause : org.jruby.exceptions.LoadError: (LoadError) no such file to load -- asciidoctor-diagram
(<script>:1)at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1184)
at RUBY.require(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:85)
at RUBY.
I see that the .adoc file for the report gets created but I think the issue happens in the conversion of the adoc file into pdf file.
I found some of other similar issues such as #1263 (comment) , which pointed out that it is a sprinboot handling problem which should be treated by unpacking the related dependencies in the build plugin but somehow i couldn't overpass it ..
The text was updated successfully, but these errors were encountered: