[ https://issues.apache.org/jira/browse/FOP-3054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17493323#comment-17493323 ]
Erik Billerby commented on FOP-3054: ------------------------------------ Also ran into this issue when forced to update due to a pdfbox vulnerability. This commit seems like the prime suspect, however its really hard for me to track down what made resource lookup by classpath fail. [https://svn.apache.org/viewvc?view=revision&revision=1885366] Adding a test case that demonstrates the error should be easy though. > FOP Font "embed-url" No Longer Supports "classpath" Protocol in version 2.7 > --------------------------------------------------------------------------- > > Key: FOP-3054 > URL: https://issues.apache.org/jira/browse/FOP-3054 > Project: FOP > Issue Type: Bug > Affects Versions: 2.7 > Reporter: tntim96 > Priority: Major > > The following FOP config works with FOP 2.6 > {code:java} > <?xml version="1.0" encoding="utf-8" ?> > <fop> > <renderers> > <renderer mime="application/pdf"> > <fonts> > <font kerning="yes" > embed-url="classpath:/somepath/DejaVuSans-Regular.ttf"> > <font-triplet name="DejaVuSans" style="normal" weight="normal"/> > </font> > </fonts> > </renderer> > </renderers> > </fop> {code} > ...but with 2.7 we get the error: > {noformat} > 16:04:03.006 [main] ERROR org.apache.fop.fonts.LazyFont - Failed to read font > file classpath:/somepath/DejaVuSans-Regular.ttf unknown protocol: classpath > java.net.MalformedURLException: unknown protocol: classpath > at java.net.URL.<init>(URL.java:600) > at java.net.URL.<init>(URL.java:490) > at java.net.URL.<init>(URL.java:439) > at java.net.URI.toURL(URI.java:1089) > at > org.apache.fop.apps.io.ResourceResolverFactory$NormalResourceResolver.getResource(ResourceResolverFactory.java:224) > at > org.apache.fop.apps.io.ResourceResolverFactory$TempAwareResourceResolver.getResource(ResourceResolverFactory.java:152) > at > org.apache.fop.apps.io.ResourceResolverFactory$DefaultResourceResolver.getResource(ResourceResolverFactory.java:121) > at > org.apache.fop.apps.io.InternalResourceResolver.getResource(InternalResourceResolver.java:92) > at org.apache.fop.fonts.truetype.OFFontLoader.read(OFFontLoader.java:113) > at org.apache.fop.fonts.truetype.OFFontLoader.read(OFFontLoader.java:103) > at org.apache.fop.fonts.FontLoader.getFont(FontLoader.java:126) > at org.apache.fop.fonts.FontLoader.loadFont(FontLoader.java:110) > at org.apache.fop.fonts.LazyFont.load(LazyFont.java:121) > at org.apache.fop.fonts.LazyFont.getAscender(LazyFont.java:237) > at org.apache.fop.fonts.Font.getAscender(Font.java:120) > at > org.apache.fop.layoutmgr.BlockLayoutManager.initialize(BlockLayoutManager.java:82) > at > org.apache.fop.layoutmgr.AbstractLayoutManager.getChildLM(AbstractLayoutManager.java:118) > at > org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:128) > at > org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:69) > at > org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:252) > at > org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:675) > {noformat} -- This message was sent by Atlassian Jira (v8.20.1#820001)