SessionNotCreatedException: A new session could not be created

I am getting an error when running my .java file containing the following code from eclipse,
//-----------------------------------------------------------------------------------------------------//
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.ios.IOSDriver;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.By;
import org.openqa.selenium.remote.DesiredCapabilities;

public class appiumTest {

static AppiumDriver driver;

public static void main(String[] args) throws MalformedURLException, InterruptedException {
	// TODO Auto-generated method stub
	//192.168.6.114
	System.out.println("Starting . . . ");
	DesiredCapabilities capabilities = new DesiredCapabilities();
	capabilities.setCapability("platformVersion", "8.1");
	capabilities.setCapability("platformName", "iOS");
	capabilities.setCapability("deviceName", "iPhone 6");
	File app = new File("/Users/user/Documents/TestApp/Joyious.app");
	capabilities.setCapability("app", app.getAbsolutePath());
	driver = new IOSDriver(new URL("http://127.0.0.1:4725/wd/hub"),capabilities);
	Thread.sleep(8000);
	driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
	
	
	driver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIANavigationBar[1]/UIAButton[1]")).click();
	Thread.sleep(3000);
	System.out.println("Thats all folks!");
	
}

}
//-----------------------------------------------------------------------------------------------------//

I am getting the following error in eclipse console;
//-----------------------------------------------------------------------------------------------------//
Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: App did not have elements) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 49.54 seconds
Build info: version: ‘2.45.0’, revision: ‘32a636c’, time: ‘2015-03-05 22:01:35’
System info: host: ‘Joyious-minimac-2.local’, ip: ‘192.168.6.114’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.10.2’, java.version: ‘1.8.0_45’
Driver info: io.appium.java_client.ios.IOSDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:180)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:153)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:109)
at io.appium.java_client.ios.IOSDriver.(IOSDriver.java:23)
at appiumTest.main(appiumTest.java:32)

//-----------------------------------------------------------------------------------------------------//

My appium version is 1.3.7
x code is 6.1

Please let me know why this is happening

Please make sure that Appium Server is running…!!!

Regards,
Bhaskar.

@bhaskar . Yes it is running and the simulator successfully launches the app, but it freezes soon. and I am getting this error. (Thanks @bhaskar for the quick reply )

met same issue. appium 1.4.0, iOS Simulator.
Never saw with Appium 1.3.6.
Add retries to start driver. (helps us to avoid such minor issues sometimes)