Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - Error - ClassNotFoundException: com.microsoft.playwright.impl.driver.Driver on Version 1.48.0 #34233

Open
abdus03 opened this issue Jan 7, 2025 · 3 comments

Comments

@abdus03
Copy link

abdus03 commented Jan 7, 2025

When i run the same sample playwright code as below
public static void main(String[] args) {

             Playwright playwright = Playwright.create();

                    Browser browser = playwright.chromium().launch();
                    Page page = browser.newPage();
                    page.navigate("http://example.com");
                    // other actions...
                    browser.close();

    }

I am getting below Exception
Exception in thread "main" java.lang.NoClassDefFoundError: com/microsoft/playwright/impl/driver/Driver
at com.microsoft.playwright.impl.PlaywrightImpl.createImpl(PlaywrightImpl.java:46)
at com.microsoft.playwright.impl.PlaywrightImpl.create(PlaywrightImpl.java:36)
at com.microsoft.playwright.Playwright.create(Playwright.java:110)
at com.microsoft.playwright.Playwright.create(Playwright.java:114)
at com.axa.testautomation.axasol.testrunner.Main.main(Main.java:73)
Caused by: java.lang.ClassNotFoundException: com.microsoft.playwright.impl.driver.Driver
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 5 more

@Skn0tt
Copy link
Member

Skn0tt commented Jan 7, 2025

Hi there! This most likely is an application problem on your end. The issue tracker is reserved for bug reports and feature requests. Please see to get help on this:

@abdus03
Copy link
Author

abdus03 commented Jan 8, 2025

@Skn0tt My dependency tree doesn't show up the path com/microsoft/playwright/impl/driver/Driver

![Image](https://github.com/user-attachments/assets/944a24f9-e3a5-4b60-8e1a-9b47976f7346)

The above image is of version 1.32.0, the case is same with 1.48.0,

Please let me know if i am missing something here

@Skn0tt
Copy link
Member

Skn0tt commented Jan 8, 2025

Hmm, Driver seems to live in a different directory than DriverImpl: https://github.com/microsoft/playwright-java/blob/main/driver/src/main/java/com/microsoft/playwright/impl/driver/Driver.java

I'm still pretty sure that something's off in your config. If you believe there's a bug here, please provide me with a minimal reproduction case so I can take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants