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

fop config -> issue resolving fonts via embed-url #952

Closed
windauer opened this issue Mar 23, 2016 · 5 comments
Closed

fop config -> issue resolving fonts via embed-url #952

windauer opened this issue Mar 23, 2016 · 5 comments
Assignees
Labels
bug issue confirmed as bug
Milestone

Comments

@windauer
Copy link
Member

As described in #938 I tried to adjust the fop config for the tei-simple-pm app (https://github.com/wolfgangmm/tei-simple-pm).

I changed the fop config in fo.xql (https://github.com/wolfgangmm/tei-simple-pm/blob/master/modules/fo.xql) as follows:

  • removed base from the config
  • changed <font embed-url="Junicode.ttf" ../> to "

This results in the following error: javax.servlet.ServletException: An error occurred: URI scheme is not "file".

Am I doing something wrong? I tried various combinations as embed-url, with and without port 8080, http as url scheme, but nothing worked.

@windauer windauer added the bug issue confirmed as bug label Mar 23, 2016
@windauer windauer added this to the eXist-3.0 milestone Mar 23, 2016
@dizzzz
Copy link
Member

dizzzz commented Mar 25, 2016

do you have a longer trace?

@adamretter
Copy link
Member

@windauer Can you push your changes to tei-simple-pm to your fork and let me know where it is so I can test?

@windauer
Copy link
Member Author

simply try to render a pdf in https://github.com/wolfgangmm/tei-simple-pm (fop font config in fo.xql breaks pdf rendering)

@adamretter adamretter self-assigned this Apr 14, 2016
@adamretter
Copy link
Member

@windauer Using the latest code from https://github.com/wolfgangmm/tei-simple-pm I get a different error (to the one you reported):

Problem accessing /exist/apps/tei-simple/modules/fo.xql. Reason:

    Server Error
Caused by:

javax.servlet.ServletException: An error occurred: java.io.IOException: Resource /db/Junicode.ttf not found in database.
    at org.exist.http.servlets.EXistServlet.doGet(EXistServlet.java:263)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:575)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:229)
    at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:103)
    at org.exist.http.urlrewrite.Forward.doRewrite(Forward.java:50)
    at org.exist.http.urlrewrite.XQueryURLRewrite.doRewrite(XQueryURLRewrite.java:549)
    at org.exist.http.urlrewrite.XQueryURLRewrite.service(XQueryURLRewrite.java:353)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1496)
    at de.betterform.agent.web.filter.XFormsFilter.doFilter(XFormsFilter.java:171)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1476)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:370)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
    at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: java.io.IOException: Resource /db/Junicode.ttf not found in database.
    at org.apache.fop.fonts.LazyFont.load(LazyFont.java:130)
    at org.apache.fop.fonts.LazyFont.getAscender(LazyFont.java:233)
    at org.apache.fop.fonts.Font.getAscender(Font.java:118)
    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.BreakOpportunityHelper.getBreakBefore(BreakOpportunityHelper.java:45)
    at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getBreakBefore(BlockStackingLayoutManager.java:1065)
    at org.apache.fop.layoutmgr.BlockStackingLayoutManager.addKnuthElementsForBreakBefore(BlockStackingLayoutManager.java:1043)
    at org.apache.fop.layoutmgr.BlockStackingLayoutManager.breakBeforeServed(BlockStackingLayoutManager.java:444)
    at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:254)
    at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:113)
    at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:105)
    at org.apache.fop.layoutmgr.FlowLayoutManager.getNextChildElements(FlowLayoutManager.java:223)
    at org.apache.fop.layoutmgr.FlowLayoutManager.addChildElements(FlowLayoutManager.java:147)
    at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:116)
    at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:69)
    at org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:254)
    at org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:752)
    at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:180)
    at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:160)
    at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:388)
    at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:114)
    at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:138)
    at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:267)
    at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:130)
    at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:360)
    at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:190)
    at org.exist.util.serializer.ReceiverToSAX.endElement(ReceiverToSAX.java:123)
    at org.exist.storage.serializers.XIncludeFilter.endElement(XIncludeFilter.java:190)
    at org.exist.dom.memtree.DocumentImpl.endNode(DocumentImpl.java:1259)
    at org.exist.dom.memtree.DocumentImpl.streamTo(DocumentImpl.java:1183)
    at org.exist.dom.memtree.NodeImpl.streamTo(NodeImpl.java:673)
    at org.exist.storage.serializers.Serializer.serializeToReceiver(Serializer.java:1089)
    at org.exist.storage.serializers.Serializer.serializeToReceiver(Serializer.java:1080)
    at org.exist.storage.serializers.Serializer.toSAX(Serializer.java:871)
    at org.exist.dom.memtree.NodeImpl.toSAX(NodeImpl.java:659)
    at org.exist.xquery.modules.xslfo.RenderFunction.eval(RenderFunction.java:143)

@adamretter
Copy link
Member

adamretter commented Apr 16, 2016

@windauer I also submitted a PR to https://github.com/wolfgangmm/tei-simple-pm to fix the XQuery code to correctly resolve the font paths - wolfgangmm/tei-simple-pm#23

For the moment we have to disable font caching until the Apache project accept my patch - See also - https://issues.apache.org/jira/browse/FOP-2601. However with font caching disabled it does all work as it should on eXist with FOP 2.1 once you have #977

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

No branches or pull requests

3 participants