hydralix / docbkx-tools

Automatically exported from code.google.com/p/docbkx-tools
0 stars 0 forks source link

RTF generation fails with NPE #112

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Using 2.0.15, RTF generation fails with a NullPointerException.

Caused by: java.lang.NullPointerException
    at org.apache.fop.render.rtf.RTFHandler.startPageSequence(RTFHandler.java:221)

What steps will reproduce the problem?

1. Generate a test project using docbkx-quickstart-archetype.
2. Change the default generate-pdf to generate-rtf.
3. Build the project.

$ mvn archetype:generate \
-DgroupId=org.mcraig.test \
-DartifactId=docbkx-rtf-build \
-Dversion=1.0-SNAPSHOT \
-DarchetypeGroupId=com.agilejava.docbkx \
-DarchetypeArtifactId=docbkx-quickstart-archetype \
-DarchetypeVersion=2.0.15

$ vi docbkx-rtf-build/pom.xml # Change generate-pdf to generate-rtf

$ cd docbkx-rtf-build && mvn -e pre-site
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Docbkx Maven Quickstart Archetype 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- docbkx-maven-plugin:2.0.15:generate-rtf (documentation identifier) @ 
docbkx-rtf-build ---
[INFO] Processing input file: book.xml
[INFO] Dumping to 
/private/tmp/docbkx-rtf-build/target/docbkx/generated/(gen)book.xml
[INFO] Applying customization parameters after docbkx parameters
[INFO] targetFileExtension rtf
[INFO] type fo
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: images/draft.png. (See position 1:16391)
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: images/draft.png. (See position 1:17407)
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: images/draft.png. (See position 1:18421)
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: images/draft.png. (See position 1:19428)
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: images/draft.png. (See position 1:20434)
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: images/draft.png. (See position 1:21442)
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: images/draft.png. (See position 1:22443)
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: images/draft.png. (See position 1:23451)
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: images/draft.png. (See position 1:24461)
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: images/draft.png. (See position 1:25464)
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: images/draft.png. (See position 1:26471)
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: images/draft.png. (See position 1:27480)
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: images/draft.png. (See position 1:28482)
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: images/draft.png. (See position 1:29489)
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: images/draft.png. (See position 1:30498)
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: images/draft.png. (See position 1:31500)
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: images/draft.png. (See position 1:32508)
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: images/draft.png. (See position 1:33518)
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: images/draft.png. (See position 1:34521)
Feb 24, 2014 12:06:10 PM org.apache.fop.events.LoggingEventListener processEvent
WARNING: Only simple-page-masters are supported on page-sequences. Using 
default simple-page-master from page-sequence-master "titlepage-draft". (See 
position 1:43526)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.701s
[INFO] Finished at: Mon Feb 24 12:06:10 CET 2014
[INFO] Final Memory: 20M/234M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal 
com.agilejava.docbkx:docbkx-maven-plugin:2.0.15:generate-rtf (documentation 
identifier) on project docbkx-rtf-build: Execution documentation identifier of 
goal com.agilejava.docbkx:docbkx-maven-plugin:2.0.15:generate-rtf failed. 
NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
com.agilejava.docbkx:docbkx-maven-plugin:2.0.15:generate-rtf (documentation 
identifier) on project docbkx-rtf-build: Execution documentation identifier of 
goal com.agilejava.docbkx:docbkx-maven-plugin:2.0.15:generate-rtf failed.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution 
documentation identifier of goal 
com.agilejava.docbkx:docbkx-maven-plugin:2.0.15:generate-rtf failed.
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
Caused by: java.lang.NullPointerException
    at org.apache.fop.render.rtf.RTFHandler.startPageSequence(RTFHandler.java:221)
    at org.apache.fop.fo.pagination.PageSequence.startOfNode(PageSequence.java:119)
    at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:325)
    at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:175)
    at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
    at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
    at com.agilejava.docbkx.maven.AbstractFoMojo.postProcessResult(AbstractFoMojo.java:161)
    at com.agilejava.docbkx.maven.AbstractTransformerMojo.execute(AbstractTransformerMojo.java:202)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    ... 20 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

What is the expected output? What do you see instead?

RTF should build by default without failing.

What version of the product are you using? On what operating system?

2.0.15

Mac OS X 10.9.1

$ java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

Original issue reported on code.google.com by mark.cr...@gmail.com on 24 Feb 2014 at 11:12

GoogleCodeExporter commented 8 years ago
It seems to be related to a FOP issue, 
https://issues.apache.org/jira/browse/FOP-2321

Original comment by MimilO...@gmail.com on 25 Feb 2014 at 7:29