Not creating session with Emulator

Getting error “A new session could not be created. (Original error: Requested a new session but one was in progress) (WARNING: The server did not provide any stacktrace information)”

I had restarted the Appium before I run the script. It took a lot time and at fail it thrown me the above message.

Trying to launch app in Emulator with “AppiumForWindows-”.

Following is the code:

package mobileOne;

import io.appium.java_client.AppiumDriver;

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.;
import org.testng.

public class whatsappTest {

WebDriver driver = null;
public void atStart() throws MalformedURLException, InterruptedException


    File app = new File("D:\\APKs\\5767.apk");

    DesiredCapabilities capabilities = new DesiredCapabilities();

    capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
    capabilities.setCapability("deviceName", "Nexus");
    capabilities.setCapability("platformVersion", "4.4.2");
    //capabilities.setCapability(CapabilityType.VERSION, "4.1.2");

    capabilities.setCapability(CapabilityType.PLATFORM, "WINDOWS");

    capabilities.setCapability("platformName", "Android");
    //capabilities.setCapability(CapabilityType.PLATFORM, "Android");

    capabilities.setCapability("app", app.getAbsolutePath());

    capabilities.setCapability("appPackage", "com.mlsdev.drive2day"); //Replace with your app's package
    capabilities.setCapability("appActivity", "com.mlsdev.drive2day.ui.activity.MainActivity"); //Replace with app's Activity

    driver = new AndroidDriver(new URL(""), capabilities);
    driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
public void testCase()
    public void atEnd()


USB debugging is enabled in the emulator

More details:
Using Appium java client 2.0.0
Eclipse - eclipse-jee-juno-SR2-win32-x86_64

Please let me know what am I doing wrong.

There is no error in the code above but the node.js was not installed on the machine.
PLZ do download .msi for windows and not the exe from the
The wrong directions from one of the mobile automation training website wasted my 4 days to figure this out.

Can you please explain in details how did you fix this issue? I mean how is that installing NODE.JS msi fixed - "A new session could not be created. (Original error: Requested a new session but one was in progress) error?


@ Abhay: I just had a review on per-requisites for appium, where I found running node.js exe seemed doubtful; hence I installed node.js msi and (hurray) it worked.
You may try it.