{"action":"created","issue":{"url":"https://api.github.com/repos/jsevellec/cassandra-unit/issues/261","repository_url":"https://api.github.com/repos/jsevellec/cassandra-unit","labels_url":"https://api.github.com/repos/jsevellec/cassandra-unit/issues/261/labels{/name}","comments_url":"https://api.github.com/repos/jsevellec/cassandra-unit/issues/261/comments","events_url":"https://api.github.com/repos/jsevellec/cassandra-unit/issues/261/events","html_url":"https://github.com/jsevellec/cassandra-unit/issues/261","id":293148235,"number":261,"title":"Failed to apply cassandra.yaml config on Windows","user":{"login":"nicoalexandrovich","id":35998678,"avatar_url":"https://avatars1.githubusercontent.com/u/35998678?v=4","gravatar_id":"","url":"https://api.github.com/users/nicoalexandrovich","html_url":"https://github.com/nicoalexandrovich","followers_url":"https://api.github.com/users/nicoalexandrovich/followers","following_url":"https://api.github.com/users/nicoalexandrovich/following{/other_user}","gists_url":"https://api.github.com/users/nicoalexandrovich/gists{/gist_id}","starred_url":"https://api.github.com/users/nicoalexandrovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicoalexandrovich/subscriptions","organizations_url":"https://api.github.com/users/nicoalexandrovich/orgs","repos_url":"https://api.github.com/users/nicoalexandrovich/repos","events_url":"https://api.github.com/users/nicoalexandrovich/events{/privacy}","received_events_url":"https://api.github.com/users/nicoalexandrovich/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-01-31T12:56:45Z","updated_at":"2018-02-07T04:21:07Z","closed_at":null,"author_association":"NONE","body":"Hello Guys!\r\nWhen I running cassandra-unit on Windows 10,  I am using following code on scala:\r\n\r\n```\r\nval path = getClass.getResource(\"/cassandra/cu-cassandra.yaml\").getPath\r\nval file = new java.io.File(path);\r\nEmbeddedCassandraServerHelper.startEmbeddedCassandra(file.getAbsolutePath)\r\n```\r\n\r\nI faced with following exception:\r\njava.nio.file.InvalidPathException: Illegal char <:> at index 26: target/embeddedCassandra\\C:\\storage\\cassandra-poc\\target\\test-classes\\cassandra\\cu-cassandra.yaml\r\n\tat sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)\r\n\tat sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)\r\n\tat sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)\r\n\tat sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)\r\n\tat sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)\r\n\tat java.nio.file.Paths.get(Paths.java:84)\r\n\tat org.cassandraunit.utils.EmbeddedCassandraServerHelper.copy(EmbeddedCassandraServerHelper.java:292)\r\n\tat org.cassandraunit.utils.EmbeddedCassandraServerHelper.startEmbeddedCassandra(EmbeddedCassandraServerHelper.java:99)\r\n\tat org.cassandraunit.utils.EmbeddedCassandraServerHelper.startEmbeddedCassandra(EmbeddedCassandraServerHelper.java:81)\r\n\tat org.cassandraunit.utils.EmbeddedCassandraServerHelper.startEmbeddedCassandra(EmbeddedCassandraServerHelper.java:77)\r\n\tat com.project.userprofile.util.TestEnvironmentHelper$.initEmbeddedCassandra(TestEnvironmentHelper.scala:24)\r\n\tat com.project.userprofile.IngestTest.startupCassandra(IngestTest.scala:20)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)\r\n\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\r\n\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)\r\n\tat org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)\r\n\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\r\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\r\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\r\n\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\r\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\r\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\r\n\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\r\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\r\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\r\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:369)\r\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:275)\r\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:239)\r\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:160)\r\n\tat org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:373)\r\n\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:334)\r\n\tat org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:119)\r\n\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:407) \r\n\r\nProbably, problem here, path must not have a leading \\\r\nActual: \\C:\\storage\\cassandra-poc\\target\\test-classes\\cassandra\\cu-cassandra.yaml\r\nExpected: C:\\storage\\cassandra-poc\\target\\test-classes\\cassandra\\cu-cassandra.yaml\r\n\r\nProbably fix should be:  \r\n`System.getProperty( \"os.name\" ).contains( \"window\" ) ? filePath.substring(1) : filePath;`\r\n\r\nCould you please take a look?\r\nThank you in advance!"},"comment":{"url":"https://api.github.com/repos/jsevellec/cassandra-unit/issues/comments/363652953","html_url":"https://github.com/jsevellec/cassandra-unit/issues/261#issuecomment-363652953","issue_url":"https://api.github.com/repos/jsevellec/cassandra-unit/issues/261","id":363652953,"user":{"login":"NYPD","id":6412879,"avatar_url":"https://avatars2.githubusercontent.com/u/6412879?v=4","gravatar_id":"","url":"https://api.github.com/users/NYPD","html_url":"https://github.com/NYPD","followers_url":"https://api.github.com/users/NYPD/followers","following_url":"https://api.github.com/users/NYPD/following{/other_user}","gists_url":"https://api.github.com/users/NYPD/gists{/gist_id}","starred_url":"https://api.github.com/users/NYPD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NYPD/subscriptions","organizations_url":"https://api.github.com/users/NYPD/orgs","repos_url":"https://api.github.com/users/NYPD/repos","events_url":"https://api.github.com/users/NYPD/events{/privacy}","received_events_url":"https://api.github.com/users/NYPD/received_events","type":"User","site_admin":false},"created_at":"2018-02-07T04:21:07Z","updated_at":"2018-02-07T04:21:07Z","author_association":"NONE","body":"I had sort of the same issue as well. I had to download the yaml file manually and add it to my classpath:\r\n\r\n```java\r\nURL url = EventRepositoryTest.class.getClassLoader().getResource(\"resources/another-cassandra.yaml\");\r\nEmbeddedCassandraServerHelper.startEmbeddedCassandra(new File(url.toURI()), 10000);\r\n```\r\n\r\n![](https://i.imgur.com/lFzTjDD.png \"L\")\r\n\r\n\r\nThis is on 3.3.0.2"}}
{"actor":{"display_login":"NYPD"}}