[BUG] java.nio.file.FileSystemNotFoundException: Provider "vfs" not installed
See original GitHub issueContext:
- Playwright Version: 1.19.0
- Operating System: Linux
- Browser: N/A
- Extra: Playwright JARs are bundled inside a WAR and deployed into WildFly/JBoss application server v11.0.0.Final
Code Snippet
import com.microsoft.playwright.Browser;
import com.microsoft.playwright.Page;
import com.microsoft.playwright.Playwright;
import com.microsoft.playwright.options.Margin;
import com.microsoft.playwright.options.Media;
try (Playwright playwright = Playwright.create();
Browser browser = playwright.chromium().launch()) {
final String tmpFile = "/tmp/file-" + Instant.now().getEpochSecond() + ".html";
Files.write(Paths.get(tmpFile), html.getBytes());
try (final Page page = browser.newPage()) {
page.navigate("file://" + tmpFile);
final Page.PdfOptions pdfOptions = configurePageOptions(header, footer);
rendered = page.pdf(pdfOptions);
}
}
Describe the bug
Playwright returns an exception Caused by: java.lang.RuntimeException: Failed to create driver
which is caused by java.nio.file.FileSystemNotFoundException: Provider "vfs" not installed
as following (redacted due to verbosity).
It happens at the line try (Playwright playwright = Playwright.create();
.
io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_152]
at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_152]
Caused by: java.lang.RuntimeException: Failed to create driver
at com.microsoft.playwright.impl.Driver.ensureDriverInstalled(Driver.java:54) [driver-1.19.0.jar:1.19.0]
at com.microsoft.playwright.impl.PlaywrightImpl.create(PlaywrightImpl.java:40) [playwright-1.19.0.jar:1.19.0]
at com.microsoft.playwright.Playwright.create(Playwright.java:96) [playwright-1.19.0.jar:1.19.0]
at com.microsoft.playwright.Playwright.create(Playwright.java:100) [playwright-1.19.0.jar:1.19.0]
at au.com.infomedix.pdfkit.PlaywrightHtmlToPdf.render(PlaywrightHtmlToPdf.java:31) [:]
...
... 228 more
Caused by: java.nio.file.FileSystemNotFoundException: Provider "vfs" not installed
at java.nio.file.Paths.get(Paths.java:147) [rt.jar:1.8.0_152]
at com.microsoft.playwright.impl.DriverJar.extractDriverToTempDir(DriverJar.java:90) [driver-bundle-1.19.0.jar:1.19.0]
at com.microsoft.playwright.impl.DriverJar.initialize(DriverJar.java:44) [driver-bundle-1.19.0.jar:1.19.0]
at com.microsoft.playwright.impl.Driver.ensureDriverInstalled(Driver.java:52) [driver-1.19.0.jar:1.19.0]
... 257 more
ERROR [default task-14] WFLYEJB0034: EJB Invocation failed on component PdfRenderService for method public byte[] au.com.infomedix.pdfkit.service.PdfRenderService.render(au.com.infomedix.pdfkit.dto.HtmlToPdfRequest) throws java.io.IOException: javax.ejb.EJBTransactionRolledbackException: Failed to create driver
...
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_152]
at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_152]
Caused by: java.lang.RuntimeException: Failed to create driver
at com.microsoft.playwright.impl.Driver.ensureDriverInstalled(Driver.java:54) [driver-1.19.0.jar:1.19.0]
at com.microsoft.playwright.impl.PlaywrightImpl.create(PlaywrightImpl.java:40) [playwright-1.19.0.jar:1.19.0]
at com.microsoft.playwright.Playwright.create(Playwright.java:96) [playwright-1.19.0.jar:1.19.0]
at com.microsoft.playwright.Playwright.create(Playwright.java:100) [playwright-1.19.0.jar:1.19.0]
at au.com.infomedix.pdfkit.PlaywrightHtmlToPdf.render(PlaywrightHtmlToPdf.java:31) [:]
...
at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_152]
Caused by: java.lang.RuntimeException: Failed to create driver
at com.microsoft.playwright.impl.Driver.ensureDriverInstalled(Driver.java:54) [driver-1.19.0.jar:1.19.0]
at com.microsoft.playwright.impl.PlaywrightImpl.create(PlaywrightImpl.java:40) [playwright-1.19.0.jar:1.19.0]
at com.microsoft.playwright.Playwright.create(Playwright.java:96) [playwright-1.19.0.jar:1.19.0]
at com.microsoft.playwright.Playwright.create(Playwright.java:100) [playwright-1.19.0.jar:1.19.0]
at au.com.infomedix.pdfkit.PlaywrightHtmlToPdf.render(PlaywrightHtmlToPdf.java:31) [:]
...
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:255) [wildfly-ejb3-11.0.0.Final.jar:11.0.0.Final]
... 228 more
Caused by: java.nio.file.FileSystemNotFoundException: Provider "vfs" not installed
at java.nio.file.Paths.get(Paths.java:147) [rt.jar:1.8.0_152]
at com.microsoft.playwright.impl.DriverJar.extractDriverToTempDir(DriverJar.java:90) [driver-bundle-1.19.0.jar:1.19.0]
at com.microsoft.playwright.impl.DriverJar.initialize(DriverJar.java:44) [driver-bundle-1.19.0.jar:1.19.0]
at com.microsoft.playwright.impl.Driver.ensureDriverInstalled(Driver.java:52) [driver-1.19.0.jar:1.19.0]
... 257 more
I set a breakpoint and noticed that the exception is thrown from Java 1.8 java.nio.Path.get()
method
public static Path get(URI uri) {
String scheme = uri.getScheme();
if (scheme == null)
throw new IllegalArgumentException("Missing scheme");
// check for default provider to avoid loading of installed providers
if (scheme.equalsIgnoreCase("file"))
return FileSystems.getDefault().provider().getPath(uri);
// try to find provider
for (FileSystemProvider provider: FileSystemProvider.installedProviders()) {
if (provider.getScheme().equalsIgnoreCase(scheme)) {
return provider.getPath(uri);
}
}
throw new FileSystemNotFoundException("Provider \"" + scheme + "\" not installed");
}
The problematic scheme
is vfs:/content/pdf-rest-server.war/WEB-INF/lib/driver-bundle-1.19.0.jar/driver/linux/
The same code above ran successfully as a standalone Java application (i.e. not deployed inside an application server such as WildFly/JBoss).
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (9 by maintainers)
Top Results From Across the Web
JBoss wildfly 8.x Provider "vfs" not installed when using java ...
It happens to work by chance in GlassFish. Nowhere in the ClassLoader contract (or the Java EE platform specification) is it specified what...
Read more >Adding a custom java FileSystemProvider to an e... - JBoss.org
I have put the FQCN in META-INF/services/java.nio.file.spi. ... FileSystemNotFoundException: Provider "classpath" not installed (although it ...
Read more >Jboss Wildfly 8.X Provider "Vfs" Not Installed When ... - ADocLib
Caused by: java.lang.RuntimeException: java.nio.file.FileSystemNotFoundException: Provider vfs not installed at io.undertow.servlet.core. 15.Re: Wildfly fails ...
Read more >org.uberfire.java.nio.file.FileSystemNotFoundException java ...
Best Java code snippets using org.uberfire.java.nio.file. ... null) { throw new FileSystemNotFoundException("Provider '" + scheme + "' not found"); } return ...
Read more >RE: ERROR: Provider not found - Forums - Liferay Community
Here is the error: java.lang.RuntimeException: java.nio.file.ProviderNotFoundException: Provider not found at com.sun.tools.javac.main.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@yury-s I’ve submitted a PR.
Hi, here is the same error reported. How exactly do you use AlternativeDriver class tuning? @htr3n