[ 
https://issues.apache.org/jira/browse/SLING-11261?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Munteanu resolved SLING-11261.
-------------------------------------
    Fix Version/s: Commons Metrics RRD4J 1.0.6
       Resolution: Fixed

Thanks for the PR, [~sagarmiglani]!

> Exception while starting CodehaleMetricsReporter component on Windows Machine
> -----------------------------------------------------------------------------
>
>                 Key: SLING-11261
>                 URL: https://issues.apache.org/jira/browse/SLING-11261
>             Project: Sling
>          Issue Type: Bug
>          Components: Commons
>         Environment: OS: Windows machine
>            Reporter: Sagar Miglani
>            Assignee: Robert Munteanu
>            Priority: Major
>             Fix For: Commons Metrics RRD4J 1.0.6
>
>         Attachments: RRD4JReporterProblem.java
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> On windows machine, I am getting the following Exception for while starting 
> the CodehaleMetricsReporter component
> {code:xml}
> java.nio.file.InvalidPathException: Illegal char <:> at index 2: 
> /C:/playground/rrd4j/metrics/metrics.rrd
>       at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
>       at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
>       at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
>       at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
>       at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
>       at java.nio.file.Paths.get(Paths.java:84)
>       at 
> org.rrd4j.core.RrdFileBackendFactory.exists(RrdFileBackendFactory.java:26)
>       at org.rrd4j.core.RrdBackendFactory.exists(RrdBackendFactory.java:543)
>       at org.rrd4j.core.RrdDb.<init>(RrdDb.java:624)
>       at org.rrd4j.core.RrdDb.of(RrdDb.java:500)
> {code}
> This is because we are creating RrdDB by passing the path returned by 
> RrdDef.getPath() method (see 
> [here|https://github.com/apache/sling-org-apache-sling-commons-metrics-rrd4j/blob/master/src/main/java/org/apache/sling/commons/metrics/rrd4j/impl/RRD4JReporter.java#L374])
>  which does not return the path correctly and is unreliable as discussed 
> [here|https://github.com/rrd4j/rrd4j/issues/152] and It is suggested to use 
> RrdDef.getUri() instead.
> Also, while creating the RrdDef with a path RRD4J lib creates an internal 
> generic URI which again can not be use directly for creating the File or 
> Paths api as this generic URI could be non-absolute in some cases.
> Attaching the test case which should fail on windows machine. 
> [^RRD4JReporterProblem.java]



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to