r351574nc3 / docbkx-tools

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

NullPointerException if a language highlighting is not available #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The docbkx plugin crashes with a NullPointerException if a language
highlighting is not available (for instance, bash) when defining the
language attribute of a programlisting element.

What steps will reproduce the problem?
1. put the following piece of code in a docbook xml file :
<programlisting language="bash">export APP_HOME=/some/path</programlisting>
2. activate the hightlighting in your pom :
<highlightSource>true</highlightSource>
3. run the generation

The expected output is as following :
java.lang.NullPointerException
        at net.sf.xslthl.ConnectorSaxon6.highlight(Unknown Source)
        at net.sf.xslthl.ConnectorSaxon6.highlight(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.icl.saxon.expr.FunctionProxy.call(FunctionProxy.java:582)
        at com.icl.saxon.expr.FunctionProxy.enumerate(FunctionProxy.java:462)
        at
com.icl.saxon.expr.NodeListExpression.enumerate(NodeListExpression.java:80)
        at com.icl.saxon.Controller.applyTemplates(Controller.java:206)
        at
com.icl.saxon.style.XSLApplyTemplates.process(XSLApplyTemplates.java:135)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLWhen.process(XSLWhen.java:72)
        at com.icl.saxon.style.XSLChoose.process(XSLChoose.java:96)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLWhen.process(XSLWhen.java:72)
        at com.icl.saxon.style.XSLChoose.process(XSLChoose.java:96)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
        at
com.icl.saxon.style.XSLCallTemplate.process(XSLCallTemplate.java:187)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at
com.icl.saxon.style.LiteralResultElement.process(LiteralResultElement.java:289)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLOtherwise.process(XSLOtherwise.java:48)
        at com.icl.saxon.style.XSLChoose.process(XSLChoose.java:96)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
        at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
        at com.icl.saxon.Controller.applyTemplates(Controller.java:246)
        at
com.icl.saxon.style.XSLApplyTemplates.process(XSLApplyTemplates.java:135)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at
com.icl.saxon.style.LiteralResultElement.process(LiteralResultElement.java:289)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
        at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
        at com.icl.saxon.Controller.applyImports(Controller.java:298)
        at com.icl.saxon.style.XSLApplyImports.process(XSLApplyImports.java:71)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at
com.icl.saxon.style.XSLGeneralVariable.getSelectValue(XSLGeneralVariable.java:23
8)
        at com.icl.saxon.style.XSLParam.process(XSLParam.java:76)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
        at
com.icl.saxon.style.XSLCallTemplate.process(XSLCallTemplate.java:187)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLOtherwise.process(XSLOtherwise.java:48)
        at com.icl.saxon.style.XSLChoose.process(XSLChoose.java:96)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
        at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
        at com.icl.saxon.Controller.applyTemplates(Controller.java:246)
        at
com.icl.saxon.style.XSLApplyTemplates.process(XSLApplyTemplates.java:135)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at
com.icl.saxon.style.LiteralResultElement.process(LiteralResultElement.java:289)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
        at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
        at com.icl.saxon.Controller.applyImports(Controller.java:298)
        at com.icl.saxon.style.XSLApplyImports.process(XSLApplyImports.java:71)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at
com.icl.saxon.style.XSLGeneralVariable.getSelectValue(XSLGeneralVariable.java:23
8)
        at com.icl.saxon.style.XSLParam.process(XSLParam.java:76)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
        at
com.icl.saxon.style.XSLCallTemplate.process(XSLCallTemplate.java:187)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLOtherwise.process(XSLOtherwise.java:48)
        at com.icl.saxon.style.XSLChoose.process(XSLChoose.java:96)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
        at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
        at com.icl.saxon.Controller.applyTemplates(Controller.java:255)
        at
com.icl.saxon.style.XSLApplyTemplates.process(XSLApplyTemplates.java:135)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at
com.icl.saxon.style.LiteralResultElement.process(LiteralResultElement.java:289)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
        at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
        at com.icl.saxon.Controller.applyImports(Controller.java:298)
        at com.icl.saxon.style.XSLApplyImports.process(XSLApplyImports.java:71)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at
com.icl.saxon.style.XSLGeneralVariable.getSelectValue(XSLGeneralVariable.java:23
8)
        at com.icl.saxon.style.XSLParam.process(XSLParam.java:76)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
        at
com.icl.saxon.style.XSLCallTemplate.process(XSLCallTemplate.java:187)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLOtherwise.process(XSLOtherwise.java:48)
        at com.icl.saxon.style.XSLChoose.process(XSLChoose.java:96)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
        at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
        at com.icl.saxon.Controller.applyTemplates(Controller.java:255)
        at
com.icl.saxon.style.XSLApplyTemplates.process(XSLApplyTemplates.java:135)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
        at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
        at com.icl.saxon.Controller.applyTemplates(Controller.java:255)
        at com.icl.saxon.Controller.defaultAction(Controller.java:271)
        at com.icl.saxon.Controller.applyTemplates(Controller.java:236)
        at
com.icl.saxon.style.XSLApplyTemplates.process(XSLApplyTemplates.java:135)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLIf.process(XSLIf.java:78)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLOtherwise.process(XSLOtherwise.java:48)
        at com.icl.saxon.style.XSLChoose.process(XSLChoose.java:96)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLOtherwise.process(XSLOtherwise.java:48)
        at com.icl.saxon.style.XSLChoose.process(XSLChoose.java:96)
        at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
        at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
        at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
        at com.icl.saxon.Controller.applyTemplates(Controller.java:246)
        at com.icl.saxon.Controller.run(Controller.java:178)
        at com.icl.saxon.Controller.transformDocument(Controller.java:1086)
        at com.icl.saxon.Controller.transform(Controller.java:953)
        at
com.agilejava.docbkx.maven.AbstractTransformerMojo.execute(AbstractTransformerMo
jo.java:173)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.ja
va:451)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycl
eExecutor.java:558)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(Def
aultLifecycleExecutor.java:499)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycle
Executor.java:478)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java:330)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultL
ifecycleExecutor.java:291)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExec
utor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR

What version of the product are you using? docbkx-maven-plugin 2.0.8
On what operating system? Ubuntu
Maven version: 2.0.9
Java version: 1.6.0_12
OS name: "linux" version: "2.6.24-23-generic" arch: "i386" Family: "unix"

Thank you for this great tool (the only really usable I found)!
Christophe.

Original issue reported on code.google.com by cdema...@gmail.com on 20 Feb 2009 at 4:19

GoogleCodeExporter commented 9 years ago
Hi Christophe and thank you for your support.

I think the bug you are mentioning is not in our side, it is on xslthl side. We 
are
based on xslth-1.3.jar
The only thing that can be done is to update to latest xslthl version (maybe it 
will
solve the problem) but it means that we have to move to docbook xsl 1.74+

As we do not have yet moved latest docbook xsl versions I think we cannot 
resolve
this minor bug.
Maybe you can also write an xsl layer to check that if you are really in need 
of this
feature?

Original comment by MimilO...@gmail.com on 2 Mar 2009 at 7:09

GoogleCodeExporter commented 9 years ago
I set it as WontFix status for now, if you have any comment feel free to reply.

Cédric,

Original comment by MimilO...@gmail.com on 4 Mar 2009 at 11:19