Selendroid working with Skype apk; not with other apps - android

Need your help with selendroid. Am a new to it and still learning the tricks.
Tried with the basic selendroid app example and the same with Skype apk, it worked perfectly.
However, when tried with other app's apk like tripadvisor and dropbox, I keep getting error.
Following is my code and the error from console . Am using the version details from the manifest xml.
On further exploration -
I compared the manifest xml file of skype, dropbox, etc ... and see permission tag with protection level as 'Signature' for dropbox, tripadvisor. However the same is not present in the skype manifest file. Could this be hindering with our code.
If so, is there any workaround?
Any help with this is much appreciated.
Code -
package testSelendroid;
import java.net.URL;
import io.selendroid.SelendroidCapabilities;
import io.selendroid.SelendroidDriver;
import io.selendroid.device.DeviceTargetPlatform;
import org.openqa.selenium.WebDriver;
public class selendroidNativeAppTest {
public static void main(String Args[])
{
WebDriver driver = null ;
//Below versions from Manifest files
//com.skype.raider:3.2.0.6673
//com.dropbox.android:2.3.8
//io.selendroid.testapp:0.10.0
SelendroidCapabilities caps = new SelendroidCapabilities("com.dropbox.android:2.3.8") ;
System.out.println("I am here");
caps.setPlatformVersion(DeviceTargetPlatform.ANDROID19);
System.out.println("I just reached here");
caps.setEmulator(true);
System.out.println("Passed emulator");
//caps.setCapability(CapabilityType.BROWSER_NAME, "Android");
//caps.setCapability("app-package", "com.tripadvisor.tripadvisor:8.7.1-release");
try {
System.out.println("Let me try");
driver = new SelendroidDriver(new URL("http://localhost:4444/wd/hub"), caps);
System.out.println("Driver ...");
driver.switchTo().window("NATIVE_APP");
System.out.print("Got the app");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Console -
I am here
I just reached here
Passed emulator
Let me try
org.openqa.selenium.SessionNotCreatedException: Error occurred while starting selendroid-server on the device
io.selendroid.exceptions.SelendroidException: Error occurred while starting selendroid-server on the device
at io.selendroid.android.impl.AbstractDevice.startSelendroid(AbstractDevice.java:235)
at io.selendroid.server.model.SelendroidStandaloneDriver.createNewTestSession(SelendroidStandaloneDriver.java:290)
at io.selendroid.server.handler.CreateSessionHandler.handle(CreateSessionHandler.java:42)
at io.selendroid.server.SelendroidServlet.handleRequest(SelendroidServlet.java:142)
at io.selendroid.server.BaseServlet.handleHttpRequest(BaseServlet.java:70)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:62)
at org.webbitserver.handler.PathMatchHandler.handleHttpRequest(PathMatchHandler.java:33)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:62)
at org.webbitserver.handler.DateHeaderHandler.handleHttpRequest(DateHeaderHandler.java:21)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:62)
at org.webbitserver.handler.ServerHeaderHandler.handleHttpRequest(ServerHeaderHandler.java:25)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:67)
at org.webbitserver.netty.NettyHttpChannelHandler$2.run(NettyHttpChannelHandler.java:72)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Throwable: android.util.AndroidException: INSTRUMENTATION_FAILED: io.selendroid.com.dropbox.android/io.selendroid.ServerInstrumentation
at com.android.commands.am.Am.runInstrument(Am.java:865)
at com.android.commands.am.Am.onRun(Am.java:282)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:76)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
at dalvik.system.NativeStart.main(Native Method)
Details:
INSTRUMENTATION_STATUS: id=ActivityManagerService
INSTRUMENTATION_STATUS: Error=Unable to find instrumentation target package: com.dropbox.android
INSTRUMENTATION_STATUS_CODE: -1
android.util.AndroidException: INSTRUMENTATION_FAILED: io.selendroid.com.dropbox.android/io.selendroid.ServerInstrumentation
at com.android.commands.am.Am.runInstrument(Am.java:865)
at com.android.commands.am.Am.onRun(Am.java:282)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:76)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
at dalvik.system.NativeStart.main(Native Method)
... 20 more
Command duration or timeout: 320.45 seconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'ECXIPSAGT6504', ip: '172.25.2.91', os.name: 'Windows Server 2008 R2', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_51'
Driver info: io.selendroid.SelendroidDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:139)
at io.selendroid.SelendroidDriver.<init>(SelendroidDriver.java:63)
at testSelendroid.selendroidNativeAppTest.main(selendroidNativeAppTest.java:36)
Caused by: io.selendroid.exceptions.SelendroidException: Error occurred while starting selendroid-server on the device
io.selendroid.exceptions.SelendroidException: Error occurred while starting selendroid-server on the device
at io.selendroid.android.impl.AbstractDevice.startSelendroid(AbstractDevice.java:235)
at io.selendroid.server.model.SelendroidStandaloneDriver.createNewTestSession(SelendroidStandaloneDriver.java:290)
at io.selendroid.server.handler.CreateSessionHandler.handle(CreateSessionHandler.java:42)
at io.selendroid.server.SelendroidServlet.handleRequest(SelendroidServlet.java:142)
at io.selendroid.server.BaseServlet.handleHttpRequest(BaseServlet.java:70)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:62)
at org.webbitserver.handler.PathMatchHandler.handleHttpRequest(PathMatchHandler.java:33)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:62)
at org.webbitserver.handler.DateHeaderHandler.handleHttpRequest(DateHeaderHandler.java:21)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:62)
at org.webbitserver.handler.ServerHeaderHandler.handleHttpRequest(ServerHeaderHandler.java:25)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:67)
at org.webbitserver.netty.NettyHttpChannelHandler$2.run(NettyHttpChannelHandler.java:72)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Throwable: android.util.AndroidException: INSTRUMENTATION_FAILED: io.selendroid.com.dropbox.android/io.selendroid.ServerInstrumentation
at com.android.commands.am.Am.runInstrument(Am.java:865)
at com.android.commands.am.Am.onRun(Am.java:282)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:76)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
at dalvik.system.NativeStart.main(Native Method)
Details:
INSTRUMENTATION_STATUS: id=ActivityManagerService
INSTRUMENTATION_STATUS: Error=Unable to find instrumentation target package: com.dropbox.android
INSTRUMENTATION_STATUS_CODE: -1
android.util.AndroidException: INSTRUMENTATION_FAILED: io.selendroid.com.dropbox.android/io.selendroid.ServerInstrumentation
at com.android.commands.am.Am.runInstrument(Am.java:865)
at com.android.commands.am.Am.onRun(Am.java:282)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:76)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
at dalvik.system.NativeStart.main(Native Method)
... 20 more

Check the SelendroidCapabilities id.
First run the server then go to Browser and run localhost URL at 4444 port
And if the Server returns the valid JSON then check the application ID and paste it into your
SelendroidCapabilities("com.dropbox.android:2.3.8")
Then run the JAVA project.
You will get rid from this problem.
If you still find any problem. tell me
Best luck

Related

Displaying an error as "app " option required to reinstall while the appium program

I am getting exception while running appium program. Please ask if extra information needed.
TLDR:
original error: 'app' option is required for reinstall
log4j:WARN No appenders could be found for logger
(org.apache.http.client.protocol.RequestAddCookies). log4j:WARN Please
initialize the log4j system properly. log4j:WARN See
http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" org.openqa.selenium.WebDriverException: An
unknown server-side error occurred while processing the command.
Original error: 'app' option is required for reinstall Build info:
version: '3.8.1', revision: '6e95a6684b', time:
'2017-12-01T19:05:14.666Z' System info: os.name: 'Windows 7', os.arch: 'amd64', os.version:
'6.1', java.version: '1.8.0_151' Driver info: driver.version:
AndroidDriver remote stacktrace: UnknownError: An unknown server-side
error occurred while processing the command. Original error: 'app'
option is required for reinstall
at getResponseForW3CError (C:\Users\preethi.g\AppData\Local\appium-desktop\app-1.10.0\resources\app\node_modules\appium-base-driver\lib\protocol\errors.js:826:9)
at asyncHandler (C:\Users\preethi.g\AppData\Local\appium-desktop\app-1.10.0\resources\app\node_modules\appium-base-driver\lib\protocol\protocol.js:447:37)
at process._tickCallback (internal/process/next_tick.js:68:7) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source) at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source) at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.openqa.selenium.remote.W3CHandshakeResponse.lambda$new$0(W3CHandshakeResponse.java:57)
at
org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction$2(W3CHandshakeResponse.java:104)
at
org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:123)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at
java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source) at
java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown
Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at
java.util.stream.ReferencePipeline.findFirst(Unknown Source) at
org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at
org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
at
org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at
io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:89)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at
io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at
io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
at
org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142)
at
io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:83)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:93)
at
io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:72)
at Mobileapp1.Apptesting.main(Apptesting.java:24)
It seems like you did not add "app" capability in your DesiredCapability and you are using noReset capability. You can add "app" capability and give .ipa or .apk file location.
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(MobileCapabilityType.APP, "path to ipa/apk file" );
//others capabilities

gradlew assembleRelease Fails With java.lang.ClassNotFoundException: com.sun.tools.javac.util.Context

Sidenote - this post is similar (but not identical) to compileReleaseKotlin fails with java.lang.ClassNotFoundException: com.sun.tools.javac.util.Context, but I thought I'd make my own post with more details about my situation in order to get the best feedback possible. Also, I tried all the solutions in that post, and none of them worked.
I am trying to generate an unsigned release APK for my app. To do that, I use the command gradlew assembleRelease.
I get the following error:
Caught an exception trying to connect to Kotlin Daemon
java.lang.ClassNotFoundException: com.sun.tools.javac.util.Context
at java.base/java.net.URLClassLoader.findClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Unknown Source)
at org.jetbrains.kotlin.gradle.tasks.JarSearchingUtilKt.findToolsJ
ar(jarSearchingUtil.kt:79)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerEnvironment$t
oolsJar$2.invoke(GradleCompilerEnvironment.kt:20)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerEnvironment$t
oolsJar$2.invoke(GradleCompilerEnvironment.kt:14)
at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:130)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerEnvironment.g
etToolsJar(GradleCompilerEnvironment.kt)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerEnvironment.g
etCompilerFullClasspath(GradleCompilerEnvironment.kt:23)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.getDae
monConnection(GradleKotlinCompilerRunner.kt:336)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.compil
eWithDaemon(GradleKotlinCompilerRunner.kt:181)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.compil
eWithDaemonOrFallback(GradleKotlinCompilerRunner.kt:156)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.compil
eWithDaemonOrFallback(GradleKotlinCompilerRunner.kt:53)
at org.jetbrains.kotlin.compilerRunner.KotlinCompilerRunner.runCom
piler(KotlinCompilerRunner.kt:127)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.runJvm
Compiler(GradleKotlinCompilerRunner.kt:108)
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler$ko
tlin_gradle_plugin(Tasks.kt:378)
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler$ko
tlin_gradle_plugin(Tasks.kt:253)
at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.execute
(Tasks.kt:215)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0
(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.inv
oke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:7
3)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskActi
on.doExecute(IncrementalTaskAction.java:46)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.
execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.
execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecu
ter$1.run(ExecuteActionsTaskExecuter.java:121)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$Runn
ableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$Runn
ableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.exec
ute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(
DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecu
ter.executeAction(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecu
ter.executeActions(ExecuteActionsTaskExecuter.java:92)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecu
ter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreating
TaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecute
r.execute(SkipUpToDateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachin
gStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.
execute(ValidatingTaskExecuter.java:60)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTas
kExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExec
uter.execute(CleanupStaleOutputsExecuter.java:87)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStat
eTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsEx
ecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.
execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskEx
ecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecu
ter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFi
ringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$Runn
ableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$Runn
ableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.exec
ute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(
DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFi
ringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFi
ringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute
(DefaultTaskExecutionPlan.java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute
WithTask(DefaultTaskExecutionPlan.java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFai
lures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(Manage
dExecutorImpl.java:46)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unk
nown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Un
known Source)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadR
unnable.run(ThreadFactoryImpl.java:55)
at java.base/java.lang.Thread.run(Unknown Source)
Could not perform incremental compilation: Could not connect to Kotlin com
pile daemon
Could not connect to kotlin daemon. Using fallback strategy.
e: java.lang.ClassNotFoundException: com.sun.tools.javac.util.Context
at java.base/java.net.URLClassLoader.findClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Unknown Source)
at org.jetbrains.kotlin.gradle.tasks.JarSearchingUtilKt.findToolsJ
ar(jarSearchingUtil.kt:79)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerEnvironment$t
oolsJar$2.invoke(GradleCompilerEnvironment.kt:20)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerEnvironment$t
oolsJar$2.invoke(GradleCompilerEnvironment.kt:14)
at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:130)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerEnvironment.g
etToolsJar(GradleCompilerEnvironment.kt)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerEnvironment.g
etCompilerFullClasspath(GradleCompilerEnvironment.kt:23)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.compil
eOutOfProcess(GradleKotlinCompilerRunner.kt:303)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.compil
eWithDaemonOrFallback(GradleKotlinCompilerRunner.kt:171)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.compil
eWithDaemonOrFallback(GradleKotlinCompilerRunner.kt:53)
at org.jetbrains.kotlin.compilerRunner.KotlinCompilerRunner.runCom
piler(KotlinCompilerRunner.kt:127)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.runJvm
Compiler(GradleKotlinCompilerRunner.kt:108)
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler$ko
tlin_gradle_plugin(Tasks.kt:378)
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler$ko
tlin_gradle_plugin(Tasks.kt:253)
at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.execute
(Tasks.kt:215)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0
(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.inv
oke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:7
3)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskActi
on.doExecute(IncrementalTaskAction.java:46)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.
execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.
execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecu
ter$1.run(ExecuteActionsTaskExecuter.java:121)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$Runn
ableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$Runn
ableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.exec
ute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(
DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecu
ter.executeAction(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecu
ter.executeActions(ExecuteActionsTaskExecuter.java:92)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecu
ter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreating
TaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecute
r.execute(SkipUpToDateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachin
gStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.
execute(ValidatingTaskExecuter.java:60)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTas
kExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExec
uter.execute(CleanupStaleOutputsExecuter.java:87)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStat
eTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsEx
ecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.
execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskEx
ecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecu
ter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFi
ringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$Runn
ableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$Runn
ableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.exec
ute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(
DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFi
ringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFi
ringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute
(DefaultTaskExecutionPlan.java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute
WithTask(DefaultTaskExecutionPlan.java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFai
lures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(Manage
dExecutorImpl.java:46)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unk
nown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Un
known Source)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadR
unnable.run(ThreadFactoryImpl.java:55)
at java.base/java.lang.Thread.run(Unknown Source)
Here's some more information about my current situation:
I'm using Windows 10.
This is the result of gradlew assembleRelease --scan. It contains a lot of detailed information that could be useful for debugging.
https://scans.gradle.com/s/sohrhovsc676e/
In Android Studio, I went to "File -> Project Structure" and changed my JDK location from
"C:\Program Files\Android\Android Studio\jre" (embedded JDK)
to
"C:\Program Files\Java\jdk1.8.0_172" (JDK 8), which I got from here.
This failed to solve the problem.
I have also added "C:\Program Files\Java\jdk1.8.0_172\bin" to my System Path variable.
I also uploaded my project to Github, incase anyone needs to see it.
https://github.com/vedantroy/recyclerview-test
Also, I previously tried replacing implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" with implementation"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version", but that didn't work either.
Edit 1 -
I tried switching my Build Variant to "release" and then building an APK and that seemed to work. However, I'm not sure if that produces the same result as gradlew assembleRelease
In my case, this started happening after a Java update. It turns out the JRE was updated but the JDK was not.
Try: install the new JDK update, uninstall old versions, and reopen any shell/ps/cmd sessions/windows. It may be necessary to kill existing Gradle daemons but it should be smart enough not to reuse them. Try your build again!

Cordova Run Error - Proxy?

I'm on Windows 7, I set all my proxies. As you can see it fails with error code 8, but anything I search for seems not to match my problem exactly.
When I try to build and run my app in cordova, I get this error. I have no idea what to do! Any advice? Thanks everyone!
C:\Users\310202751\Documents\CordovaProjects\Locator>cordova run
Running command: cmd "/s /c "C:\Users\310202751\Documents\CordovaProjects\Locato
r\platforms\android\cordova\run.bat""
ANDROID_HOME=C:\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_45
WARNING : No target specified, deploying to device '84deb82e'.
Running: C:\Users\310202751\Documents\CordovaProjects\Locator\platforms\android\
gradlew cdvBuildDebug -b C:\Users\310202751\Documents\CordovaProjects\Locator\pl
atforms\android\build.gradle -PcdvBuildArch=arm -Dorg.gradle.daemon=true
Downloading http://services.gradle.org/distributions/gradle-2.2.1-all.zip
Exception in thread "main" java.lang.RuntimeException: java.net.ConnectException
: Connection refused: connect
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketI
mpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.ja
va:345)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocket
Impl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java
:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
at sun.net.www.http.HttpClient.New(HttpClient.java:308)
at sun.net.www.http.HttpClient.New(HttpClient.java:326)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLC
onnection.java:1168)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConn
ection.java:1104)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConne
ction.java:998)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection
.java:932)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLCo
nnection.java:1512)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:1440)
at org.gradle.wrapper.Download.downloadInternal(Download.java:59)
at org.gradle.wrapper.Download.download(Download.java:45)
at org.gradle.wrapper.Install$1.call(Install.java:60)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.java:65)
... 3 more

Worklight Flight Ticket Sample App, push notification issues

I have installed the Worklight Flight Ticket Sample App in Eclipse and Worklight 6.1.from http://ibm.co/1oJaz71
I have followed your instructions on this forum http://bit.ly/1kOPveN to create a senderID and API key on the Google Developer site: http://developer.android.com/google/gcm/gs.html
I have inserted the senderID and API key in the application-descriptor.xml file as follows: (I have replaced the actual values with "..." for the purpose of this post).
<android version="1.0">
<worklightSettings include="true"/>
<pushSender key="......." senderId="....."/>
<security>
<encryptWebResources enabled="false"/>
<testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif,
mp4, mp3"/>
<publicSigningKey>Replace this text with the public key of the certificate with
which you sign the APK. For details see the Worklight Developer's Reference Guide.
</publicSigningKey>
</security>
</android>
Please note: I have not inserted my , since I am running in the emulator and haven't seen any requirement in the documentation to do so.
Now when I run the app in the emulator it comes up and and I get the following pop-up:
Failed registering for push notifications
The application will not be able to receive notifications.
Your device does not support GCM. Device does not have package com.google.android.gsf.
If you are using an android emulator make sure it has Google APIs (Google Inc).
Now, in the Android SDK manager I have already installed Google APIs.
Also, when I click on the OK button in the popup window, I soon get a second popup which says:
Confirm. Do you allow Flight Ticket to send notification to you Cancel/OK.
I click OK, and then again soon the first popup window shows up:
Failed registering for push notifications
The application will not be able to receive notifications.
Your device does not support GCM. Device does not have package com.google.android.gsf.
If you are using an android emulator make sure it has Google APIs (Google Inc).
How do you suggest that I debug this?
I am appending part of the error log:
Listening for transport dt_socket at address: 10777
Launching worklight (WebSphere Application Server 8.5.5.0/wlp-1.0.3.20130524-0951) on Java HotSpot(TM) Client VM, version 1.7.0_45-b18 (en_US)
[AUDIT ] CWWKE0001I: The server worklight has been launched.
[AUDIT ] CWWKZ0058I: Monitoring dropins for applications.
[AUDIT ] CWWKT0016I: Web application available (default_host): http://ADMINIB-3IAG8DV:10080/module_60_4_FlightTicket/
[AUDIT ] CWWKZ0001I: Application module_60_4_FlightTicket started in 7.968 seconds.
[AUDIT ] CWWKT0016I: Web application available (default_host): http://ADMINIB-3IAG8DV:10080/_MobileBrowserSimulator/
[AUDIT ] CWWKZ0001I: Application _MobileBrowserSimulator started in 0.076 seconds.
[AUDIT ] CWWKF0011I: The server worklight is ready to run a smarter planet.
[ERROR ] FWLSE0099E: An error occurred while invoking procedure [project module_60_4_FlightTicket]FTAdapter/HttpRequestFWLSE0100E: parameters: [project module_60_4_FlightTicket]{
"arr": [
{
"body": {
"content": "oneWay=true&fromDate=1392526800000&toAirport=HKG&fromAirport=LHR&returnDate=1392526800000",
"contentType": "application\/x-www-form-urlencoded; charset=UTF-8"
},
"headers": {
"HOST": "localhost"
},
"method": "POST",
"path": "\/flightticket\/service\/flights\/queryflights",
"returnedContentType": "json"
}
]
}
Http request failed: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:9080 refused
FWLSE0101E: Caused by: [project module_60_4_FlightTicket]org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:9080 refusedjava.lang.RuntimeException: Http request failed: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:9080 refused
at com.worklight.adapters.http.HTTPConnectionManager.execute(HTTPConnectionManager.java:241)
at com.worklight.adapters.http.HttpClientContext.doExecute(HttpClientContext.java:176)
at com.worklight.adapters.http.HttpClientContext.execute(HttpClientContext.java:160)
at com.worklight.adapters.http.HTTP.execRequest(HTTP.java:135)
at com.worklight.adapters.http.HTTP.invoke(HTTP.java:124)
at com.worklight.integration.model.ProcedureInvoker.invokeProcedure(ProcedureInvoker.java:57)
at com.worklight.integration.model.Procedure.invoke(Procedure.java:166)
at com.worklight.integration.model.InvocationContext.call(InvocationContext.java:169)
at com.worklight.integration.model.InvocationContext.call(InvocationContext.java:38)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.worklight.integration.model.InvocationContext$DirectExecutorService.execute(InvocationContext.java:284)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at com.worklight.integration.model.InvocationContext.submit(InvocationContext.java:138)
at com.worklight.integration.model.InvocationContextManager.submitInvocation(InvocationContextManager.java:58)
at com.worklight.integration.services.impl.DataAccessServiceImpl.callProcedure(DataAccessServiceImpl.java:484)
at com.worklight.integration.services.impl.DataAccessServiceImpl.access$100(DataAccessServiceImpl.java:56)
at com.worklight.integration.services.impl.DataAccessServiceImpl$4.execute(DataAccessServiceImpl.java:387)
at com.worklight.core.auth.impl.AuthenticationServiceBean.accessResource(AuthenticationServiceBean.java:76)
at com.worklight.integration.services.impl.DataAccessServiceImpl.invokeProcedureInternal(DataAccessServiceImpl.java:384)
at com.worklight.integration.services.impl.DataAccessServiceImpl.invokeDynamicProcedure(DataAccessServiceImpl.java:443)
at com.worklight.integration.services.impl.DataAccessServiceImpl.invokeDynamicProcedure(DataAccessServiceImpl.java:427)
at com.worklight.integration.js.JavaScriptIntegrationLibraryImplementation.invokeDynamicProcedure(JavaScriptIntegrationLibraryImplementation.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)
at org.mozilla.javascript.gen._integration_js_1._c_anonymous_10(/integration.js:95)
at org.mozilla.javascript.gen._integration_js_1.call(/integration.js)
at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
at org.mozilla.javascript.gen.C_3A_5Ceclipsekepler_5Cmodule_60_4_FlightTicket_5Cadapters_5CFTAdapter_FTAdapter_impl_js_5._c_FlightsREST_getTripFlights_6(C%3A%5Ceclipsekepler%5Cmodule_60_4_FlightTicket%5Cadapters%5CFTAdapter/FTAdapter-impl.js:64)
at org.mozilla.javascript.gen.C_3A_5Ceclipsekepler_5Cmodule_60_4_FlightTicket_5Cadapters_5CFTAdapter_FTAdapter_impl_js_5.call(C%3A%5Ceclipsekepler%5Cmodule_60_4_FlightTicket%5Cadapters%5CFTAdapter/FTAdapter-impl.js)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at org.mozilla.javascript.gen.C_3A_5Ceclipsekepler_5Cmodule_60_4_FlightTicket_5Cadapters_5CFTAdapter_FTAdapter_impl_js_5.call(C%3A%5Ceclipsekepler%5Cmodule_60_4_FlightTicket%5Cadapters%5CFTAdapter/FTAdapter-impl.js)
at com.worklight.integration.js.JavaScriptManager.callFunction(JavaScriptManager.java:240)
at com.worklight.integration.js.JavaScriptManager.invokeFunction(JavaScriptManager.java:214)
at com.worklight.integration.js.JavaScriptManager.invokeFunction(JavaScriptManager.java:194)
at com.worklight.integration.services.impl.AdapterManagerImpl.invokeFunction(AdapterManagerImpl.java:104)
at com.worklight.integration.js.JavaScriptProcedureInvoker.invoke(JavaScriptProcedureInvoker.java:42)
at com.worklight.integration.model.ProcedureInvoker.invokeProcedure(ProcedureInvoker.java:57)
at com.worklight.integration.model.Procedure.invoke(Procedure.java:166)
at com.worklight.integration.model.InvocationContext.call(InvocationContext.java:169)
at com.worklight.integration.model.InvocationContext.call(InvocationContext.java:38)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at com.worklight.server.util.ProjectLocal$1RunnableWrapper.run(ProjectLocal.java:267)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:9080 refused
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:158)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:573)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:425)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at com.worklight.adapters.http.HTTPConnectionManager.execute(HTTPConnectionManager.java:239)
... 50 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:123)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:148)
... 56 more
com.worklight.common.log.filters.ErrorFilter
[ERROR ] FWLSE0099E: An error occurred while invoking procedure [project module_60_4_FlightTicket]FTAdapter/HttpRequestFWLSE0100E: parameters: [project module_60_4_FlightTicket]{
"arr": [
{
"body": {
"content": "oneWay=true&fromDate=1392526800000&toAirport=HKG&fromAirport=LHR&returnDate=1392526800000",
"contentType": "application\/x-www-form-urlencoded; charset=UTF-8"
},
"headers": {
"HOST": "localhost"
},
"method": "POST",
"path": "\/flightticket\/service\/flights\/queryflights",
"returnedContentType": "json"
}
]
}
Http request failed: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:9080 refused
FWLSE0101E: Caused by: [project module_60_4_FlightTicket]org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:9080 refusedjava.lang.RuntimeException: Http request failed: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:9080 refused
at com.worklight.adapters.http.HTTPConnectionManager.execute(HTTPConnectionManager.java:241)
at com.worklight.adapters.http.HttpClientContext.doExecute(HttpClientContext.java:176)
at com.worklight.adapters.http.HttpClientContext.execute(HttpClientContext.java:160)
at com.worklight.adapters.http.HTTP.execRequest(HTTP.java:135)
at com.worklight.adapters.http.HTTP.invoke(HTTP.java:124)
at com.worklight.integration.model.ProcedureInvoker.invokeProcedure(ProcedureInvoker.java:57)
at com.worklight.integration.model.Procedure.invoke(Procedure.java:166)
at com.worklight.integration.model.InvocationContext.call(InvocationContext.java:169)
at com.worklight.integration.model.InvocationContext.call(InvocationContext.java:38)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.worklight.integration.model.InvocationContext$DirectExecutorService.execute(InvocationContext.java:284)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at com.worklight.integration.model.InvocationContext.submit(InvocationContext.java:138)
at com.worklight.integration.model.InvocationContextManager.submitInvocation(InvocationContextManager.java:58)
at com.worklight.integration.services.impl.DataAccessServiceImpl.callProcedure(DataAccessServiceImpl.java:484)
at com.worklight.integration.services.impl.DataAccessServiceImpl.access$100(DataAccessServiceImpl.java:56)
at com.worklight.integration.services.impl.DataAccessServiceImpl$4.execute(DataAccessServiceImpl.java:387)
at com.worklight.core.auth.impl.AuthenticationServiceBean.accessResource(AuthenticationServiceBean.java:76)
at com.worklight.integration.services.impl.DataAccessServiceImpl.invokeProcedureInternal(DataAccessServiceImpl.java:384)
at com.worklight.integration.services.impl.DataAccessServiceImpl.invokeDynamicProcedure(DataAccessServiceImpl.java:443)
at com.worklight.integration.services.impl.DataAccessServiceImpl.invokeDynamicProcedure(DataAccessServiceImpl.java:427)
at com.worklight.integration.js.JavaScriptIntegrationLibraryImplementation.invokeDynamicProcedure(JavaScriptIntegrationLibraryImplementation.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)
at org.mozilla.javascript.gen._integration_js_1._c_anonymous_10(/integration.js:95)
at org.mozilla.javascript.gen._integration_js_1.call(/integration.js)
at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
at org.mozilla.javascript.gen.C_3A_5Ceclipsekepler_5Cmodule_60_4_FlightTicket_5Cadapters_5CFTAdapter_FTAdapter_impl_js_5._c_FlightsREST_getTripFlights_6(C%3A%5Ceclipsekepler%5Cmodule_60_4_FlightTicket%5Cadapters%5CFTAdapter/FTAdapter-impl.js:64)
at org.mozilla.javascript.gen.C_3A_5Ceclipsekepler_5Cmodule_60_4_FlightTicket_5Cadapters_5CFTAdapter_FTAdapter_impl_js_5.call(C%3A%5Ceclipsekepler%5Cmodule_60_4_FlightTicket%5Cadapters%5CFTAdapter/FTAdapter-impl.js)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at org.mozilla.javascript.gen.C_3A_5Ceclipsekepler_5Cmodule_60_4_FlightTicket_5Cadapters_5CFTAdapter_FTAdapter_impl_js_5.call(C%3A%5Ceclipsekepler%5Cmodule_60_4_FlightTicket%5Cadapters%5CFTAdapter/FTAdapter-impl.js)
at com.worklight.integration.js.JavaScriptManager.callFunction(JavaScriptManager.java:240)
at com.worklight.integration.js.JavaScriptManager.invokeFunction(JavaScriptManager.java:214)
at com.worklight.integration.js.JavaScriptManager.invokeFunction(JavaScriptManager.java:194)
at com.worklight.integration.services.impl.AdapterManagerImpl.invokeFunction(AdapterManagerImpl.java:104)
at com.worklight.integration.js.JavaScriptProcedureInvoker.invoke(JavaScriptProcedureInvoker.java:42)
at com.worklight.integration.model.ProcedureInvoker.invokeProcedure(ProcedureInvoker.java:57)
at com.worklight.integration.model.Procedure.invoke(Procedure.java:166)
at com.worklight.integration.model.InvocationContext.call(InvocationContext.java:169)
at com.worklight.integration.model.InvocationContext.call(InvocationContext.java:38)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at com.worklight.server.util.ProjectLocal$1RunnableWrapper.run(ProjectLocal.java:267)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:9080 refused
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:158)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:573)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:425)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at com.worklight.adapters.http.HTTPConnectionManager.execute(HTTPConnectionManager.java:239)
... 50 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:123)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:148)
... 56 more
If you are using android emulator you need choose the "Google APIs" enabled one which support push notification feature. When you setup your AVD, you need to choose that API Level.
You can refer to IBM Worklight 5.0.6.1 - Android notification does not reach either device or emulator for more details.

RemoteWebDriver+AndroidDriver : error communicating with browser

I've recently started working with -> RemoteWebDriver+AndroidDriver . I've started with a basic example as follows:
stmt1:WebDriver driver=new AndroidDriver();
stmt2:driver.get("http://www.google.com");
stmt3:WebElement element = driver.findElement(By.name("q"));
stmt4:element.sendKeys("Cheese!");
'stmt1','stmt2' opens google.com successfully on the emulator .
The issue is that 'stmt3' & 'stmt4' don't work .Emulator closes webdriver and following exception is generated in eclipse :
org.openqa.selenium.WebDriverException: Error communicating with the remote browser. It may have died.
Build info: version: '2.12.0', revision: '14666', time: '2011-11-10 18:36:18'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_33'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:412)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:205)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByName(RemoteWebDriver.java:254)
at org.openqa.selenium.By$ByName.findElement(By.java:286)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:197)
at androidpackage.Androidclass$1.apply(Androidclass.java:24)
at androidpackage.Androidclass$1.apply(Androidclass.java:1)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:189)
at androidpackage.Androidclass.testAndroid(Androidclass.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.apache.http.NoHttpResponseException: The target server failed to respond
at org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:101)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:252)
at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:281)
at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:247)
at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:219)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:298)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:645)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:464)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:391)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:370)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:398)
... 27 more
From the stacktrace, it seems your selenium version is 2.12.0. The current version is 2.25.0. Probably using latest could solve the problem.
Problem was that I used android 2.3.3 (bug on Gingerbread might have caused WebDriver to crash). On upgrading to android 4.0.3 the code runs fine.

Categories

Resources