Exception in thread "main" java.lang.NoClassDefFoundError: javax/websocket/DeploymentException
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.3k
- Forks
- 752
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 8
Description
The problem
Exception in thread "main" java.lang.NoClassDefFoundError: javax/websocket/DeploymentException
at io.appium.java_client.android.ListensToLogcatMessages.(ListensToLogcatMessages.java:34)
at scr.main(scr.java:36)
Caused by: java.lang.ClassNotFoundException: javax.websocket.DeploymentException
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 2 more
Environment
*Java-client jar:7.0
*Selenium server standalone jar:3.12
- Appium version (or git revision) that exhibits the issue:1.10.1
- Node.js version (unless using Appium.app|exe):10.15.0
- Npm or Yarn package manager:6.4.1
- Mobile platform/version under test:Android 8.0
- Real device or emulator/simulator:Real Device
- Appium CLI :1.10.1
*Eclipse IDE:4.10
*Guava jar
Details
Facing the No class found exception while running the automation scripts in eclipse.
Added the guava jar as suggested by https://github.com/SeleniumHQ/selenium/issues/4627. However, this does not resolve the issue. No logs are available in Appium. From my knowledge, it had issues while hitting the server. We are trying Test.AI which requires us to use the latest version.
Link to Appium logs
Code To Reproduce Issue [ Good To Have ]
import java.net.*;
import java.util.HashMap;
import org.openqa.selenium.*;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.*;
import io.appium.java_client.android.AndroidDriver;
public class scr {
@SuppressWarnings("rawtypes")
public static AppiumDriver driver;
@SuppressWarnings("rawtypes")
public static void main(String[] args) throws MalformedURLException{
// TODO Auto-generated method stub
DesiredCapabilities capability=new DesiredCapabilities();
capability.setCapability("platformName","Android");
capability.setCapability("platformVersion","8.0");
capability.setCapability("automationName", "uiautomator2");
capability.setCapability("deviceName","Nexus 5X");
capability.setCapability("noReset",true);
capability.setCapability("browserName","chrome");
capability.setCapability("appPackage","com.flipkart.android");
capability.setCapability("appActivity","com.flipkart.android.SplashActivity");
HashMap<String, String> customFindModules = new HashMap<>();
customFindModules.put("ai", "test-ai-classifier");
capability.setCapability("customFindModules", customFindModules);
capability.setCapability("shouldUseCompactResponses", false);
driver=new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),capability);
driver.findElement("-custom","ai:cart").click();
driver.quit();
}
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Eclipse run from scr.java:36 and inspect the runtime dependencies around ListensToLogcatMessages.java:34, using the reported Java-client 7.0 and Selenium 3.12 versions. Done means the sample starts without the reported NoClassDefFoundError; confirm the result with Appium 1.10.1 and capture the relevant dependency and classpath details.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100