Cannot get asciidoctor-fopub to run offline

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Cannot get asciidoctor-fopub to run offline

apnadkarni
asciidoctor-fopub works fine for me as long as I have network connectivity. Offline however, it fails with error messages:

Apr 06, 2017 11:20:53 AM org.apache.fop.cli.InputHandler error
SEVERE: javax.xml.transform.TransformerException: Had IO Exception with stylesheet file: http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl
Apr 06, 2017 11:20:53 AM org.apache.fop.cli.InputHandler error
SEVERE: javax.xml.transform.TransformerException: Had IO Exception with stylesheet file: http://docbook.sourceforge.net/release/xsl/current/highlighting/common.xsl

I thought the presence of the catalog.xml file(s) would permit offline operation? And moreover does the failure mean it fetches those stylesheets on every run?

/Ashok
Reply | Threaded
Open this post in threaded view
|

Re: Cannot get asciidoctor-fopub to run offline

mojavelinux
Administrator
That's supposed to be the purpose of this file:


For some reason, it's not being used in your setup. Perhaps it stopped working at some point? I'm not sure.

The problem comes down to the fact that Apache FOP sets up the XML resolver incorrectly. (See https://github.com/apache/fop/pull/1) As a result, it tries to fetch stuff from the internet. InputHandler is supposed to fix it. Perhaps you can figure out why it isn't working.

-Dan

On Thu, Apr 6, 2017 at 12:57 AM, apnadkarni [via Asciidoctor :: Discussion] <[hidden email]> wrote:
asciidoctor-fopub works fine for me as long as I have network connectivity. Offline however, it fails with error messages:

Apr 06, 2017 11:20:53 AM org.apache.fop.cli.InputHandler error
SEVERE: javax.xml.transform.TransformerException: Had IO Exception with stylesheet file: http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl
Apr 06, 2017 11:20:53 AM org.apache.fop.cli.InputHandler error
SEVERE: javax.xml.transform.TransformerException: Had IO Exception with stylesheet file: http://docbook.sourceforge.net/release/xsl/current/highlighting/common.xsl

I thought the presence of the catalog.xml file(s) would permit offline operation? And moreover does the failure mean it fetches those stylesheets on every run?

/Ashok


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Cannot-get-asciidoctor-fopub-to-run-offline-tp5475.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Cannot get asciidoctor-fopub to run offline

apnadkarni
Ok, I think I know what the problem is - it's Windows specific. The build/bin/fopub.bat uses APP_HOME to initialize DEFAULT_JVM_OPTS before APP_HOME is set. Thus xml.catalog.files is incorrectly set. Moving the lines

@rem Add default JVM options here. You can also use JAVA_OPTS and FOPUB_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Dxml.catalog.files=%APP_HOME%/catalog.xml"

to be after the line

set APP_HOME=%DIRNAME%..

seems to fix the problem.

Now the question is - the build directory is not in the source repository so where should this fix actually go in the repository?

/Ashok

PS Happily did not have to go poking into Java code! Have no experience with it.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot get asciidoctor-fopub to run offline

apnadkarni
Just for tracking purposes, I've logged a bug  in asciidoctor-fopub.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot get asciidoctor-fopub to run offline

mojavelinux
Administrator
Let's continue the discussion in the issue.

-Dan

On Thu, Apr 6, 2017 at 10:30 AM, apnadkarni [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Just for tracking purposes, I've logged a bug  in asciidoctor-fopub.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Cannot-get-asciidoctor-fopub-to-run-offline-tp5475p5481.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux