org.openqa.selenium.WebDriverException: java.lang.NoSuchMethodException: org.openqa.selenium.remote.ProtocolHandshake.createSession(org.openqa.selenium.remote.http.HttpHandler,java.util.function.Supplier,long)

Hi, Since this morning we are experiencing weird issues: without having changed any code (I verified it), Java client seems to be unable to connect to Appium.
This happens no matter if it’s a local appium, Saucelabs or whatever, it just breaks before even reaching the server.
I tried to debug it, the URL seems correct, and so are the capabilities, but when it tries to instantiate either AndroidDriver or IosDriver I get
[Guice/ErrorInjectingConstructor]: SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

Guice is there because I use it for dependency injection, however the cause is this line:
Caused by: org.openqa.selenium.WebDriverException: java.lang.NoSuchMethodException: org.openqa.selenium.remote.ProtocolHandshake.createSession(org.openqa.selenium.remote.http.HttpHandler,java.util.function.Supplier,long)
Up to yesterday it was working, both with appium 9.0.0 and 9.2.0.

This is my actual pom.xml

mypom.txt (9.4 KB)

I was having the issue. I downgraded to 8.6.0. and it started to work just fine. I noticed Appium 9.+ is using selenium 4.19.0 → “mvn dependency:tree”

2 Likes

has the save problem

Woww it solved the problem
thanks alot :grinning:

Same problem here. The issue starts from version 9.0 of the appium-java client but I can’t find why. Debugging the initialization of the driver brings me till the startSession method in AppiumDriver but I can’t get more useful feedback.

I also carefully read the information about the breaking changes here: java-client/docs/v8-to-v9-migration-guide.md at master · appium/java-client · GitHub, but nothing rings a bell: I use Java 17 for a while now, and I checked that I don’t use in my code any of the removed methods.

I’ll stick to 8.6.0 for now but I’d like to understand why it does not seem possible to upgrade the appium java client to 9.x.

Update to v. 9.2.2
Always check the compatibility matrix to see if the current java client version is compatible to the selenium one

3 Likes

top tip @mykola-mokhnach . Thanks, bookmarked

Thanks @mykola-mokhnach , it worked for me as well. I wasn’t aware of that compatibility matrix, bookmarked now.

1 Like

Oh goodness… It worked, thanks