除了question about commercial processors,我想测试最新版本的Apache FOP。但是,我根据this article尝试这样做时遇到了问题。
有些部分在eXist的最后一个开发版本中有所不同,但我认为总体思路应该有效。
我有:
# XSL FO transformations (Uses Apache FOP)
include.module.xslfo = true
include.module.xslfo.url = http://apache.cs.uu.nl/xmlgraphics/fop/binaries/fop-1.1-bin.zip
更改为:
# XSL FO transformations (Uses Apache FOP)
include.module.xslfo = true
include.module.xslfo.url = http://apache.cs.uu.nl/xmlgraphics/fop/binaries/fop-2.1-bin.zip
我从fop.jar
删除了旧的$EXIST_HOME/extensions/modules/libs/
文件。
完成这些步骤后,我运行了build.sh
。奇怪的是它似乎没有下载新的包(我无法在build.sh
进程的日志中跟踪它。但是,在$EXIST_HOME/extensions/modules/libs/
中有新的fop.jar
存在(不确定是什么版本)。
至于$EXIST_HOME/extensions/modules/build.xml
,这与我提到的原始文章大不相同。没有关于所用FOP版本的具体信息。
启动应用程序并尝试生成pdf后,我从Jetty收到此错误:
HTTP ERROR 500
Problem accessing /exist/apps/karolinum-x/modules/create-ebook.xq. Reason:
Server Error
Caused by:
javax.servlet.ServletException: An error occurred: org.apache.fop.apps.FopFactory.newInstance()Lorg/apache/fop/apps/FopFactory;
at org.exist.http.servlets.EXistServlet.doGet(EXistServlet.java:237)
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:557)
at org.exist.http.urlrewrite.XQueryURLRewrite.service(XQueryURLRewrite.java:357)
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.NoSuchMethodError: org.apache.fop.apps.FopFactory.newInstance()Lorg/apache/fop/apps/FopFactory;
at org.exist.xquery.modules.xslfo.ApacheFopProcessorAdapter.<init>(ApacheFopProcessorAdapter.java:25)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.exist.xquery.modules.xslfo.XSLFOModule.getProcessorAdapter(XSLFOModule.java:85)
at org.exist.xquery.modules.xslfo.RenderFunction.eval(RenderFunction.java:135)
at org.exist.xquery.BasicFunction.eval(BasicFunction.java:70)
at org.exist.xquery.InternalFunctionCall.eval(InternalFunctionCall.java:56)
at org.exist.xquery.ConditionalExpression.eval(ConditionalExpression.java:100)
at org.exist.xquery.LetExpr.eval(LetExpr.java:142)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.BindingExpression.eval(BindingExpression.java:165)
at org.exist.xquery.UserDefinedFunction.eval(UserDefinedFunction.java:155)
at org.exist.xquery.DynamicCardinalityCheck.eval(DynamicCardinalityCheck.java:74)
at org.exist.xquery.Atomize.eval(Atomize.java:67)
at org.exist.xquery.DynamicTypeCheck.eval(DynamicTypeCheck.java:61)
at org.exist.xquery.FunctionCall.evalFunction(FunctionCall.java:330)
at org.exist.xquery.FunctionCall.eval(FunctionCall.java:234)
at org.exist.xquery.LetExpr.eval(LetExpr.java:142)
at org.exist.xquery.BindingExpression.eval(BindingExpression.java:165)
at org.exist.xquery.ConditionalExpression.eval(ConditionalExpression.java:100)
at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:58)
at org.exist.xquery.ConditionalExpression.eval(ConditionalExpression.java:102)
at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:58)
at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:65)
at org.exist.xquery.LetExpr.eval(LetExpr.java:189)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.BindingExpression.eval(BindingExpression.java:165)
at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71)
at org.exist.xquery.PathExpr.eval(PathExpr.java:267)
at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71)
at org.exist.xquery.XQuery.execute(XQuery.java:280)
at org.exist.xquery.XQuery.execute(XQuery.java:200)
at org.exist.http.RESTServer.executeXQuery(RESTServer.java:1498)
at org.exist.http.RESTServer.doGet(RESTServer.java:509)
at org.exist.http.servlets.EXistServlet.doGet(EXistServlet.java:204)
... 45 more
Caused by:
java.lang.NoSuchMethodError: org.apache.fop.apps.FopFactory.newInstance()Lorg/apache/fop/apps/FopFactory;
at org.exist.xquery.modules.xslfo.ApacheFopProcessorAdapter.<init>(ApacheFopProcessorAdapter.java:25)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.exist.xquery.modules.xslfo.XSLFOModule.getProcessorAdapter(XSLFOModule.java:85)
at org.exist.xquery.modules.xslfo.RenderFunction.eval(RenderFunction.java:135)
at org.exist.xquery.BasicFunction.eval(BasicFunction.java:70)
at org.exist.xquery.InternalFunctionCall.eval(InternalFunctionCall.java:56)
at org.exist.xquery.ConditionalExpression.eval(ConditionalExpression.java:100)
at org.exist.xquery.LetExpr.eval(LetExpr.java:142)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.BindingExpression.eval(BindingExpression.java:165)
at org.exist.xquery.UserDefinedFunction.eval(UserDefinedFunction.java:155)
at org.exist.xquery.DynamicCardinalityCheck.eval(DynamicCardinalityCheck.java:74)
at org.exist.xquery.Atomize.eval(Atomize.java:67)
at org.exist.xquery.DynamicTypeCheck.eval(DynamicTypeCheck.java:61)
at org.exist.xquery.FunctionCall.evalFunction(FunctionCall.java:330)
at org.exist.xquery.FunctionCall.eval(FunctionCall.java:234)
at org.exist.xquery.LetExpr.eval(LetExpr.java:142)
at org.exist.xquery.BindingExpression.eval(BindingExpression.java:165)
at org.exist.xquery.ConditionalExpression.eval(ConditionalExpression.java:100)
at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:58)
at org.exist.xquery.ConditionalExpression.eval(ConditionalExpression.java:102)
at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:58)
at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:65)
at org.exist.xquery.LetExpr.eval(LetExpr.java:189)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.LetExpr.eval(LetExpr.java:187)
at org.exist.xquery.BindingExpression.eval(BindingExpression.java:165)
at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71)
at org.exist.xquery.PathExpr.eval(PathExpr.java:267)
at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71)
at org.exist.xquery.XQuery.execute(XQuery.java:280)
at org.exist.xquery.XQuery.execute(XQuery.java:200)
at org.exist.http.RESTServer.executeXQuery(RESTServer.java:1498)
at org.exist.http.RESTServer.doGet(RESTServer.java:509)
at org.exist.http.servlets.EXistServlet.doGet(EXistServlet.java:204)
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:557)
at org.exist.http.urlrewrite.XQueryURLRewrite.service(XQueryURLRewrite.java:357)
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)
我错过了什么?我希望fop.jar
数字仅作为库,build.sh
可以在必要时修复其他所有内容。
答案 0 :(得分:1)
即将推出的v3.0版本支持FOP2.1;虽然报告了一些问题,但这应该可行。
请注意,Apache稍微更改了FOP的目录结构,您可能需要验证新位置....
见