appium / appium/java-client

Exception in thread "main" java.lang.NoClassDefFoundError: javax/websocket/DeploymentException

Open
#1,102 2 comments 0 reactions 0 assignees View on GitHub

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

  • 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
    *Selenium server standalone jar:3.12
    *Java-client jar:7.0
    *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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing scr.java at the AndroidDriver initialization, using the Eclipse classpath with Appium Java client 7.0 and Selenium standalone 3.12. Trace why ListensToLogcatMessages cannot load javax.websocket.DeploymentException; done means the sample reaches the Appium server without the NoClassDefFoundError.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.