Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
OS: Windows machine
Description
On windows machine, I am getting the following Exception for while starting the CodehaleMetricsReporter component
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)
This is because we are creating RrdDB by passing the path returned by RrdDef.getPath() method (see here) which does not return the path correctly and is unreliable as discussed here 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