You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Sagar Miglani (Jira)" <ji...@apache.org> on 2022/04/14 07:14:00 UTC

[jira] [Created] (SLING-11261) Exception while starting CodehaleMetricsReporter component on Windows Machine

Sagar Miglani created SLING-11261:
-------------------------------------

             Summary: 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
         Attachments: RRD4JReporterProblem.java

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 the we 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)