You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2018/08/02 14:29:57 UTC

[Bug 62594] New: junitreport saxon fails on windows

https://bz.apache.org/bugzilla/show_bug.cgi?id=62594

            Bug ID: 62594
           Summary: junitreport saxon fails on windows
           Product: Ant
           Version: 1.10.5
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Optional Tasks
          Assignee: notifications@ant.apache.org
          Reporter: mcwarman@gmail.com
  Target Milestone: ---

Created attachment 36066
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36066&action=edit
sample-build.xml

When running junitreport frames using junitreport-saxon.xsl on windows the
following exception occurs:

Caused by: java.net.MalformedURLException: unknown protocol: c

Upon further investigation it's because the the xsl:result-document needs to be
a URI I believe "..xsl:result-document href="file:///{$output.dir}.."

I've attached sample build.xml that replicates the issue.

Full stack trace:

BUILD FAILED
C:\repo\code\other\junitreport-xsl-saxon-windows\build.xml:26: Errors while
applying transformations: Fatal error during transformation using
jar:file:/C:/tools/apache-ant-1.10.5/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames-saxon.xsl:
Resolved URL is malformed; SystemID:
jar:file:/C:/tools/apache-ant-1.10.5/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames-saxon.xsl;
Line#: 39; Column#: 62
        at
org.apache.tools.ant.taskdefs.optional.TraXLiaison.fatalError(TraXLiaison.java:544)
        at
net.sf.saxon.lib.DelegatingErrorListener.fatalError(DelegatingErrorListener.java:46)
        at net.sf.saxon.Controller.reportFatalError(Controller.java:958)
        at net.sf.saxon.Controller.transform(Controller.java:1914)
        at
net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:588)
        at
net.sf.saxon.jaxp.TransformerImpl.transform(TransformerImpl.java:185)
        at
org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.java:204)
        at
org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java:870)
        at
org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:408)
        at
org.apache.tools.ant.taskdefs.optional.junit.AggregateTransformer.transform(AggregateTransformer.java:281)
        at
org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator.execute(XMLResultAggregator.java:157)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
        at org.apache.tools.ant.Task.perform(Task.java:350)
        at org.apache.tools.ant.Target.execute(Target.java:449)
        at org.apache.tools.ant.Target.performTasks(Target.java:470)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
        at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:834)
        at org.apache.tools.ant.Main.startAnt(Main.java:223)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
Caused by: net.sf.saxon.trans.XPathException: Resolved URL is malformed
        at
net.sf.saxon.lib.StandardOutputResolver.resolve(StandardOutputResolver.java:98)
        at
net.sf.saxon.expr.instruct.ResultDocument.getResult(ResultDocument.java:523)
        at
net.sf.saxon.expr.instruct.ResultDocument.processInstruction(ResultDocument.java:448)
        at
net.sf.saxon.Configuration.processResultDocument(Configuration.java:2136)
        at
net.sf.saxon.expr.instruct.ResultDocument.process(ResultDocument.java:382)
        at
net.sf.saxon.expr.instruct.ResultDocument.processLeavingTail(ResultDocument.java:368)
        at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:653)
        at
net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:353)
        at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:456)
        at
net.sf.saxon.trans.TextOnlyCopyRuleSet.process(TextOnlyCopyRuleSet.java:65)
        at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:433)
        at net.sf.saxon.Controller.transformDocument(Controller.java:2321)
        at net.sf.saxon.Controller.transform(Controller.java:1892)
        ... 24 more
Caused by: java.net.MalformedURLException: unknown protocol: c
        at java.net.URL.<init>(URL.java:600)
        at java.net.URL.<init>(URL.java:490)
        at java.net.URL.<init>(URL.java:439)
        at java.net.URI.toURL(URI.java:1089)
        at
net.sf.saxon.lib.StandardOutputResolver.createResult(StandardOutputResolver.java:116)
        at
net.sf.saxon.lib.StandardOutputResolver.resolve(StandardOutputResolver.java:92)
        ... 36 more

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62594] junitreport saxon frames fails on windows

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62594

--- Comment #5 from Jaikiran Pai <ja...@apache.org> ---
I forgot to get back to this issue. I saw your patch and I think it's mostly
fine. However, in the patch:

-        <xsl:result-document href="{$output.dir}/index.html">
+        <xsl:result-document href="file:///{$output.dir}/index.html">

I read the java.net.URI class' javadoc, I wonder if the patch should just do:

-        <xsl:result-document href="{$output.dir}/index.html">
+        <xsl:result-document href="file:{$output.dir}/index.html">

(of course, in the rest of the patch too).

Would it be possible to give that a try on Windows?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62594] junitreport saxon frames fails on windows

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62594

mcwarman@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #3 from mcwarman@gmail.com ---
$ java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62594] junitreport saxon frames fails on windows

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62594

mcwarman@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|All                         |Windows 10

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62594] junitreport saxon frames fails on windows

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62594

--- Comment #6 from mcwarman@gmail.com ---
The no slash doesn't work

The following worked:

="file:///{$output.dir}...
="file:/{$output.dir}...

Reference RFC8089: https://tools.ietf.org/html/rfc8089
Examples: https://tools.ietf.org/html/rfc8089#appendix-B

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62594] junitreport saxon frames fails on windows

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62594

--- Comment #1 from mcwarman@gmail.com ---
Created attachment 36067
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36067&action=edit
Fix-junit-frames-saxon.xsl-to-work-on-windows.patch

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62594] junitreport saxon frames fails on windows

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62594

--- Comment #2 from Jaikiran Pai <ja...@apache.org> ---
Could you tell us which vendor and version of Java runtime is this? The output
of:

java -version

will help. I'm mostly curious since a similar issue has been reported in a
different context in Windows and we haven't been able to narrow it down.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62594] junitreport saxon frames fails on windows

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62594

Jaikiran Pai <ja...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|---                         |1.10.6
             Status|NEW                         |RESOLVED

--- Comment #7 from Jaikiran Pai <ja...@apache.org> ---
Thank you for the patch. I have applied this to our master branch now. It
should be available in our 1.10.6 release (whenever that happens). Before
pushing this change, I did test this change on my *nix system (using the
attached sample build file) to make sure the change doesn't break *nix systems.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62594] junitreport saxon frames fails on windows

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62594

mcwarman@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All
            Summary|junitreport saxon fails on  |junitreport saxon frames
                   |windows                     |fails on windows

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62594] junitreport saxon frames fails on windows

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62594

--- Comment #4 from mcwarman@gmail.com ---
Java vendor is Oracle.

-- 
You are receiving this mail because:
You are the assignee for the bug.