FirebaseException: An internal error has occurred. [ Bad Request ] - android

Calling
final AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
results in
com.google.firebase.FirebaseException: An internal error has occurred. [ Bad Request ]
at com.google.android.gms.internal.zzeaw.zzaw(Unknown Source)
at com.google.android.gms.internal.zzdzu.zza(Unknown Source)
at com.google.android.gms.internal.zzebh.zzax(Unknown Source)
at com.google.android.gms.internal.zzebk.onFailure(Unknown Source)
at com.google.android.gms.internal.zzeay.onTransact(Unknown Source)
at android.os.Binder.execTransact(Binder.java:453)
OAuth 2.0: I do have correct SHA-1 in Google developer console as well as Firebase console.
I do have an up-to-date google-services.json file included in project.

Related

StorageException has occurred. User is not authenticated

The error is risen when I try to upload to the storage. I've already implemented authentication in my app, and am having no problem with creating a user and authenticating. StorageException has occurred.
User is not authenticated, please authenticate using Firebase Authentication and try again. Error -13020 HttpResult: 401
2022-04-28 17:26:45.646 30490-30886/com.apps.myshop E/StorageException: The server has terminated the upload session java.io.IOException: The server has terminated the upload session
I use next rules
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
}
}
}
There are examples of my log errors
StorageException has occurred.
User is not authenticated, please authenticate using Firebase Authentication and try again.
Code: -13020 HttpResult: 401
2022-04-28 17:26:45.646 30490-30886/com.apps.myshop E/StorageException: The server has terminated the upload session
java.io.IOException: The server has terminated the upload session
at com.google.firebase.storage.UploadTask.serverStateValid(UploadTask.java:339)
at com.google.firebase.storage.UploadTask.shouldContinue(UploadTask.java:308)
at com.google.firebase.storage.UploadTask.run(UploadTask.java:229)
at com.google.firebase.storage.StorageTask.lambda$getRunnable$7$com-google-firebase-storage-StorageTask(StorageTask.java:1072)
at com.google.firebase.storage.StorageTask$$ExternalSyntheticLambda3.run(Unknown Source:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: java.io.IOException: { "error": { "code": 401, "message": "Firebase App Check token is invalid." }}
at com.google.firebase.storage.network.NetworkRequest.parseResponse(NetworkRequest.java:445)
at com.google.firebase.storage.network.NetworkRequest.parseErrorResponse(NetworkRequest.java:462)
at com.google.firebase.storage.network.NetworkRequest.processResponseStream(NetworkRequest.java:453)
at com.google.firebase.storage.network.NetworkRequest.performRequest(NetworkRequest.java:272)
at com.google.firebase.storage.network.NetworkRequest.performRequest(NetworkRequest.java:289)
at com.google.firebase.storage.internal.ExponentialBackoffSender.sendWithExponentialBackoff(ExponentialBackoffSender.java:76)
at com.google.firebase.storage.internal.ExponentialBackoffSender.sendWithExponentialBackoff(ExponentialBackoffSender.java:68)
at com.google.firebase.storage.UploadTask.sendWithRetry(UploadTask.java:477)
at com.google.firebase.storage.UploadTask.beginResumableUpload(UploadTask.java:276)
at com.google.firebase.storage.UploadTask.run(UploadTask.java:224)
at com.google.firebase.storage.StorageTask.lambda$getRunnable$7$com-google-firebase-storage-StorageTask(StorageTask.java:1072) 
at com.google.firebase.storage.StorageTask$$ExternalSyntheticLambda3.run(Unknown Source:2) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:923) 
2022-04-28 17:26:45.646 30490-30886/com.apps.myshop E/StorageException: StorageException has occurred.
User is not authenticated, please authenticate using Firebase Authentication and try again.
Code: -13020 HttpResult: 401
2022-04-28 17:26:45.647 30490-30886/com.apps.myshop E/StorageException: The server has terminated the upload session
java.io.IOException: The server has terminated the upload session
at com.google.firebase.storage.UploadTask.serverStateValid(UploadTask.java:339)
at com.google.firebase.storage.UploadTask.shouldContinue(UploadTask.java:308)
at com.google.firebase.storage.UploadTask.run(UploadTask.java:229)
at com.google.firebase.storage.StorageTask.lambda$getRunnable$7$com-google-firebase-storage-StorageTask(StorageTask.java:1072)
at com.google.firebase.storage.StorageTask$$ExternalSyntheticLambda3.run(Unknown Source:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: java.io.IOException: { "error": { "code": 401, "message": "Firebase App Check token is invalid." }}
at com.google.firebase.storage.network.NetworkRequest.parseResponse(NetworkRequest.java:445)
at com.google.firebase.storage.network.NetworkRequest.parseErrorResponse(NetworkRequest.java:462)
at com.google.firebase.storage.network.NetworkRequest.processResponseStream(NetworkRequest.java:453)
at com.google.firebase.storage.network.NetworkRequest.performRequest(NetworkRequest.java:272)
at com.google.firebase.storage.network.NetworkRequest.performRequest(NetworkRequest.java:289)
at com.google.firebase.storage.internal.ExponentialBackoffSender.sendWithExponentialBackoff(ExponentialBackoffSender.java:76)
at com.google.firebase.storage.internal.ExponentialBackoffSender.sendWithExponentialBackoff(ExponentialBackoffSender.java:68)
at com.google.firebase.storage.UploadTask.sendWithRetry(UploadTask.java:477)
at com.google.firebase.storage.UploadTask.beginResumableUpload(UploadTask.java:276)
at com.google.firebase.storage.UploadTask.run(UploadTask.java:224)
at com.google.firebase.storage.StorageTask.lambda$getRunnable$7$com-google-firebase-storage-StorageTask(StorageTask.java:1072) 
at com.google.firebase.storage.StorageTask$$ExternalSyntheticLambda3.run(Unknown Source:2) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:923) 
2022-04-28 17:26:45.655 30490-30490/com.apps.myshop E/Error while uploading: Error while uploading image to db
com.google.firebase.storage.StorageException: User is not authenticated, please authenticate using Firebase Authentication and try again.
at com.google.firebase.storage.UploadTask.snapStateImpl(UploadTask.java:524)
at com.google.firebase.storage.UploadTask.snapStateImpl(UploadTask.java:50)
at com.google.firebase.storage.StorageTask.snapState(StorageTask.java:343)
at com.google.firebase.storage.TaskListenerImpl.onInternalStateChanged(TaskListenerImpl.java:85)
at com.google.firebase.storage.StorageTask.tryChangeState(StorageTask.java:390)
at com.google.firebase.storage.StorageTask.tryChangeState(StorageTask.java:426)
at com.google.firebase.storage.UploadTask.serverStateValid(UploadTask.java:342)
at com.google.firebase.storage.UploadTask.shouldContinue(UploadTask.java:308)
at com.google.firebase.storage.UploadTask.run(UploadTask.java:229)
at com.google.firebase.storage.StorageTask.lambda$getRunnable$7$com-google-firebase-storage-StorageTask(StorageTask.java:1072)
at com.google.firebase.storage.StorageTask$$ExternalSyntheticLambda3.run(Unknown Source:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: java.io.IOException: The server has terminated the upload session
at com.google.firebase.storage.UploadTask.serverStateValid(UploadTask.java:339)
at com.google.firebase.storage.UploadTask.shouldContinue(UploadTask.java:308) 
at com.google.firebase.storage.UploadTask.run(UploadTask.java:229) 
at com.google.firebase.storage.StorageTask.lambda$getRunnable$7$com-google-firebase-storage-StorageTask(StorageTask.java:1072) 
at com.google.firebase.storage.StorageTask$$ExternalSyntheticLambda3.run(Unknown Source:2) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:923) 
Caused by: java.io.IOException: { "error": { "code": 401, "message": "Firebase App Check token is invalid." }}
at com.google.firebase.storage.network.NetworkRequest.parseResponse(NetworkRequest.java:445)
at com.google.firebase.storage.network.NetworkRequest.parseErrorResponse(NetworkRequest.java:462)
at com.google.firebase.storage.network.NetworkRequest.processResponseStream(NetworkRequest.java:453)
at com.google.firebase.storage.network.NetworkRequest.performRequest(NetworkRequest.java:272)
at com.google.firebase.storage.network.NetworkRequest.performRequest(NetworkRequest.java:289)
at com.google.firebase.storage.internal.ExponentialBackoffSender.sendWithExponentialBackoff(ExponentialBackoffSender.java:76)
at com.google.firebase.storage.internal.ExponentialBackoffSender.sendWithExponentialBackoff(ExponentialBackoffSender.java:68)
at com.google.firebase.storage.UploadTask.sendWithRetry(UploadTask.java:477)
at com.google.firebase.storage.UploadTask.beginResumableUpload(UploadTask.java:276)
at com.google.firebase.storage.UploadTask.run(UploadTask.java:224)
Try adding create, although I suspect create should be included with write.
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write, update, delete, create;
}
}
}

FirebaseUI Android: Error fetching providers for email (Backend Error)

We use Firebase and FirebaseUI-Auth with email accounts in one of our Android apps.
When we try to log in using FirebaseUI-Auth with a specific email account, the progress dialog (progress_dialog_checking_accounts) hides without showing an error and what we see in logcat is the following:
W/CheckEmailFragment: Error fetching providers for email
com.google.firebase.c: An internal error has occurred. [ Backend Error ]
at com.google.android.gms.c.eg.a(Unknown Source)
at com.google.android.gms.c.ed$f.a(Unknown Source)
at com.google.android.gms.c.eo.a(Unknown Source)
at com.google.android.gms.c.eo$a.a(Unknown Source)
at com.google.android.gms.c.ej$a.onTransact(Unknown Source)
at android.os.Binder.execTransact(Binder.java:453)
The results of the following curl request are not very informative either:
curl 'https://www.googleapis.com/identitytoolkit/v3/relyingparty/createAuthUri?key=${MyFirebaseAPIKey}' -H 'Content-Type: application/json' --data-binary '{"identifier": "${ProblematicEmailAddress}","continueUri":"http://localhost"}'
{
"error": {
"errors": [
{
"domain": "global",
"reason": "backendError",
"message": "Backend Error"
}
],
"code": 500,
"message": "Backend Error"
}
}
I get a good response with another email address (also a registered account):
{
"kind": "identitytoolkit#CreateAuthUriResponse",
"allProviders": [
"password"
],
"registered": true,
"sessionId": "${replaced}"
}
Does anyone know what is happening and how we can solve this error? We are concerned, that this might occur for other email accounts as well, thus preventing users from signing in.

Missing cloud messaging permission though I am not using Firebase Cloud Messaging

I am using Firebase Crash Reporting and Firebase Remote Config, but I am not using Firebase Cloud Messaging. Version of both is 9.8.0.
So, I don't understand why am I seeing this error in logs:
java.lang.SecurityException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms (has extras) } without permission com.google.android.c2dm.permission.RECEIVE
at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1266)
at android.app.ContextImpl.startService(ContextImpl.java:1243)
at android.content.ContextWrapper.startService(ContextWrapper.java:588)
at com.google.firebase.iid.zzf.zzb(Unknown Source)
at com.google.firebase.iid.zzf.zza(Unknown Source)
at com.google.firebase.iid.zzf.zzb(Unknown Source)
at com.google.firebase.iid.zzf.zza(Unknown Source)
at com.google.firebase.iid.zzd.zzc(Unknown Source)
at com.google.firebase.iid.zzd.getToken(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceId.getToken(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceId.zzaae(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceIdService.zza(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceIdService.zzm(Unknown Source)
at com.google.firebase.iid.zzb$2.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Could it be, because I am depending on Google Cloud Messaging (but not using - library dependency - internal company library)?
Does it have any serious consequences?
As mentioned by Doug Stevenson in this groups post, the RECEIVE, C2D_MESSAGE, and WAKE_LOCK permissions are required by Analytics, Crash Reporting, and Remote Config.
The primary use is to generate secure tokens and, in the case of WAKE_LOCK, to prevent data loss, by keeping Android from killing the app's process before it's able to transmit collected data.

403 Forbidden Error when doing Android Google Calendar Quickstart

I'm trying to add Google Calendar integration with my app. I followed the Android quickstart guide here https://developers.google.com/google-apps/calendar/quickstart/android
I was having problems integrating this into my existing project, so I tried making a fresh project and copy and pasting the code. However, I'm still getting this error:
403 Forbidden
{
"code": 403,
"errors": [
{
"domain": "usageLimits",
"message": "Access Not Configured. The API (Calendar API) is not enabled for your project. Please use the Google Developers Console to update your configuration.",
"reason": "accessNotConfigured",
"extendedHelp": "https://console.developers.google.com"
}
],
"message": "Access Not Configured. The API (Calendar API) is not enabled for your project. Please use the Google Developers Console to update your configuration."
}
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1056)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
at com.gdosheriii.android.calendartest.ApiAsyncTask.getDataFromApi(ApiAsyncTask.java:72)
at com.gdosheriii.android.calendartest.ApiAsyncTask.doInBackground(ApiAsyncTask.java:39)
at com.gdosheriii.android.calendartest.ApiAsyncTask.doInBackground(ApiAsyncTask.java:19)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
What am I doing wrong? I've been googling for an answer for the past two hours, but nothing seems to fix it. Yes, I did create a client id inside the Google Developers Console. I copied and pasted the package (com.gdosheriii.android.calendartest) and the SHA1 key. I have the Calendar API enabled.
What is the correct way to do it?
Thanks for the help!
you need to change application name in code de google quistart, you can do that by following this next steps:
private class MakeRequestTask extends AsyncTask<Void, Void, List<String>> {
private com.google.api.services.calendar.Calendar mService = null;
private Exception mLastError = null;
public MakeRequestTask(GoogleAccountCredential credential) {
HttpTransport transport = AndroidHttp.newCompatibleTransport();
JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();
mService = new com.google.api.services.calendar.Calendar.Builder(
transport, jsonFactory, credential)
.setApplicationName("YOUR APPLICATION NAME IN GOOGLE CONSOLE")
.build();
}

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.

Categories

Resources