Keytool error: java io ioexception The filename, directory name, or volume label syntax is incorrect

This can occur when filename has timestamp with colons, eg. myfile_HH:mm:ss.csv Removing colons fixed the issue.

Try this, as it takes more care of adjusting directory separator characters in the path between targetPath and filename:

File targetFile = new File[targetPath, filename];

I just encountered the same problem. I think it has to something do with write access permission. I got the error while trying to write to c:\ but on changing to D:\ everything worked fine. Apparently Java did not have permission to write to my System Drive [Running Windows 7 installed on C:]

Tags:

Java

Exception

File Io

Related

I run in the problem that the reports cannot be generated. Jenkins output [project specific contents replaced by [...]]:

[CucumberReport] JSON report directory is "" [CucumberReport] Copied 4312 json files from workspace "C:\Program Files [x86]\Jenkins\[...]" to reports directory "C:\Program Files [x86]\Jenkins\jobs\[...]\builds\892\cucumber-html-reports\.cache" [CucumberReport] Processing 3 json files: [CucumberReport] C:\Program Files [x86]\Jenkins\jobs\[...]\builds\892\cucumber-html-reports\.cache\[...]\[...].protractor-report.json [CucumberReport] C:\Program Files [x86]\Jenkins\jobs\[...]\builds\892\cucumber-html-reports\.cache\[...]\[...].protractor-report.json [CucumberReport] C:\Program Files [x86]\Jenkins\jobs\[...]\builds\892\cucumber-html-reports\.cache\[...]\[...].protractor-report.json [CucumberReport] Missing report result - report was not successfully completed [CucumberReport] Build status is left unchanged

net.masterthought.cucumber.ValidationException: java.io.FileNotFoundException: C:\Program Files [x86]\Jenkins\jobs\[...]\builds\892\cucumber-html-reports\report-feature_[...dash-encoded path to a non-existent file...]-feature_1.html [The filename, directory name, or volume label syntax is incorrect] at net.masterthought.cucumber.generators.AbstractPage.generateReport[AbstractPage.java:78] at net.masterthought.cucumber.generators.AbstractPage.generatePage[AbstractPage.java:57] at net.masterthought.cucumber.ReportBuilder.generatePages[ReportBuilder.java:174] at net.masterthought.cucumber.ReportBuilder.generateReports[ReportBuilder.java:97] at net.masterthought.jenkins.CucumberReportPublisher.generateReport[CucumberReportPublisher.java:174] at net.masterthought.jenkins.CucumberReportPublisher.perform[CucumberReportPublisher.java:112] at hudson.tasks.BuildStepCompatibilityLayer.perform[BuildStepCompatibilityLayer.java:81] at hudson.tasks.BuildStepMonitor$1.perform[BuildStepMonitor.java:20] at hudson.model.AbstractBuild$AbstractBuildExecution.perform[AbstractBuild.java:779] at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps[AbstractBuild.java:720] at hudson.model.Build$BuildExecution.post2[Build.java:186] at hudson.model.AbstractBuild$AbstractBuildExecution.post[AbstractBuild.java:665] at hudson.model.Run.execute[Run.java:1760] at hudson.model.FreeStyleBuild.run[FreeStyleBuild.java:43] at hudson.model.ResourceController.execute[ResourceController.java:97] at hudson.model.Executor.run[Executor.java:405] Caused by: java.io.FileNotFoundException: C:\Program Files [x86]\Jenkins\jobs\[...]\builds\892\cucumber-html-reports\report-feature_[...dash-encoded path to a non-existent file...]-feature_1.html [The filename, directory name, or volume label syntax is incorrect] at java.io.FileOutputStream.open0[Native Method] at java.io.FileOutputStream.open[Unknown Source] at java.io.FileOutputStream.[Unknown Source] at java.io.FileOutputStream.[Unknown Source] at net.masterthought.cucumber.generators.AbstractPage.generateReport[AbstractPage.java:75] ... 15 more

Posted on January 22, 2019 at 7:11am

I am trying to upgrade from iReport Designer 5.6.0 to JasperSoft Studio 6.6.0. While in iReport Designer I can run reports without problems I am having trouble to do the same in JasperSoft Studio. I could connect to the repository just fine, can open reports in design mode and switch to the preview but when I select "Run Report Unit" from the menu it fails with this error:

The filename, directory name, or volume label syntax is incorrect   java.io.IOException: The filename, directory name, or volume label syntax is incorrect at java.io.WinNTFileSystem.createFileExclusively[Native Method] at java.io.File.createNewFile[File.java:1012] at com.jaspersoft.studio.server.editor.ReportRunControler$2.run[ReportRunControler.java:258] at org.eclipse.core.internal.jobs.Worker.run[Worker.java:55]

It has already been asked here but I don't see any solution there. It ends with someone saying "Needed to make sure that the datasources were added" but I did already add the data sources.

I have used Process Monitor to watch what Jaspersoft Studio.exe does in that moment and found that the invalid file path comes from the temp path being included twice:

How can I influence that temp path, is there any setting for it? To me it looks like a bug in the software but there must be a way to influence that from configuration, since it doesn't seem to be a very common error.

Joined: Jan 22 2019 - 6:56am

Last seen: 2 years 7 months ago

Posted on January 24, 2019 at 7:51pm

I only tried 'Run Report Unit" on Studio Pro 7.1 and I don't have such error. The procmon does show only one temp path. However, as far as I know there is no temp path setting or you don't need to explicitly set the temp path in Studio as it picks it up from the windows TEMP env variable. 

No doubt the invalid path can be a cause to the error but why it is like that is strange.  

Perhaps you can try a fresh Windows uninstall and install of [a later version] Studio and see whether it works. 

Joined: May 1 2017 - 5:33pm

Last seen: 8 hours 45 min ago

Posted on January 28, 2019 at 4:22am

I don't have pro [for now I am only working with this for me personally] and the latest community version available is 6.6.0 if I'm not mistaken. I have tried with 6.6.0 again and the error is the same [I edited the OP accordingly so that it says 6.6.0 instead of 6.4.3 now].

Joined: Jan 22 2019 - 6:56am

Last seen: 2 years 7 months ago

Chủ Đề