Giter Site home page Giter Site logo

Comments (12)

andrzej-talarek avatar andrzej-talarek commented on May 29, 2024 1

Confirmed, works perfectly again :-). Great thanks @asolntsev !

from flyingsaucer.

asolntsev avatar asolntsev commented on May 29, 2024

@lowcasz Did it ever work? Do you mean that FlyingSaucer did load resources from classpath, and this feature was broken with some release? Or it never really worked, and you just wish such a feature?

from flyingsaucer.

lowcasz avatar lowcasz commented on May 29, 2024

It was worked on my other project.
HTML is copied from old project for test, it was work there.
I don't see any other configuration and configuration classes between them.
In old project is older version of saucer. (9.1.22)

from flyingsaucer.

pbrant avatar pbrant commented on May 29, 2024

from flyingsaucer.

lowcasz avatar lowcasz commented on May 29, 2024

I don't know, maybe...
Do you know any dependency, especially spring dependency which can do it in background?
It can helps me to find it, I don't see any additional parameters, configuration or classes which do it.

from flyingsaucer.

pbrant avatar pbrant commented on May 29, 2024

from flyingsaucer.

asolntsev avatar asolntsev commented on May 29, 2024

@lowcasz implemented in #241, released version 9.3.2 today.

from flyingsaucer.

andrzej-talarek avatar andrzej-talarek commented on May 29, 2024

Funny thing, but in my case it worked perfectly fine (classpath:/static/css/custom.css) in 9.3.1 version and broke with 9.3.2 :(. It's broken both for bootJar task, that I'm using for system development usually and normal building jar for running it with java -jar. Can't upgrade.

2023-12-31 06:18:15.880 ERROR -  o.a.j.l.DirectJDKLog : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: java.lang.NullPointerException: Cannot invoke "java.net.URL.toString()" because "resource" is null] with root cause
java.lang.NullPointerException: Cannot invoke "java.net.URL.toString()" because "resource" is null
	at org.xhtmlrenderer.swing.NaiveUserAgent.resolveURI(NaiveUserAgent.java:370)
	at org.xhtmlrenderer.context.StyleReference.getStylesheets(StyleReference.java:224)
	at org.xhtmlrenderer.context.StyleReference.setDocumentContext(StyleReference.java:85)
	at org.xhtmlrenderer.pdf.ITextRenderer.setDocument(ITextRenderer.java:183)
	at org.xhtmlrenderer.pdf.ITextRenderer.setDocument(ITextRenderer.java:144)
	at org.xhtmlrenderer.pdf.ITextRenderer.setDocumentFromString(ITextRenderer.java:167)
	at org.xhtmlrenderer.pdf.ITextRenderer.setDocumentFromString(ITextRenderer.java:160)

from flyingsaucer.

asolntsev avatar asolntsev commented on May 29, 2024

@andrzej-talarek Thank you for the feedback.
First of all, I assume that FS 9.3.1 didn't really load custom.css file, but just silently ignored it.
And FS 9.3.2 started searching this file in classpath and complaining if the file cannot be found.

Are you sure you have folder static in the classpath?

If yes, how can I reproduce the problem? Could you create a simple reproducible example?

from flyingsaucer.

andrzej-talarek avatar andrzej-talarek commented on May 29, 2024

I'm 100% sure it worked fine - I've used several included styles (custom ones and bootstrap styles) and I know styles worked OK then (looking at final pdf).
Since it's spring-boot app, I'm not sure it would be that easy, but I can try to prepare a repo with as little code as it only requires.

from flyingsaucer.

pbrant avatar pbrant commented on May 29, 2024

@andrzej-talarek This should be fixed in #250.

from flyingsaucer.

asolntsev avatar asolntsev commented on May 29, 2024

@andrzej-talarek The fix #250 has been released as FlyingSaucer 9.4.1
Can you please check if it helps?

from flyingsaucer.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.