Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This error is normally a dependency-graph problem, not a broken web page. com.github.detro:phantomjsdriver:1.2.0 declares Selenium 2.41.0 dependencies, so adding it to a project that uses modern Selenium can place two incompatible API generations in one classpath. Maven can then report Selenium, Byte Buddy, classifier, or Java-module conflicts. Start by printing the resolved graph, choose one Selenium release line, remove or isolate PhantomJSDriver, and align the Byte Buddy artifacts selected by that line.

What is actually conflicting?

Three pieces are often mistaken for one problem:

  • Selenium API versions: PhantomJSDriver 1.2.0 is a 2015-era artifact whose published POM brings Selenium 2.41.0 compile dependencies. A current selenium-java dependency brings a much newer API and module graph.
  • PhantomJSDriver: this binding is for the discontinued PhantomJS/GhostDriver route. Its transitive Selenium dependencies are the usual reason Selenium 2.x and 4.x artifacts appear together.
  • Byte Buddy: Byte Buddy is the JVM runtime code-generation library published as net.bytebuddy:byte-buddy. Selenium or another test dependency can also bring byte-buddy-agent or a JDK-specific variant. Maven must select one compatible set.

Maven resolves one version for a given coordinate, but that does not make old and new Selenium APIs source- or binary-compatible. A successful dependency resolution can therefore be followed by compilation, class-loading, or module-access failures.

1. Inspect the resolved dependency graph first

Do not guess which declaration “wins.” Record what Maven actually selected, including omitted conflicts:

mvn dependency:tree -Dverbose -Dincludes=org.seleniumhq.selenium,com.github.detro:phantomjsdriver,net.bytebuddy

For a complete report, save the output before changing the build:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
mvn dependency:tree -Dverbose > dependency-tree.txt

Look for all of these:

  • Both Selenium 2.x and Selenium 4.x artifacts, or different Selenium modules at different versions.
  • com.github.detro:phantomjsdriver:1.2.0 and the Selenium 2.41.0 modules it introduces.
  • net.bytebuddy:byte-buddy and net.bytebuddy:byte-buddy-agent.
  • Messages such as “omitted for conflict,” “nearest,” a classifier mismatch, or a Maven Enforcer dependency-convergence failure.

If the project uses Gradle, generate the equivalent evidence with:

./gradlew dependencies --configuration testRuntimeClasspath
./gradlew dependencyInsight --dependency selenium --configuration testRuntimeClasspath
./gradlew dependencyInsight --dependency byte-buddy --configuration testRuntimeClasspath

Keep the first stack-trace cause, not only the final Maven or JVM message. It identifies whether the failure is version selection, a missing class, a linkage error, or Java module access.

2. Choose one Selenium architecture

Path When it fits Trade-off
Modern Selenium in the main module New browser tests, maintained browsers, and a supported Selenium release line Requires removing code that depends on PhantomJSDriver
Isolated legacy PhantomJS module A historical test must still execute through PhantomJS/GhostDriver Extra module/profile maintenance and no assumption that the old binding works with Selenium 4
RemoteWebDriver endpoint The browser is hosted separately or a legacy service exposes WebDriver remotely Requires an available endpoint and network configuration

The long-term default is the first path. Selenium’s Java installation guidance uses a build tool and the org.seleniumhq.selenium:selenium-java dependency. Its upgrade procedure changes the Maven Selenium version and then runs mvn clean compile.

3. Fix a modern Maven project

Make selenium-java the intentional entry point

Define one Selenium version in the parent POM or the application module, and use that property consistently. The exact 4.x release should be the one your Java runtime, browser drivers, and test framework support; do not mix release lines merely because Maven can resolve them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
<properties>
  <selenium.version>${selenium.version}</selenium.version>
</properties>

<dependencies>
  <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>${selenium.version}</version>
  </dependency>
</dependencies>

In a real POM, define selenium.version once with the tested release value in your project’s dependency-management section; the property above illustrates the single-version pattern rather than prescribing an unverified current release. Remove separate, directly declared Selenium 2 modules unless a specific library requires them and you have deliberately isolated that library.

Remove PhantomJSDriver when it is not mandatory

Delete this dependency from the modern module:

<dependency>
  <groupId>com.github.detro</groupId>
  <artifactId>phantomjsdriver</artifactId>
  <version>1.2.0</version>
</dependency>

Then migrate the test to a supported Selenium browser driver or to a RemoteWebDriver endpoint. GhostDriver documentation describes PhantomJS remote-WebDriver mode and notes that the latest stable GhostDriver is embedded in PhantomJS, but that legacy route does not turn the PhantomJSDriver binding into a Selenium 4 binding.

If another library pulls it transitively

Run the verbose tree and identify the parent dependency. Add an exclusion on that parent for the exact PhantomJSDriver coordinate, then keep selenium-java as the direct Selenium entry point. Exclusions should be based on the coordinate shown by your tree; do not exclude an arbitrary Selenium module and hope the graph becomes coherent.

4. Preserve a required PhantomJS test without contaminating modern tests

If a legacy test cannot be retired, put it in a separate Maven module or profile. The modern module receives only the selected Selenium release. The legacy module owns PhantomJSDriver and its old Selenium dependencies, and it is built and run independently.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
  1. Create a separate module with its own test source set and POM.
  2. Declare PhantomJSDriver there and inspect every Selenium transitive dependency it brings.
  3. Use explicit exclusions only after confirming the tree, then provide the versions that the legacy code actually compiles against.
  4. Do not publish the legacy module’s dependencies as runtime dependencies of the modern application.
  5. Run the legacy profile separately and document the Java version and PhantomJS executable or remote endpoint it requires.

Do not assume that excluding Selenium 2.41.0 and forcing Selenium 4 will make PhantomJSDriver compatible. Its classes were built against the older API, so isolation is safer than cross-generation substitution.

5. Align Byte Buddy and its variants

After Selenium versions are coherent, inspect Byte Buddy independently. Keep one intentional version of net.bytebuddy:byte-buddy and, if required by your test stack, a matching net.bytebuddy:byte-buddy-agent. Use Maven dependency management to override a transitive version only after checking that the selected Selenium and test libraries support it.

A Selenium issue opened on 2026-04-16 describes a subtle Enforcer case: changing net.bytebuddy:byte-buddy from 1.18.5 to 1.18.8-jdk5 can make Maven treat the JDK-specific variant as greater than managed 1.18.8. The result is a dependency compatibility complaint even though the numeric release appears close. Treat the classifier or variant as part of the identity when diagnosing it.

Use this pattern in dependency management, replacing the properties with versions validated for your build:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>net.bytebuddy</groupId>
      <artifactId>byte-buddy</artifactId>
      <version>${bytebuddy.version}</version>
    </dependency>
    <dependency>
      <groupId>net.bytebuddy</groupId>
      <artifactId>byte-buddy-agent</artifactId>
      <version>${bytebuddy.version}</version>
    </dependency>
  </dependencies>
</dependencyManagement>

If Enforcer still reports byte-buddy versus a JDK-specific artifact or classifier, find the dependency introducing the unwanted variant and exclude it there. A Selenium driver POM may already demonstrate exclusions for Byte Buddy artifacts; copy the principle, not an exclusion list from an unrelated project.

6. Clean, compile, and verify the selected graph

  1. Delete stale output with mvn clean (or the equivalent Gradle clean task).
  2. Refresh dependencies if your build cache may contain old metadata.
  3. Run mvn clean compile, followed by the project’s normal test command.
  4. Run mvn dependency:tree -Dverbose again and confirm that the modern module has one Selenium release line and the intended Byte Buddy artifacts.
  5. Exercise a real browser session or remote endpoint; compilation alone cannot prove driver compatibility.

If the remaining error is a Java module-access exception, capture the first “caused by” entry. Only then evaluate module-info.java or a narrowly scoped --add-opens option. There is no single module flag established for every Selenium, Byte Buddy, and PhantomJS combination.

Common errors and precise fixes

Symptom Likely cause Fix
Both Selenium 2.x and 4.x appear in the tree PhantomJSDriver or another legacy library is introducing Selenium 2.41.0 Remove PhantomJSDriver, or isolate it; keep one Selenium line in the modern module.
NoSuchMethodError or ClassNotFoundException in Selenium Classes were compiled against a different Selenium API than the one selected at runtime Inspect the runtime tree, remove duplicate declarations, and rebuild from a clean directory.
Maven Enforcer reports Byte Buddy convergence or classifier conflict Different byte-buddy, byte-buddy-agent, or JDK-specific variants are selected Manage one compatible version and exclude the introducing variant at its parent dependency.
Compilation succeeds but PhantomJS startup fails The old driver, PhantomJS executable, or remote GhostDriver endpoint is unavailable or incompatible Keep the legacy test isolated and verify its executable or endpoint; migrate to a supported driver when possible.
Adding --add-opens changes nothing The root problem is still dependency linkage, not module access Return to the first stack-trace cause and dependency tree before adding JVM flags.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Build reliability, performance, and maintenance

  • A dependency-tree report is diagnostic work performed at build time; it does not add browser runtime overhead.
  • One managed Selenium line and one intentional Byte Buddy set make clean, repeatable builds more likely than relying on Maven’s nearest-wins choice.
  • An isolated legacy module increases build configuration, but prevents PhantomJS dependencies from destabilizing current browser tests.
  • PhantomJS support carries ongoing maintenance risk because its driver artifact is from a 2015-era line. Treat continued use as a compatibility exception with an exit plan.
  • No special purchase is required to apply this fix: the relevant work is dependency management, module separation, and verification in your existing build.

Or skip the browser setup

If your actual goal is a static website image or PDF rather than an interactive Selenium test, ScreenshotNeo avoids maintaining browser-driver code. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.

Use the documented API options at ScreenshotNeo’s documentation. A single request is enough:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

The same call from Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Or Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Every plan includes the same feature set, including full-page and element capture, device and retina settings, PDF controls, custom CSS or JavaScript, waits, request blocking, headers and cookies, geolocation, caching, signed links, asynchronous webhooks, bulk capture of up to 100 URLs per call, and a usage API. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Create a free ScreenshotNeo account to try it without a card.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

FAQ

Can Maven’s nearest dependency rule safely choose between Selenium 2 and Selenium 4?

No. Nearest-wins only determines which artifact version is selected; it does not make APIs from different Selenium generations compatible. Make the release line an explicit project decision.

Do I need both Byte Buddy and byte-buddy-agent?

Only if a library in your test stack requires the agent. Confirm that requirement in the dependency tree and keep versions aligned rather than adding the agent speculatively.

Is PhantomJSDriver a browser-page bug?

Usually not. When the failure appears during dependency resolution, compilation, class loading, or module startup, fix the graph first. A page-level failure should be investigated only after the selected dependencies are coherent.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Can Maven’s nearest dependency rule safely choose between Selenium 2 and Selenium 4?

No. It selects an artifact version but cannot make APIs from different Selenium generations compatible.

Do I need both Byte Buddy and byte-buddy-agent?

Only when a library in your test stack requires the agent; verify that requirement in the resolved dependency tree.

Is PhantomJSDriver a browser-page bug?

Usually not when the error occurs during dependency resolution, compilation, class loading, or module startup.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.