Listview not returning list of other Facebook friends with the same app - nullpointerexception

Update
It now isn't getting an error, but the list of Facebook friends who also have the application isn't coming up in the main view after I log in, if someone could help with that, that'd be awesome.
I have uploaded the project to HERE for anyone to take a look at and let me know where I'm going wrong please
If you can let me know which file and what part is wrong, and how to fix it, that'd be amazing!
I am trying to get a friends list showing who else has the app in someone's Facebook friends list when they log in, and I keep getting the error "java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference"
The error occurs because savedInstanceState is always null I believe, according to the debugger... any ideas? The full code is below:
package com.phinder.phinder;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import org.json.JSONArray;
import org.json.JSONException;
import java.util.ArrayList;
public class MainActivity extends AppCompatActivity {
public com.phinder.phinder.utils.Constants constants;
ImageView imageView_picture_profile;
TextView textview_nameprofile, textview_emailprofile;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
constants = new com.phinder.phinder.utils.Constants();
imageView_picture_profile = (ImageView) findViewById(R.id.imageView_picture_profile);
textview_emailprofile = (TextView) findViewById(R.id.textview_emailprofile);
textview_nameprofile = (TextView) findViewById(R.id.textview_nameprofile);
textview_emailprofile.setText(constants.loginSharedPreferences.getString(constants.LoginEmail, ""));
textview_nameprofile.setText(constants.loginSharedPreferences.getString(constants.LoginName, ""));
try {
Glide.with(getApplicationContext())
.load("http://" + constants.loginSharedPreferences.getString(constants.LoginImage, ""))
.placeholder(R.mipmap.ic_launcher)
.thumbnail(.1F)
.error(R.mipmap.ic_launcher)
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
.into(imageView_picture_profile);
} catch (Exception e) {
e.getStackTrace();
Log.d("msg", "Photo " + e.getMessage());
}
setContentView(R.layout.activity_main);
Intent intent = getIntent();
String jsondata = intent.getStringExtra("jsondata");
JSONArray friendslist;
ArrayList<String> friends = new ArrayList<>();
try {
friendslist = new JSONArray(jsondata);
for (int l = 0; l < friendslist.length(); l++) {
friends.add(friendslist.getJSONObject(l).getString("name"));
}
} catch (JSONException e) {
e.printStackTrace();
}
ArrayAdapter adapter = new ArrayAdapter<>(MainActivity.this, R.layout.activity_main, friends);
ListView listView = (ListView) findViewById(R.id.listView);
listView.setAdapter(adapter);
}
}
I'm pretty new to Android coding, so sorry if this seems obvious!
I have added the manifest below also, in case that's needed:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.phinder.phinder">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/app_id" />
<activity android:name=".MainActivity"></activity>
<activity android:name=".LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/app_id" />
</activity>
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name"
android:theme="#android:style/Theme.Translucent.NoTitleBar" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/app_id" />
</application>
</manifest>
Here is an error log also (removed some personal information it put in there when retrieving from Facebook):
12/10 23:40:03: Launching app
$ adb shell am start -n "com.phinder.phinder/com.phinder.phinder.LoginActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: com.phinder.phinder.test | com.phinder.phinder
Waiting for application to come online: com.phinder.phinder.test | com.phinder.phinder
Waiting for application to come online: com.phinder.phinder.test | com.phinder.phinder
Connecting to com.phinder.phinder
Connected to the target VM, address: 'localhost:8600', transport: 'socket'
E/Zygote: v2
I/SELinux: Function: selinux_compare_spd_ram, index[1], SPD-policy is existed. and_ver=SEPF_SECMOBILE_6.0.1 ver=11
I/libpersona: KNOX_SDCARD checking this for 10412
I/libpersona: KNOX_SDCARD not a persona
W/SELinux: Function: selinux_compare_spd_ram, index[1], priority [1], priority version is VE=SEPF_SECMOBILE_6.0.1_0011
E/Zygote: accessInfo : 0
W/SELinux: SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=com.phinder.phinder
I/art: Late-enabling -Xcheck:jni
D/TimaKeyStoreProvider: TimaSignature is unavailable
D/ActivityThread: Added TimaKeyStore provider
I/System.out: Sending WAIT chunk
W/ActivityThread: Application com.phinder.phinder is waiting for the debugger on port 8100...
I/art: Debugger is active
I/System.out: Debugger has connected
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: debugger has settled (1439)
W/System: ClassLoader referenced unknown path: /data/app/com.phinder.phinder-1/lib/arm
I/InstantRun: Instant Run Runtime started. Android package is com.phinder.phinder, real application class is null.
W/System: ClassLoader referenced unknown path: /data/app/com.phinder.phinder-1/lib/arm
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
W/System.err: remove failed: ENOENT (No such file or directory) : /data/user/0/com.phinder.phinder/files/AppEventsLogger.persistedevents
D/Package Name=: com.phinder.phinder
D/Key Hash=: zs7kzMXx78uDoJ9QjcsCuL2xPY0=
W/System.err: remove failed: ENOENT (No such file or directory) : /data/user/0/com.phinder.phinder/files/AppEventsLogger.persistedsessioninfo
D/SecWifiDisplayUtil: Metadata value : none
D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{802af0f I.E...... R.....ID 0,0-0,0}
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
D/libEGL: eglInitialize EGLDisplay = 0x9e67f7c4
I/OpenGLRenderer: Initialized EGL, version 1.4
D/mali_winsys: new_window_surface returns 0x3000, [2560x1440]-format:1
D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=2
W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy#266ed2f time:66569701
W/System.err: remove failed: ENOENT (No such file or directory) : /data/user/0/com.phinder.phinder/files/AppEventsLogger.persistedevents
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
D/ViewRootImpl: ViewPostImeInputStage processPointer 0
D/ViewRootImpl: ViewPostImeInputStage processPointer 1
I/Timeline: Timeline: Activity_launch_request id:com.phinder.phinder time:66595549
D/SecWifiDisplayUtil: Metadata value : none
D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{cb1dd37 I.E...... R.....I. 0,0-0,0}
D/mali_winsys: new_window_surface returns 0x3000, [2560x1440]-format:1
D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=2
W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy#b071cae time:66595716
V/ActivityThread: updateVisibility : ActivityRecord{1393c2f token=android.os.BinderProxy#266ed2f {com.phinder.phinder/com.phinder.phinder.LoginActivity}} show : true
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{9b1361b V.E...... R.....I. 0,0-0,0}
D/msg: Facebook
D/msg: fbid : 10154826532222425
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
D/mali_winsys: new_window_surface returns 0x3000, [1952x720]-format:1
W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=2
I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy#266ed2f time:66596446
D/ViewRootImpl: #3 mView = null
I/Timeline: Timeline: Activity_launch_request id:com.phinder.phinder time:66596581
D/AbsListView: Get MotionRecognitionManager
E/MotionRecognitionManager: mSContextService = android.hardware.scontext.ISContextService$Stub$Proxy#4d4175c
E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy#4394d48
E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy#4394d48
D/AbsListView: Get MotionRecognitionManager
D/SecWifiDisplayUtil: Metadata value : none
D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{f7ccc01 I.E...... R.....ID 0,0-0,0}
D/mali_winsys: new_window_surface returns 0x3000, [2560x1440]-format:1
W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=2
I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy#5176ada time:66596826
V/ActivityThread: updateVisibility : ActivityRecord{1393c2f token=android.os.BinderProxy#266ed2f {com.phinder.phinder/com.phinder.phinder.LoginActivity}} show : false
D/msg: Fb data1 : {Response: responseCode: 200, graphObject: {"id":"10154826532222425","name":"Dean Mokhtar","location":{"id":"109563165735553","name":"October 6, Al Jizah, Egypt"},"email":"mokdeabar#hotmail.com","picture":{"data":{"is_silhouette":false,"url":"https:\/\/scontent.xx.fbcdn.net\/v\/t1.0-1\/s200x200\/1471998_10152127224047425_6664922_n.jpg?oh=b5df53e5296ebea31a34126407b64933&oe=58EA2DCC"}}}, error: null}
D/msg: Fb data : {"id":"10154826532222425","name":"DM","location":{"id":"","name":""},"email":"#","picture":{"data":{"is_silhouette":false,"url":"https:\/\/scontent.xx.fbcdn.net\/v\/t1.0-1\/s200x200\/1471998_10152127224047425_6664922_n.jpg?oh=b5df53e5296ebea31a34126407b64933&oe=58EA2DCC"}}}
D/email:
I/WebViewFactory: Loading com.google.android.webview version 55.0.2883.91 (code 288309100)
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.TokenBindingManagerAdapter>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.TokenBindingManagerAdapter>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.ServiceWorkerControllerAdapter>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.ServiceWorkerControllerAdapter>
I/cr_LibraryLoader: Time to load native libraries: 1 ms (timestamps 6941-6942)
I/cr_LibraryLoader: Expected native library version number "55.0.2883.91", actual native library version number "55.0.2883.91"
I/Timeline: Timeline: Activity_launch_request id:com.phinder.phinder time:66596962
D/ViewRootImpl: #3 mView = null
D/ViewRootImpl: #3 mView = null
D/AbsListView: Get MotionRecognitionManager
E/MotionRecognitionManager: mSContextService = android.hardware.scontext.ISContextService$Stub$Proxy#59d2e50
E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy#9e94849
E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy#9e94849
D/AbsListView: Get MotionRecognitionManager
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.phinder.phinder, PID: 9793
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.phinder.phinder/com.phinder.phinder.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3253)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
at android.app.ActivityThread.access$1100(ActivityThread.java:221)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7225)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
at org.json.JSONTokener.nextCleanInternal(JSONTokener.java:116)
at org.json.JSONTokener.nextValue(JSONTokener.java:94)
at org.json.JSONArray.<init>(JSONArray.java:92)
at org.json.JSONArray.<init>(JSONArray.java:108)
at com.phinder.phinder.MainActivity.onCreate(MainActivity.java:61)
at android.app.Activity.performCreate(Activity.java:6876)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349) 
at android.app.ActivityThread.access$1100(ActivityThread.java:221) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:158) 
at android.app.ActivityThread.main(ActivityThread.java:7225) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 
W/System.err: remove failed: ENOENT (No such file or directory) : /data/user/0/com.phinder.phinder/files/AppEventsLogger.persistedevents
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
I/Process: Sending signal. PID: 9793 SIG: 9
Disconnected from the target VM, address: 'localhost:8600', transport: 'socket'

at org.json.JSONArray.<init>(JSONArray.java:108)
at com.phinder.phinder.MainActivity.onCreate(MainActivity.java:61)
The error in question occurred in the constructor of JsonArray.
This indicates the problem is with the line friendslist = new JSONArray(jsondata).
Since the error in question is a NullPointerException the cause is likely that intent.getStringExtra("jsondata") returned null, which it does in the absence of a value.
To fix the error either make sure anybody who launches the activity includes the additional data in the Intent, or check if the data is present and deal with the absence of data in your own way.

Related

How to upload data from pc to firestore. Getting "Failed to detect whether we are running on Google Compute Engine."

I'm trying to upload a couple of xml files to firestore from my computer (1000 or so). The users in my android app need to be able to search for these files, and because firebase storage doesn't provide that feature I thought I'd just dump them in firestore.
To test it I'm trying to upload 10 files for a start. The code I have looks something like this:
fun main(){
val db = getDatabase()
getXMLFiles().take(10).forEach { file ->
db.collection("xml").add(XMLFile(file.name, file))
}
}
private fun getDatabase() : Firestore {
val serviceAccount = FileInputStream("<project name>-firebase-adminsdk-<some other stuff>.json")
val firestoreOptions = FirestoreOptions.newBuilder()
.setTimestampsInSnapshotsEnabled(true).build()
val options = FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccount))
.setDatabaseUrl("https://<project name>.firebaseio.com")
.setFirestoreOptions(firestoreOptions)
.build()
FirebaseApp.initializeApp(options)
return FirestoreClient.getFirestore()
}
fun getXMLFiles() = File("/XML").walk().asIterable()
data class XMLFile(val name: String, val file: File)
Nothing gets uploaded and half the time (weirdly inconsistently) I get this error message:
Apr 15, 2019 2:05:53 PM com.google.auth.oauth2.ComputeEngineCredentials runningOnComputeEngine
WARNING: Failed to detect whether we are running on Google Compute Engine.
java.net.ConnectException: No route to host (connect failed)
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
at java.base/java.net.Socket.connect(Socket.java:591)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:177)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:474)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:569)
at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:242)
at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:341)
at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:362)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1242)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1181)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1075)
at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1009)
at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:104)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:981)
at com.google.auth.oauth2.ComputeEngineCredentials.runningOnComputeEngine(ComputeEngineCredentials.java:210)
at com.google.auth.oauth2.DefaultCredentialsProvider.tryGetComputeCredentials(DefaultCredentialsProvider.java:290)
at com.google.auth.oauth2.DefaultCredentialsProvider.getDefaultCredentialsUnsynchronized(DefaultCredentialsProvider.java:207)
at com.google.auth.oauth2.DefaultCredentialsProvider.getDefaultCredentials(DefaultCredentialsProvider.java:124)
at com.google.auth.oauth2.GoogleCredentials.getApplicationDefault(GoogleCredentials.java:127)
at com.google.auth.oauth2.GoogleCredentials.getApplicationDefault(GoogleCredentials.java:100)
at com.google.cloud.ServiceOptions.defaultCredentials(ServiceOptions.java:304)
at com.google.cloud.ServiceOptions.<init>(ServiceOptions.java:278)
at com.google.cloud.firestore.FirestoreOptions.<init>(FirestoreOptions.java:225)
at com.google.cloud.firestore.FirestoreOptions$Builder.build(FirestoreOptions.java:219)
at UploaderKt.getDatabase(Uploader.kt:32)
at UploaderKt.main(Uploader.kt:13)
at UploaderKt.main(Uploader.kt)
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Process finished with exit code 0
I checked, and it does find the .json with the credentials, so that is not the problem. I can't find anything anywhere about the error message
Apr 15, 2019 2:05:53 PM com.google.auth.oauth2.ComputeEngineCredentials runningOnComputeEngine
WARNING: Failed to detect whether we are running on Google Compute Engine.
So I hoped someone could help.
Btw, without showing to much, my .json looks like this:
{
"type": "service_account",
"project_id": "XXX",
"private_key_id": "XXX",
"private_key": "-----BEGIN PRIVATE KEY-----XXX-----END PRIVATE KEY-----\n",
"client_email": "firebase-adminsdk-XXX#XXX.iam.gserviceaccount.com",
"client_id": "XXX",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-XXX%40XXX.iam.gserviceaccount.com"
}
Edit: might be stating the obvious but I have no problems connecting to the internet otherwise

Uart / GPS driver sample buffer overflow

I am trying the sample for the GPS driver with a raspberry pi 3 and the Ultimate GPS V3 breakout board.
Here is the full source code: https://github.com/androidthings/drivers-samples/tree/master/gps
The GPS board is connected following this schematics:
When launching the sample app, I get the following error:
com.example.androidthings.driversamples E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.androidthings.driversamples, PID: 1299
java.nio.BufferOverflowException
at java.nio.Buffer.nextPutIndex(Buffer.java:508)
at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:142)
at com.google.android.things.contrib.driver.gps.NmeaGpsModule.processBuffer(NmeaGpsModule.java:178)
at com.google.android.things.contrib.driver.gps.NmeaGpsModule.readUartBuffer(NmeaGpsModule.java:160)
at com.google.android.things.contrib.driver.gps.NmeaGpsModule.access$000(NmeaGpsModule.java:35)
at com.google.android.things.contrib.driver.gps.NmeaGpsModule$1.onUartDeviceDataAvailable(NmeaGpsModule.java:139)
at com.google.android.things.pio.UartDevice$UartDeviceCallbackDispatch.dispatchInterruptEvent(UartDevice.java:507)
at com.google.android.things.pio.CallbackDispatch.onFileDescriptorEvents(CallbackDispatch.java:127)
at android.os.MessageQueue.dispatchEvents(MessageQueue.java:282)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Update 1
After enabling the debug in the contrib-driver project, I see a new error: W/NmeaParser: Invalid checksum (62), expected 108
12-28 17:53:28.638 1378-1378/com.example.androidthings.driversamples D/XXX: Debug version used
12-28 17:53:29.451 1378-1378/com.example.androidthings.driversamples I/Choreographer: Skipped 34 frames! The application may be doing too much work on its main thread.
12-28 17:53:29.862 1378-1378/com.example.androidthings.driversamples W/NmeaParser: Invalid checksum (62), expected 108
12-28 17:53:29.862 1378-1378/com.example.androidthings.driversamples D/XXX: Buffer reset
12-28 17:53:30.427 1378-1378/com.example.androidthings.driversamples D/AndroidRuntime: Shutting down VM
12-28 17:53:30.428 1378-1378/com.example.androidthings.driversamples E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.androidthings.driversamples, PID: 1378
java.nio.BufferOverflowException
at java.nio.Buffer.nextPutIndex(Buffer.java:508)
at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:142)
at com.google.android.things.contrib.driver.gps.NmeaGpsModule.processBuffer(NmeaGpsModule.java:179)
at com.google.android.things.contrib.driver.gps.NmeaGpsModule.readUartBuffer(NmeaGpsModule.java:161)
at com.google.android.things.contrib.driver.gps.NmeaGpsModule.access$000(NmeaGpsModule.java:35)
at com.google.android.things.contrib.driver.gps.NmeaGpsModule$1.onUartDeviceDataAvailable(NmeaGpsModule.java:140)
at com.google.android.things.pio.UartDevice$UartDeviceCallbackDispatch.dispatchInterruptEvent(UartDevice.java:507)
at com.google.android.things.pio.CallbackDispatch.onFileDescriptorEvents(CallbackDispatch.java:127)
at android.os.MessageQueue.dispatchEvents(MessageQueue.java:282)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
12-28 17:53:30.439 1378-1378/com.example.androidthings.driversamples I/Process: Sending signal. PID: 1378 SIG: 9
Update 2
After increasing the buffer size by 4, I was able to get few messages in. I see some messages have some junk that would explain the overflow:
12-28 23:38:17.393 2366-2366/? D/XXX: message: ��GPGGA,233817.000,3742.1931,N,12208.3976,W,1,04,1.96,164.3,M,-25.5,M,,*58
12-28 23:38:17.394 2366-2366/? D/XXX: Buffer reset
12-28 23:38:17.394 2366-2366/? D/XXX: message: GPGSA,A,3,23,03,26,22,,,,,,,,,2.20,1.96,1.00*0B
12-28 23:38:17.395 2366-2366/? D/XXX: Buffer reset
12-28 23:38:17.544 2366-2366/com.example.androidthings.driversamples D/XXX: message: GP��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������RMC,233817.000,A��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������,3742.1931,N,12208.3976,W,0.42,205.67,281216,,,A*71
12-28 23:38:17.545 2366-2366/com.example.androidthings.driversamples D/XXX: Buffer reset
12-28 23:38:17.545 2366-2366/com.example.androidthings.driversamples D/XXX: message: GPVTG,205.67,T,,M,0.42,N,0.78,K,A*32
12-28 23:38:17.546 2366-2366/com.example.androidthings.driversamples D/XXX: Buffer reset
I have no idea where that junk could come from...
In some cases processBuffer() will process the whole buffer (512 bytes) regardless of how many bytes are read from the UART. If it happens to miss a start or end character you can end up with a lot of '0' in the message buffer. You can modify this to be like this:
int count;
while ((count = uart.read(buffer, buffer.length)) > 0) {
processBuffer(buffer, count);
}
then modify this to be more like this:
private void processBuffer(byte[] buffer, int length) {
for (int i = 0; i < length; i++) {
if (mParser.getFrameStart() == buffer[i]) {
handleFrameStart();
} else if (mParser.getFrameEnd() == buffer[i]) {
handleFrameEnd();
} else {
//Insert all other characters into the buffer
mMessageBuffer.put(buffer[i]);
}
}
}
Then you won't be filling the message buffer with garbage if an end character gets dropped. I noticed this happening in a project I'm working on that uses this source code. The readUartBuffer() method can read split messages, i.e., the start or end of a message. If it does, bad things happen.
Looking at the demo code https://github.com/androidthings/drivers-samples/blob/master/gps/src/main/java/com/example/androidthings/driversamples/GpsActivity.java#L35 the Baud rate is set correctly as per the data sheet: https://cdn-learn.adafruit.com/downloads/pdf/adafruit-ultimate-gps.pdf
And looking at the contrib-driver for NmeaGpsModule the message buffer length is twice the size of the buffer read from the driver https://github.com/androidthings/contrib-drivers/blob/master/gps/src/main/java/com/google/android/things/contrib/driver/gps/NmeaGpsModule.java#L169 so it can't overflow with just one read.
A theory for the issue could be that the message buffer is not being cleared after it receives data - therefore you get a BufferOverflowException after a few packets.
The buffer is reset in 2 places:
When a new frame starts:
https://github.com/androidthings/contrib-drivers/blob/master/gps/src/main/java/com/google/android/things/contrib/driver/gps/NmeaGpsModule.java#L187
Or when a frame ends:
https://github.com/androidthings/contrib-drivers/blob/master/gps/src/main/java/com/google/android/things/contrib/driver/gps/NmeaGpsModule.java#L209
I don't have the hardware to debug your issue, however I can recommend how you could do it:
This goes for anyone wanting to debug a contrib-driver
Fork / Make a copy of this android library: https://github.com/androidthings/contrib-drivers/tree/master/gps
Edit the build.gradle to add this dependency: https://github.com/novoda/bintray-release (follow the README for instructions).
Once you add that dependency the build.gradle will look like this:
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release' // new code
android {
compileSdkVersion 24
buildToolsVersion '24.0.3'
defaultConfig {
minSdkVersion 24
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.novoda:bintray-release:0.4.0' // new code
}
}
dependencies {
compile 'com.android.support:support-annotations:24.2.0'
provided 'com.google.android.things:androidthings:0.1-devpreview'
}
publish { // new code
userOrg = 'google'
groupId = 'com.google.android.things.contrib'
artifactId = 'driver-gps'
publishVersion = '0.1-DEBUG'
}
Now you can release your own version of the GPS driver for debugging, but first:
Edit the java files, to add logging. In the NmeaGpsModule.java of your fork/copy, make two changes:
private void init(UartDevice device, int baudRate, Handler handler) throws IOException {
Log.d("XXX", "MY VERSION BEING USED"); // new code
mDevice = device;
mDevice.setBaudrate(baudRate);
mDevice.registerUartDeviceCallback(mCallback, handler);
mParser = new NmeaParser();
}
and
private void resetBuffer() {
Log.d("XXX", "BUFFER BEING RESET"); // new code
mMessageBuffer.clear();
mFrameFlag = false;
}
To release this version run this command in a terminal from the same folder as the build.gradle:
./gradlew clean build bintrayUpload -PdryRun=true
Now you have released a dependency!
Back in your application (in this case the driver-samples) https://github.com/androidthings/drivers-samples/blob/master/gps/build.gradle#L39:
Change the build.gradle to have a different dependency:
compile 'com.google.android.things.contrib:driver-gps:0.1'
becomes
compile 'com.google.android.things.contrib:driver-gps:0.1-DEBUG'
and tell it to look locally for this dependency:
repositories {
mavenLocal()
jcenter()
}
Now rerun the application and you should see your logs! First the sanity log to prove it worked "MY VERSION BEING USED" then the buffer being reset "BUFFER BEING RESET" if the buffer isn't being reset .. you need to check your hard wiring or add more logs to figure out why.

Starting Server node on a cluster through Service and trying loadcache

I debugged the code and found all parameters being set appropriately and even in the console we can see that the server in remote node has started and the cache has been initialized.
All the requried parameters are passed through db
On trying to assert on the cache wihtout lazyload(hotloading it from the persistent store) the error log that i get is ,
I am not able to understand what s going wrong in the cluster so have only attached the code that does the job of starting the servers.
InitializeCache internally calls loadcache after all the keyfileds,jdbctypes are set..
class{
private void startNodes() {
logger.info("Starting Ignite Nodes");
IgniteCluster igniteCluster = rocCachemanager.getCluster();
// HashMaps for holding host and default configurations
HashMap<String, Object> defaults = new HashMap<>();
HashMap<String, Object> hmHosts;
// get Ignite configuration from DB
List<IgniteConfigPojo> list = igniteConfigImpl.getIgniteConfigList();
IgniteConfigPojo configPojo = list.get(0);
List<IgniteNodeMapPojo> listNodeMap = configPojo.getIgniteNodeMap();
// Collection of Host configuration
Collection<Map<String, Object>> hosts = new ArrayList<>();
// Prepare the map with all the ignite server host information
prepareHostList(listNodeMap, hosts);
// Actual start of remote nodes via ssh call
try {
if (listNodeMap.size() != igniteCluster.forServers().nodes().size()) {
Collection<ClusterStartNodeResult> result = igniteCluster.startNodes(hosts, defaults, false, 10000, 1);
for (ClusterStartNodeResult res : result) {
if (!res.isSuccess()) {
throw new ROCCacheException(res.getError());
} else {
logger.info("Ignite server start successfully triggered on machine " + res.getHostName());
}
}
}
int waitTime = 0;
while (listNodeMap.size() != igniteCluster.forServers().nodes().size()) {
if (waitTime >= MAX_TIME_FOR_SERVER_START) {
int serverNodes = igniteCluster.forServers().nodes().size();
throw new ROCCacheException("All the Server nodes have not joined the Ignite Cluster, Expected servers :"
+ listNodeMap.size() + " , actual :" + serverNodes);
}
synchronized (this) {
wait(2000);
}
waitTime += 2000;
}
logger.info("Successfully started all the ignite servers");
} catch (IgniteException e) {
throw new ROCCacheException("Error while starting the Ignite Servers", e);
} catch (InterruptedException e) {
throw new ROCCacheException("Error while starting the Ignite Servers,Received Interrupt signal", e);
}
}
#Override
public void onLeaderStart() {
startNodes();
initializeBookeeperCache();
initializeCaches();
}
}
#Test
#Transactional(propagation = Propagation.SUPPORTS)
public void startNodeTest() {
try {
roccacheservice.onLeaderStart();
Collection<ClusterNode> colClusterClientNodes = rocCacheManager.getCluster().forClients().nodes();
for (ClusterNode clientNode : colClusterClientNodes) {
assertEquals(clientNode.addresses().contains("10.113.56.110"), true);
}
Collection<ClusterNode> colClusterServerNodes = rocCacheManager.getCluster().forServers().nodes();
for (ClusterNode serverNode : colClusterServerNodes) {
assertEquals(serverNode.addresses().contains("10.113.56.231"), true);
System.out.println(serverNode.metrics());
}
****************************works fine till here****************************
ROCCacheConfiguration<Long, PersonPojo> new4 = new ROCCacheConfiguration<>();
new4.setName("Person");
ROCCache<Long, PersonPojo> orgCache4 = rocCacheManager.createCache(new4);
assertEquals(orgCache4.get(1L).getName(), "Abhishek");
assertEquals(orgCache4.get(1L).getAge(), 25);
} catch (Exception e) {
e.printStackTrace();
}
}
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/abhisheks/.m2/repository/org/slf4j/slf4j-simple/1.7.19/slf4j-simple-1.7.19.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/abhisheks/.m2/repository/org/slf4j/slf4j-log4j12/1.7.10/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
[main] INFO org.springframework.test.context.support.DefaultTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]
[main] INFO org.springframework.test.context.support.DefaultTestContextBootstrapper - Could not instantiate TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener]. Specify custom listener classes or make the default listener classes (and their required dependencies) available. Offending class: [org/springframework/web/context/request/RequestAttributes]
[main] INFO org.springframework.test.context.support.DefaultTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener#5383967b, org.springframework.test.context.support.DependencyInjectionTestExecutionListener#2ac273d3, org.springframework.test.context.support.DirtiesContextTestExecutionListener#71423665, org.springframework.test.context.transaction.TransactionalTestExecutionListener#20398b7c, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener#6fc6f14e]
[main] INFO org.springframework.context.support.GenericApplicationContext - Refreshing org.springframework.context.support.GenericApplicationContext#d44fc21: startup date [Tue Apr 19 15:32:01 IST 2016]; root of context hierarchy
[main] WARN org.springframework.context.annotation.ConfigurationClassEnhancer - #Bean method IgniteStoreConfig.getPropertySourcesPlaceholderConfigurer is non-static and returns an object assignable to Spring's BeanFactoryPostProcessor interface. This will result in a failure to process annotations such as #Autowired, #Resource and #PostConstruct within the method's declaring #Configuration class. Add the 'static' modifier to this method to avoid these container lifecycle issues; see #Bean javadoc for complete details.
[main] INFO org.springframework.context.support.PropertySourcesPlaceholderConfigurer - Loading properties file from class path resource [ignitePersistentStore.properties]
[main] INFO org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
[main] INFO org.springframework.jdbc.datasource.DriverManagerDataSource - Loaded JDBC driver: com.mysql.jdbc.Driver
[main] INFO org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean - Building JPA container EntityManagerFactory for persistence unit 'ben'
HHH000204: Processing PersistenceUnitInfo [
name: ben
...]
HHH000412: Hibernate Core {5.0.7.Final}
HHH000206: hibernate.properties not found
HHH000021: Bytecode provider name : javassist
HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
HHH000457: Joined inheritance hierarchy [com.subex.roc.schema.md.TraitValue] defined explicit #DiscriminatorColumn. Legacy Hibernate behavior was to ignore the #DiscriminatorColumn. However, as part of issue HHH-6911 we now apply the explicit #DiscriminatorColumn. If you would prefer the legacy behavior, enable the `hibernate.discriminator.ignore_explicit_for_joined` setting (hibernate.discriminator.ignore_explicit_for_joined=true)
HHH000228: Running hbm2ddl schema update
HHH000262: Table not found: SREG_Field
HHH000262: Table not found: SREG_Field
HHH000262: Table not found: SREG_Model
HHH000262: Table not found: SREG_Model
HHH000262: Table not found: SREG_Trait
HHH000262: Table not found: SREG_Trait
HHH000262: Table not found: SREG_TraitGroup
HHH000262: Table not found: SREG_TraitGroup
HHH000262: Table not found: SREG_TraitMultiValue
HHH000262: Table not found: SREG_TraitMultiValue
HHH000262: Table not found: SREG_TraitSingleValue
HHH000262: Table not found: SREG_TraitSingleValue
HHH000262: Table not found: SREG_TraitValueBase
HHH000262: Table not found: SREG_TraitValueBase
HHH000262: Table not found: SREG_TraitValueStore
HHH000262: Table not found: SREG_TraitValueStore
HHH000397: Using ASTQueryTranslatorFactory
Hibernate: select igniteconf0_.icf_id as icf_id1_0_, igniteconf0_.enable_peerclassload as enable_p2_0_, igniteconf0_.grid_name as grid_nam3_0_, igniteconf0_.join_timeout as join_tim4_0_ from ignite_config igniteconf0_
Hibernate: select ignitenode0_.icf_id as icf_id3_1_0_, ignitenode0_.inm_id as inm_id1_1_0_, ignitenode0_.inm_id as inm_id1_1_1_, ignitenode0_.icf_id as icf_id3_1_1_, ignitenode0_.nod_id as nod_id4_1_1_, ignitenode0_.port_range as port_ran2_1_1_, rocnodepoj1_.nod_id as nod_id1_4_2_, rocnodepoj1_.nod_address as nod_addr2_4_2_, rocnodedea2_.rnd_id as rnd_id1_3_3_, rocnodedea2_.nod_id as nod_id2_3_3_, rocnodedea2_.rnd_ignite_home as rnd_igni3_3_3_, rocnodedea2_.rnd_numberof_nodes as rnd_numb4_3_3_, rocnodedea2_.rnd_password as rnd_pass5_3_3_, rocnodedea2_.rnd_ssh_port as rnd_ssh_6_3_3_, rocnodedea2_.rnd_user_name as rnd_user7_3_3_ from ignite_node_map ignitenode0_ left outer join roc_nodes rocnodepoj1_ on ignitenode0_.nod_id=rocnodepoj1_.nod_id left outer join roc_node_detail rocnodedea2_ on rocnodepoj1_.nod_id=rocnodedea2_.rnd_id where ignitenode0_.icf_id=?
[main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [file:/home/abhisheks/Desktop/apache-ignite-fabric-1.5.0.final-bin/conf/spring_igniteConfig.xml]
[main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [file:/home/abhisheks/Desktop/apache-ignite-fabric-1.5.0.final-bin/conf/ignite_Config.xml]
[main] INFO org.springframework.context.support.GenericApplicationContext - Refreshing org.springframework.context.support.GenericApplicationContext#5d8ab698: startup date [Tue Apr 19 15:32:04 IST 2016]; root of context hierarchy
[main] INFO org.springframework.jdbc.datasource.DriverManagerDataSource - Loaded JDBC driver: com.mysql.jdbc.Driver
>>> __________ ________________
>>> / _/ ___/ |/ / _/_ __/ __/
>>> _/ // (7 7 // / / / / _/
>>> /___/\___/_/|_/___/ /_/ /___/
>>>
>>> ver. 1.5.0-final#20151229-sha1:f1f8cda2
>>> 2015 Copyright(C) Apache Software Foundation
>>>
>>> Ignite documentation: http://ignite.apache.org
Config URL: file:/home/abhisheks/Desktop/apache-ignite-fabric-1.5.0.final-bin/conf/spring_igniteConfig.xml
Daemon mode: off
OS: Linux 2.6.32-504.el6.x86_64 amd64
OS user: abhisheks
Language runtime: Java Platform API Specification ver. 1.8
VM information: Java(TM) SE Runtime Environment 1.8.0_66-b17 Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 25.66-b17
VM total memory: 1.7GB
Remote Management [restart: off, REST: on, JMX (remote: off)]
IGNITE_HOME=/home/abhisheks/Desktop/apache-ignite-fabric-1.5.0.final-bin
VM arguments: [-Dfile.encoding=UTF-8]
Configured caches ['ignite-marshaller-sys-cache', 'ignite-sys-cache', 'ignite-atomics-sys-cache']
3-rd party licenses can be found at: /home/abhisheks/Desktop/apache-ignite-fabric-1.5.0.final-bin/libs/licenses
Initial heap size is 122MB (should be no less than 512MB, use -Xms512m -Xmx512m).
Non-loopback local IPs: 10.113.56.110, 192.168.122.1, fe80:0:0:0:c634:6bff:fe4f:784d%eth1
Enabled local MACs: 5254004ABB26, C4346B4F784D
Configured plugins:
^-- None
IPC shared memory server endpoint started [port=48100, tokDir=/home/abhisheks/Desktop/apache-ignite-fabric-1.5.0.final-bin/work/ipc/shmem/8f12688b-fef6-4981-a5f4-aa6781438930-23547]
Successfully bound shared memory communication to TCP port [port=48100, locHost=0.0.0.0/0.0.0.0]
Successfully bound to TCP port [port=47100, locHost=0.0.0.0/0.0.0.0]
Checkpoints are disabled (to enable configure any GridCheckpointSpi implementation)
Collision resolution is disabled (all jobs will be activated upon arrival).
Swap space is disabled. To enable use FileSwapSpaceSpi.
Security status [authentication=off, tls/ssl=off]
Command protocol successfully started [name=TCP binary, host=0.0.0.0/0.0.0.0, port=11211]
Successfully bound to TCP port [port=47500, localHost=0.0.0.0/0.0.0.0]
Started cache [name=ignite-sys-cache, mode=REPLICATED]
Started cache [name=ignite-atomics-sys-cache, mode=PARTITIONED]
Started cache [name=ignite-marshaller-sys-cache, mode=REPLICATED]
Performance suggestions for grid 'subexIgnite' (fix if possible)
To disable, set -DIGNITE_PERFORMANCE_SUGGESTIONS_DISABLED=true
^-- Disable grid events (remove 'includeEventTypes' from configuration)
^-- Enable client mode for TcpDiscoverySpi (set TcpDiscoverySpi.forceServerMode to false)
To start Console Management & Monitoring run ignitevisorcmd.{sh|bat}
>>> +----------------------------------------------------------------------------+
>>> Ignite ver. 1.5.0-final#20151229-sha1:f1f8cda2f3f62231f42a59951bf34c39577c1bec
>>> +----------------------------------------------------------------------------+
>>> OS name: Linux 2.6.32-504.el6.x86_64 amd64
>>> CPU(s): 8
>>> Heap: 1.7GB
>>> VM name: 23547#abhisheks
>>> Grid name: subexIgnite
>>> Local node [ID=8F12688B-FEF6-4981-A5F4-AA6781438930, order=1, clientMode=true]
>>> Local node addresses: [192.168.122.1/0:0:0:0:0:0:0:1%lo, abhisheks/10.113.56.110, /127.0.0.1, /192.168.122.1]
>>> Local ports: TCP:11211 TCP:47100 TCP:47500 TCP:48100
Topology snapshot [ver=1, servers=0, clients=1, CPUs=8, heap=1.7GB]
[main] INFO org.springframework.test.context.transaction.TransactionContext - Began transaction (1) for test context [DefaultTestContext#2478b629 testClass = StartServiceTest, testInstance = com.subex.roc.cache.startserviceintegration.StartServiceTest#39023dbf, testMethod = startNodeTest#StartServiceTest, testException = [null], mergedContextConfiguration = [MergedContextConfiguration#2c2c3947 testClass = StartServiceTest, locations = '{}', classes = '{class com.subex.roc.cache.IgniteJPAConfiguration, class com.subex.roc.cache.IgniteEnvConfiguration}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]; transaction manager [org.springframework.orm.jpa.JpaTransactionManager#1a2ac487]; rollback [true]
[main] INFO com.subex.roc.cache.ROCCacheService - Starting Ignite Nodes
Hibernate: select igniteconf0_.icf_id as icf_id1_0_, igniteconf0_.enable_peerclassload as enable_p2_0_, igniteconf0_.grid_name as grid_nam3_0_, igniteconf0_.join_timeout as join_tim4_0_ from ignite_config igniteconf0_
Hibernate: select ignitenode0_.icf_id as icf_id3_1_0_, ignitenode0_.inm_id as inm_id1_1_0_, ignitenode0_.inm_id as inm_id1_1_1_, ignitenode0_.icf_id as icf_id3_1_1_, ignitenode0_.nod_id as nod_id4_1_1_, ignitenode0_.port_range as port_ran2_1_1_, rocnodepoj1_.nod_id as nod_id1_4_2_, rocnodepoj1_.nod_address as nod_addr2_4_2_, rocnodedea2_.rnd_id as rnd_id1_3_3_, rocnodedea2_.nod_id as nod_id2_3_3_, rocnodedea2_.rnd_ignite_home as rnd_igni3_3_3_, rocnodedea2_.rnd_numberof_nodes as rnd_numb4_3_3_, rocnodedea2_.rnd_password as rnd_pass5_3_3_, rocnodedea2_.rnd_ssh_port as rnd_ssh_6_3_3_, rocnodedea2_.rnd_user_name as rnd_user7_3_3_ from ignite_node_map ignitenode0_ left outer join roc_nodes rocnodepoj1_ on ignitenode0_.nod_id=rocnodepoj1_.nod_id left outer join roc_node_detail rocnodedea2_ on rocnodepoj1_.nod_id=rocnodedea2_.rnd_id where ignitenode0_.icf_id=?
Starting remote node with SSH command: nohup "/home/benakaraj/Downloads/apache-ignite-fabric-1.5.0.final-bin/bin/ignite.sh" -v "conf/spring_igniteConfig.xml" -J-DIGNITE_SSH_HOST="10.113.56.231" -J-DIGNITE_SSH_USER_NAME="root" > ignite-startNodes/04-19-2016--15-32-05-521bc7ca.log 2>& 1 &
[main] INFO com.subex.roc.cache.ROCCacheService - Ignite server start successfully triggered on machine 10.113.56.231
Your version is up to date.
Local java version is different from remote [loc=8, rmt=7]
Added new node to topology: TcpDiscoveryNode [id=e93bc2fa-8a37-4a50-9a22-071abece643f, addrs=[0:0:0:0:0:0:0:1%1, 10.113.56.231, 127.0.0.1, 192.168.122.1], sockAddrs=[/192.168.122.1:47500, /0:0:0:0:0:0:0:1%1:47500, /10.113.56.231:47500, /10.113.56.231:47500, /127.0.0.1:47500, /192.168.122.1:47500], discPort=47500, order=2, intOrder=2, lastExchangeTime=1461060127285, loc=false, ver=1.5.0#20151229-sha1:f1f8cda2, isClient=false]
Topology snapshot [ver=2, servers=1, clients=1, CPUs=16, heap=2.7GB]
[main] INFO com.subex.roc.cache.ROCCacheService - Successfully started all the ignite servers
Started cache [name=bookeeperCache, mode=PARTITIONED]
Hibernate: select roccacheco0_.rcc_id as rcc_id1_2_, roccacheco0_.automicity_mode as automici2_2_, roccacheco0_.backup_count as backup_c3_2_, roccacheco0_.cache_mode as cache_mo4_2_, roccacheco0_.cache_writeorder_mode as cache_wr5_2_, roccacheco0_.eviction_policy as eviction6_2_, roccacheco0_.filterClass as filterCl7_2_, roccacheco0_.is_lazy_load as is_lazy_8_2_, roccacheco0_.is_near_cache as is_near_9_2_, roccacheco0_.is_read_through as is_read10_2_, roccacheco0_.is_write_behind as is_writ11_2_, roccacheco0_.is_write_through as is_writ12_2_, roccacheco0_.key_class as key_cla13_2_, roccacheco0_.max_cache_entries as max_cac14_2_, roccacheco0_.rcc_cache_name as rcc_cac15_2_, roccacheco0_.rcc_table_name as rcc_tab16_2_, roccacheco0_.schema_version as schema_17_2_, roccacheco0_.value_class as value_c18_2_, roccacheco0_.writebehind_batch_size as writebe19_2_, roccacheco0_.writebehind_flush_freq as writebe20_2_, roccacheco0_.writebehind_flush_size as writebe21_2_ from roc_cache_config roccacheco0_
Hibernate: select model0_.id as id1_6_, model0_.description as descript2_6_, model0_.name as name3_6_, model0_.version as version4_6_ from SREG_Model model0_ where model0_.name=? and model0_.version=?
Hibernate: select fields0_.model_id as model_id5_5_0_, fields0_.id as id1_5_0_, fields0_.id as id1_5_1_, fields0_.name as name2_5_1_, fields0_.position as position3_5_1_, fields0_.type as type4_5_1_ from SREG_Field fields0_ where fields0_.model_id=?
Hibernate: select traitgroup0_.field_id as field_id3_8_0_, traitgroup0_.id as id1_8_0_, traitgroup0_.id as id1_8_1_, traitgroup0_.name as name2_8_1_ from SREG_TraitGroup traitgroup0_ where traitgroup0_.field_id=?
Hibernate: select traitgroup0_.field_id as field_id3_8_0_, traitgroup0_.id as id1_8_0_, traitgroup0_.id as id1_8_1_, traitgroup0_.name as name2_8_1_ from SREG_TraitGroup traitgroup0_ where traitgroup0_.field_id=?
Hibernate: select traitgroup0_.field_id as field_id3_8_0_, traitgroup0_.id as id1_8_0_, traitgroup0_.id as id1_8_1_, traitgroup0_.name as name2_8_1_ from SREG_TraitGroup traitgroup0_ where traitgroup0_.field_id=?
Hibernate: select traitgroup0_.model_id as model_id4_8_0_, traitgroup0_.id as id1_8_0_, traitgroup0_.id as id1_8_1_, traitgroup0_.name as name2_8_1_ from SREG_TraitGroup traitgroup0_ where traitgroup0_.model_id=?
Hibernate: select traits0_.group_id as group_id5_7_0_, traits0_.id as id1_7_0_, traits0_.id as id1_7_1_, traits0_.data_type as data_typ2_7_1_, traits0_.name as name3_7_1_, traits0_.trait_id as trait_id4_7_1_, traitvalue1_.id as id2_11_2_, traitvalue1_2_.value as value1_10_2_, traitvalue1_.trait_type as trait_ty1_11_2_ from SREG_Trait traits0_ left outer join SREG_TraitValueBase traitvalue1_ on traits0_.trait_id=traitvalue1_.id left outer join SREG_TraitMultiValue traitvalue1_1_ on traitvalue1_.id=traitvalue1_1_.id left outer join SREG_TraitSingleValue traitvalue1_2_ on traitvalue1_.id=traitvalue1_2_.id where traits0_.group_id=?
Started cache [name=Person, mode=REPLICATED]
Failed to obtain remote job result policy for result from ComputeTask.result(..) method (will fail the whole task): GridJobResultImpl [job=C2 [], sib=GridJobSiblingImpl [sesId=e4f38fd2451-8f12688b-fef6-4981-a5f4-aa6781438930, jobId=15f38fd2451-e93bc2fa-8a37-4a50-9a22-071abece643f, nodeId=e93bc2fa-8a37-4a50-9a22-071abece643f, isJobDone=false], jobCtx=GridJobContextImpl [jobId=15f38fd2451-e93bc2fa-8a37-4a50-9a22-071abece643f, timeoutObj=null, attrs={}], node=TcpDiscoveryNode [id=e93bc2fa-8a37-4a50-9a22-071abece643f, addrs=[0:0:0:0:0:0:0:1%1, 10.113.56.231, 127.0.0.1, 192.168.122.1], sockAddrs=[/192.168.122.1:47500, /0:0:0:0:0:0:0:1%1:47500, /10.113.56.231:47500, /10.113.56.231:47500, /127.0.0.1:47500, /192.168.122.1:47500], discPort=47500, order=2, intOrder=2, lastExchangeTime=1461060127285, loc=false, ver=1.5.0#20151229-sha1:f1f8cda2, isClient=false], ex=class o.a.i.IgniteException: null, hasRes=true, isCancelled=false, isOccupied=true]
class org.apache.ignite.IgniteException: Remote job threw user exception (override or implement ComputeTask.result(..) method if you would like to have automatic failover for this exception).
at org.apache.ignite.compute.ComputeTaskAdapter.result(ComputeTaskAdapter.java:101)
at org.apache.ignite.internal.processors.task.GridTaskWorker$3.apply(GridTaskWorker.java:909)
at org.apache.ignite.internal.processors.task.GridTaskWorker$3.apply(GridTaskWorker.java:902)
at org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6429)
at org.apache.ignite.internal.processors.task.GridTaskWorker.result(GridTaskWorker.java:902)
at org.apache.ignite.internal.processors.task.GridTaskWorker.onResponse(GridTaskWorker.java:798)
at org.apache.ignite.internal.processors.task.GridTaskProcessor.processJobExecuteResponse(GridTaskProcessor.java:995)
at org.apache.ignite.internal.processors.task.GridTaskProcessor$JobMessageListener.onMessage(GridTaskProcessor.java:1219)
at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:821)
at org.apache.ignite.internal.managers.communication.GridIoManager.access$1600(GridIoManager.java:103)
at org.apache.ignite.internal.managers.communication.GridIoManager$5.run(GridIoManager.java:784)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: class org.apache.ignite.IgniteException: null
at org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2.execute(GridClosureProcessor.java:1792)
at org.apache.ignite.internal.processors.job.GridJobWorker$2.call(GridJobWorker.java:509)
at org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6397)
at org.apache.ignite.internal.processors.job.GridJobWorker.execute0(GridJobWorker.java:503)
at org.apache.ignite.internal.processors.job.GridJobWorker.body(GridJobWorker.java:456)
at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
at org.apache.ignite.internal.processors.job.GridJobProcessor.processJobExecuteRequest(GridJobProcessor.java:1166)
at org.apache.ignite.internal.processors.job.GridJobProcessor$JobExecutionListener.onMessage(GridJobProcessor.java:1770)
at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:821)
at org.apache.ignite.internal.managers.communication.GridIoManager.access$1600(GridIoManager.java:103)
at org.apache.ignite.internal.managers.communication.GridIoManager$5.run(GridIoManager.java:784)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
... 1 more
Caused by: java.lang.NullPointerException
at org.apache.ignite.internal.processors.cache.GridCacheAdapter$LoadCacheClosure.call(GridCacheAdapter.java:5769)
at org.apache.ignite.internal.processors.cache.GridCacheAdapter$LoadCacheClosure.call(GridCacheAdapter.java:5716)
at org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2.execute(GridClosureProcessor.java:1789)
... 13 more
java.lang.NullPointerException
at org.apache.ignite.internal.processors.cache.GridCacheAdapter$LoadCacheClosure.call(GridCacheAdapter.java:5769)
at org.apache.ignite.internal.processors.cache.GridCacheAdapter$LoadCacheClosure.call(GridCacheAdapter.java:5716)
at org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2.execute(GridClosureProcessor.java:1789)
at org.apache.ignite.internal.processors.job.GridJobWorker$2.call(GridJobWorker.java:509)
at org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6397)
at org.apache.ignite.internal.processors.job.GridJobWorker.execute0(GridJobWorker.java:503)
at org.apache.ignite.internal.processors.job.GridJobWorker.body(GridJobWorker.java:456)
at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
at org.apache.ignite.internal.processors.job.GridJobProcessor.processJobExecuteRequest(GridJobProcessor.java:1166)
at org.apache.ignite.internal.processors.job.GridJobProcessor$JobExecutionListener.onMessage(GridJobProcessor.java:1770)
at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:821)
at org.apache.ignite.internal.managers.communication.GridIoManager.access$1600(GridIoManager.java:103)
at org.apache.ignite.internal.managers.communication.GridIoManager$5.run(GridIoManager.java:784)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
[main] INFO org.springframework.test.context.transaction.TransactionContext - Rolled back transaction for test context [DefaultTestContext#2478b629 testClass = StartServiceTest, testInstance = com.subex.roc.cache.startserviceintegration.StartServiceTest#39023dbf, testMethod = startNodeTest#StartServiceTest, testException = [null], mergedContextConfiguration = [MergedContextConfiguration#2c2c3947 testClass = StartServiceTest, locations = '{}', classes = '{class com.subex.roc.cache.IgniteJPAConfiguration, class com.subex.roc.cache.IgniteEnvConfiguration}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]].
Invoking shutdown hook...
[Thread-3] INFO org.springframework.context.support.GenericApplicationContext - Closing org.springframework.context.support.GenericApplicationContext#d44fc21: startup date [Tue Apr 19 15:32:01 IST 2016]; root of context hierarchy
Command protocol successfully stopped: TCP binary
Stopped cache: ignite-marshaller-sys-cache
Stopped cache: ignite-sys-cache
Stopped cache: ignite-atomics-sys-cache
Stopped cache: bookeeperCache
Stopped cache: Person
>>> +---------------------------------------------------------------------------------------+
>>> Ignite ver. 1.5.0-final#20151229-sha1:f1f8cda2f3f62231f42a59951bf34c39577c1bec stopped OK
>>> +---------------------------------------------------------------------------------------+
>>> Grid name: subexIgnite
>>> Grid uptime: 00:00:14:747
[Thread-3] INFO org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'ben'
The possibility of this NPE is removed in the latest Ignite version (1.6.0). It can be downloaded here: ignite.apache.org/download.cgi#binaries

Maximo Anywhere Not Able To login

I have Maximo Anywhere installed on WebSphere 8.5.5.3 and Maximo installed in Weblogic
i am not able to login to anywhere apps
i tried to debug it from chrome console i found its stuck on loop as the below
> worklight.js:4675 Request [login]
Logger.js:163 [TRACE] ServerAuthenticationProvider.login
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] true - authStatus
Logger.js:163 [TRACE] [ServerAuthenticationProvider] User test successfully authentication against realm "CustomAuthenticationRealm"
worklight.js:4675 Request [/worklight/apps/services/api/WorkExecution/common/query]
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] false
worklight.js:4675 response [/worklight/apps/services/api/WorkExecution/common/query] success: /*-secure-
{"isSuccessful":true,"userId":"test","attributes":{"Cookie":"JSESSIONID=0000NpUyrxPJPTCpeahWtAKZ-xr:-1; Path=\/","AuthenticationDate":"Wed Jul 08 03:07:48 GST 2015"},"isUserAuthenticated":1,"responseID":"149252","displayName":null}*/
Logger.js:163 [TRACE] User test authenticated successfully on server
Logger.js:163 [TRACE] [COMM] Previous "userInfo" resource data request resolved.
Logger.js:163 [TRACE] [COMM] Getting data from adapter if connectivity is available.
Logger.js:231 [TIMER] [COMM] Fetching simulator for connectivity: 1ms
Logger.js:163 [TRACE] [COMM] Connectivity is available
Logger.js:163 [TRACE] [COMM] Requesting data for adapter
Logger.js:151 [COMM] resourceUrl: http://192.168.1.31:7001/maximo/oslc/os/oslcmaxuser?savedQuery=currentUser&…Bspi%3Agroupname%7D&oslc.pageSize=300&oslc.orderBy=%2Bdcterms%3Aidentifier
Logger.js:163 [TRACE] Invoking adapter with these parameters: {"adapter":"OSLCGenericAdapter","procedure":"query","parameters":[{"url":"http://192.168.1.31:7001/maximo/oslc/os/oslcmaxuser?savedQuery=currentUser&…Bspi%3Agroupname%7D&oslc.pageSize=300&oslc.orderBy=%2Bdcterms%3Aidentifier","sessionid":"JSESSIONID=0000NpUyrxPJPTCpeahWtAKZ-xr:-1; Path=/","langcode":"en-US"}],"timeout":360000}
worklight.js:4675 Request [/worklight/apps/services/api/WorkExecution/common/query]
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] false
worklight.js:4675 response [/worklight/apps/services/api/WorkExecution/common/query] success: /*-secure-
{"isSuccessful":false,"errors":[{"oslc:extendedError":{"oslc:moreInfo":{"rdf:resource":"http:\/\/192.168.1.31:7001\/maximo\/oslc\/error\/messages\/BMXAA0021E04"}},"oslc:message":"BMXAA0021E04 - User name and password combination are not valid. Try again.","oslc:statusCode":"401","spi:reasonCode":"BMXAA0021E04"}],"responseID":"149253"}*/
worklight.js:4675 Procedure invocation error. [object Object]WL.Logger.__log # worklight.js:4675PUBLIC_API.(anonymous function) # worklight.js:4860onInvokeProcedureSuccess # worklight.js:7353window.WLJSX.Ajax.WLRequest.WLJSX.Class.create.onSuccess # worklight.js:3240window.WLJSX.Ajax.WLRequest.WLJSX.Class.create.onWlSuccess # worklight.js:3212(anonymous function) # worklight.js:949window.WLJSX.Ajax.Request.WLJSX.Class.create.respondToReadyState # worklight.js:1158window.WLJSX.Ajax.Request.WLJSX.Class.create.onStateChange # worklight.js:1096(anonymous function) # worklight.js:949
Logger.js:163 [TRACE] UserAuthenticationManager.invokeAdapterSecurely: onFailure{"status":200,"invocationContext":null,"errorCode":"PROCEDURE_ERROR","errorMsg":"Procedure invocation error. [object Object]","invocationResult":{"isSuccessful":false,"errors":[{"oslc:extendedError":{"oslc:moreInfo":{"rdf:resource":"http://192.168.1.31:7001/maximo/oslc/error/messages/BMXAA0021E04"}},"oslc:message":"BMXAA0021E04 - User name and password combination are not valid. Try again.","oslc:statusCode":"401","spi:reasonCode":"BMXAA0021E04"}],"responseID":"149253"}}
Logger.js:163 [TRACE] Session for user test expired
Logger.js:163 [TRACE] Reauthenticating
Logger.js:163 [TRACE] Authenticating user test against realm CustomAuthenticationRealm
Logger.js:231 [TIMER] [COMM] Fetching simulator for connectivity: 0ms
Logger.js:163 [TRACE] ServerAuthenticationProvider.login
worklight.js:4675 Request [login]
Logger.js:163 [TRACE] ServerAuthenticationProvider.login
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] true - authStatus
Logger.js:163 [TRACE] [ServerAuthenticationProvider] User test successfully authentication against realm "CustomAuthenticationRealm"
worklight.js:4675 Request [/worklight/apps/services/api/WorkExecution/common/query]
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] false
worklight.js:4675 response [/worklight/apps/services/api/WorkExecution/common/query] success: /*-secure-
{"isSuccessful":true,"userId":"test","attributes":{"Cookie":"JSESSIONID=0000NpUyrxPJPTCpeahWtAKZ-xr:-1; Path=\/","AuthenticationDate":"Wed Jul 08 03:07:48 GST 2015"},"isUserAuthenticated":1,"responseID":"149254","displayName":null}*/
Logger.js:163 [TRACE] User test authenticated successfully on server
Logger.js:163 [TRACE] [COMM] Previous "userInfo" resource data request resolved.
Logger.js:163 [TRACE] [COMM] Getting data from adapter if connectivity is available.
Logger.js:231 [TIMER] [COMM] Fetching simulator for connectivity: 0ms
Logger.js:163 [TRACE] [COMM] Connectivity is available
Logger.js:163 [TRACE] [COMM] Requesting data for adapter
Logger.js:151 [COMM] resourceUrl: http://192.168.1.31:7001/maximo/oslc/os/oslcmaxuser?savedQuery=currentUser&…Bspi%3Agroupname%7D&oslc.pageSize=300&oslc.orderBy=%2Bdcterms%3Aidentifier
Logger.js:163 [TRACE] Invoking adapter with these parameters: {"adapter":"OSLCGenericAdapter","procedure":"query","parameters":[{"url":"http://192.168.1.31:7001/maximo/oslc/os/oslcmaxuser?savedQuery=currentUser&…Bspi%3Agroupname%7D&oslc.pageSize=300&oslc.orderBy=%2Bdcterms%3Aidentifier","sessionid":"JSESSIONID=0000NpUyrxPJPTCpeahWtAKZ-xr:-1; Path=/","langcode":"en-US"}],"timeout":360000}
worklight.js:4675 Request [/worklight/apps/services/api/WorkExecution/common/query]
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] false
worklight.js:4675 response [/worklight/apps/services/api/WorkExecution/common/query] success: /*-secure-
{"isSuccessful":false,"errors":[{"oslc:extendedError":{"oslc:moreInfo":{"rdf:resource":"http:\/\/192.168.1.31:7001\/maximo\/oslc\/error\/messages\/BMXAA0021E04"}},"oslc:message":"BMXAA0021E04 - User name and password combination are not valid. Try again.","oslc:statusCode":"401","spi:reasonCode":"BMXAA0021E04"}],"responseID":"149255"}*/
worklight.js:4675 Procedure invocation error. [object Object]WL.Logger.__log # worklight.js:4675PUBLIC_API.(anonymous function) # worklight.js:4860onInvokeProcedureSuccess # worklight.js:7353window.WLJSX.Ajax.WLRequest.WLJSX.Class.create.onSuccess # worklight.js:3240window.WLJSX.Ajax.WLRequest.WLJSX.Class.create.onWlSuccess # worklight.js:3212(anonymous function) # worklight.js:949window.WLJSX.Ajax.Request.WLJSX.Class.create.respondToReadyState # worklight.js:1158window.WLJSX.Ajax.Request.WLJSX.Class.create.onStateChange # worklight.js:1096(anonymous function) # worklight.js:949
Logger.js:163 [TRACE] UserAuthenticationManager.invokeAdapterSecurely: onFailure{"status":200,"invocationContext":null,"errorCode":"PROCEDURE_ERROR","errorMsg":"Procedure invocation error. [object Object]","invocationResult":{"isSuccessful":false,"errors":[{"oslc:extendedError":{"oslc:moreInfo":{"rdf:resource":"http://192.168.1.31:7001/maximo/oslc/error/messages/BMXAA0021E04"}},"oslc:message":"BMXAA0021E04 - User name and password combination are not valid. Try again.","oslc:statusCode":"401","spi:reasonCode":"BMXAA0021E04"}],"responseID":"149255"}}
Logger.js:163 [TRACE] Session for user test expired
Logger.js:163 [TRACE] Reauthenticating
Logger.js:163 [TRACE] Authenticating user test against realm CustomAuthenticationRealm
Logger.js:231 [TIMER] [COMM] Fetching simulator for connectivity: 0ms
Logger.js:163 [TRACE] ServerAuthenticationProvider.login
worklight.js:4675 Request [login]
Logger.js:163 [TRACE] ServerAuthenticationProvider.login
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] true - authStatus
Logger.js:163 [TRACE] [ServerAuthenticationProvider] User test successfully authentication against realm "CustomAuthenticationRealm"
worklight.js:4675 Request [/worklight/apps/services/api/WorkExecution/common/query]
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] false
worklight.js:4675 response [/worklight/apps/services/api/WorkExecution/common/query] success: /*-secure-
{"isSuccessful":true,"userId":"test","attributes":{"Cookie":"JSESSIONID=0000NpUyrxPJPTCpeahWtAKZ-xr:-1; Path=\/","AuthenticationDate":"Wed Jul 08 03:07:48 GST 2015"},"isUserAuthenticated":1,"responseID":"149256","displayName":null}*/
Logger.js:163 [TRACE] User test authenticated successfully on server
Logger.js:163 [TRACE] [COMM] Previous "userInfo" resource data request resolved.
Logger.js:163 [TRACE] [COMM] Getting data from adapter if connectivity is available.
Logger.js:231 [TIMER] [COMM] Fetching simulator for connectivity: 1ms
Logger.js:163 [TRACE] [COMM] Connectivity is available
Logger.js:163 [TRACE] [COMM] Requesting data for adapter
Logger.js:151 [COMM] resourceUrl: http://192.168.1.31:7001/maximo/oslc/os/oslcmaxuser?savedQuery=currentUser&…Bspi%3Agroupname%7D&oslc.pageSize=300&oslc.orderBy=%2Bdcterms%3Aidentifier
Logger.js:163 [TRACE] Invoking adapter with these parameters: {"adapter":"OSLCGenericAdapter","procedure":"query","parameters":[{"url":"http://192.168.1.31:7001/maximo/oslc/os/oslcmaxuser?savedQuery=currentUser&…Bspi%3Agroupname%7D&oslc.pageSize=300&oslc.orderBy=%2Bdcterms%3Aidentifier","sessionid":"JSESSIONID=0000NpUyrxPJPTCpeahWtAKZ-xr:-1; Path=/","langcode":"en-US"}],"timeout":360000}
worklight.js:4675 Request [/worklight/apps/services/api/WorkExecution/common/query]
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] false
worklight.js:4675 response [/worklight/apps/services/api/WorkExecution/common/query] success: /*-secure-
{"isSuccessful":false,"errors":[{"oslc:extendedError":{"oslc:moreInfo":{"rdf:resource":"http:\/\/192.168.1.31:7001\/maximo\/oslc\/error\/messages\/BMXAA0021E04"}},"oslc:message":"BMXAA0021E04 - User name and password combination are not valid. Try again.","oslc:statusCode":"401","spi:reasonCode":"BMXAA0021E04"}],"responseID":"149257"}*/
worklight.js:4675 Procedure invocation error. [object Object]WL.Logger.__log # worklight.js:4675PUBLIC_API.(anonymous function) # worklight.js:4860onInvokeProcedureSuccess # worklight.js:7353window.WLJSX.Ajax.WLRequest.WLJSX.Class.create.onSuccess # worklight.js:3240window.WLJSX.Ajax.WLRequest.WLJSX.Class.create.onWlSuccess # worklight.js:3212(anonymous function) # worklight.js:949window.WLJSX.Ajax.Request.WLJSX.Class.create.respondToReadyState # worklight.js:1158window.WLJSX.Ajax.Request.WLJSX.Class.create.onStateChange # worklight.js:1096(anonymous function) # worklight.js:949
Logger.js:163 [TRACE] UserAuthenticationManager.invokeAdapterSecurely: onFailure{"status":200,"invocationContext":null,"errorCode":"PROCEDURE_ERROR","errorMsg":"Procedure invocation error. [object Object]","invocationResult":{"isSuccessful":false,"errors":[{"oslc:extendedError":{"oslc:moreInfo":{"rdf:resource":"http://192.168.1.31:7001/maximo/oslc/error/messages/BMXAA0021E04"}},"oslc:message":"BMXAA0021E04 - User name and password combination are not valid. Try again.","oslc:statusCode":"401","spi:reasonCode":"BMXAA0021E04"}],"responseID":"149257"}}
Logger.js:163 [TRACE] Session for user test expired
Logger.js:163 [TRACE] Reauthenticating
Logger.js:163 [TRACE] Authenticating user test against realm CustomAuthenticationRealm
Logger.js:231 [TIMER] [COMM] Fetching simulator for connectivity: 0ms
Logger.js:163 [TRACE] ServerAuthenticationProvider.login
*i tried to call the OSLC Link direct from Maximo its working fine.
*i tried to run the application from eclipse and using Librity server it working fine .
I Restarted the Server where Work-light installed the exception changed to
Authentication (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:303:23)
at Object.lang.mixin.login (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:133:10)
at declare.loginClickHandler (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/handlers/LoginHandler.js:72:47)
at null.<anonymous> (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/ui/control/UserInterface.js:757:47)
at HTMLButtonElement.e.hitch (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:34:484)
at Function.g.emit (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:106:485)
at declare.fire (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojox/gesture/Base.js:306:7)"l # dojo.js:59h # dojo.js:59k.around.advice # dojo.js:95e.(anonymous function).k # dojo.js:94m # dojo.js:89q.reject # dojo.js:92a # dojo.js:90g # dojo.js:89o.then.b.then # dojo.js:92classBody._activateCollections # PersistenceManager.js:303classBody.activateCollectionsOrFail # PersistenceManager.js:284lang.mixin._localAuthentication # UserAuthenticationManager.js:303lang.mixin.login # UserAuthenticationManager.js:133declare.loginClickHandler # LoginHandler.js:72(anonymous function) # UserInterface.js:757e.hitch # dojo.js:34g.emit # dojo.js:106declare.fire # Base.js:306declare.release # tap.js:104declare._process # Base.js:273e._hitchArgs # dojo.js:34
Startup.js:42 === Global promise rejection handling ===
Startup.js:43 === handled: true
Startup.js:44 Hiding the "Loading..." message in 8 seconds
Startup.js:42 === Global promise rejection handling ===
Startup.js:43 === handled: false
Startup.js:44 Hiding the "Loading..." message in 8 seconds
dojo.js:59 Object {name: undefined, messageKey: undefined, params: Array[0], stack: "undefined? at http://localhost:9084/worklight/a…fault/js/platform/handlers/LoginHandler.js:72:47)"} "undefined
at http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/store/PersistenceManager.js:308:23
at g (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:89:320)
at o.then.b.then [as then] (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:92:198)
at classBody._activateCollections (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/store/PersistenceManager.js:303:4)
at classBody.activateCollectionsOrFail (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/store/PersistenceManager.js:284:16)
at Object.lang.mixin._localAuthentication (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:303:23)
at Object.lang.mixin.login (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:133:10)
at declare.loginClickHandler (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/handlers/LoginHandler.js:72:47)
----------------------------------------
rejected at a (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:90:226)
at g (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:89:493)
at o.then.b.then [as then] (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:92:198)
at Object.lang.mixin._localAuthentication (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:304:4)
at Object.lang.mixin.login (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:133:10)
at declare.loginClickHandler (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/handlers/LoginHandler.js:72:47)
at null.<anonymous> (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/ui/control/UserInterface.js:757:47)
at HTMLButtonElement.e.hitch (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:34:484)
at Function.g.emit (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:106:485)
at declare.fire (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojox/gesture/Base.js:306:7)
----------------------------------------
Error
at o.then.b.then [as then] (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:92:143)
at Object.lang.mixin._localAuthentication (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:304:4)
at Object.lang.mixin.login (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:133:10)
at declare.loginClickHandler (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/handlers/LoginHandler.js:72:47)
at null.<anonymous> (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/ui/control/UserInterface.js:757:47)
at HTMLButtonElement.e.hitch (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:34:484)
at Function.g.emit (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:106:485)
at declare.fire (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojox/gesture/Base.js:306:7)
at declare.release (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojox/gesture/tap.js:104:10)
at declare._process (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojox/gesture/Base.js:273:15)"l # dojo.js:59h # dojo.js:59k.around.advice # dojo.js:95e.(anonymous function).k # dojo.js:94m # dojo.js:89q.reject # dojo.js:92a # dojo.js:90g # dojo.js:89o.then.b.then # dojo.js:92lang.mixin._localAuthentication # UserAuthenticationManager.js:304lang.mixin.login # UserAuthenticationManager.js:133declare.loginClickHandler # LoginHandler.js:72(anonymous function) # UserInterface.js:757e.hitch # dojo.js:34g.emit # dojo.js:106declare.fire # Base.js:306declare.release # tap.js:104declare._process # Base.js:273e._hitchArgs # dojo.js:34
Startup.js:42 === Global promise rejection handling ===
Startup.js:43 === handled: false
Startup.js:44 Hiding the "Loading..." message in 8 seconds
dojo.js:59 Object {name: undefined, messageKey: undefined, params: Array[0], stack: "undefined? at http://localhost:9084/worklight/a…fault/js/platform/handlers/LoginHandler.js:72:47)"} "undefined
at http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/store/PersistenceManager.js:308:23
at g (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:89:320)
at o.then.b.then [as then] (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:92:198)
at classBody._activateCollections (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/store/PersistenceManager.js:303:4)
at classBody.activateCollectionsOrFail (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/store/PersistenceManager.js:284:16)
at Object.lang.mixin._localAuthentication (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:303:23)
at Object.lang.mixin.login (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:133:10)
at declare.loginClickHandler (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/handlers/LoginHandler.js:72:47)
----------------------------------------
rejected at a (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:90:226)
at g (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:89:479)
at o.then.b.then [as then] (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:92:198)
at classBody._activateCollections (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/store/PersistenceManager.js:303:4)
at classBody.activateCollectionsOrFail (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/store/PersistenceManager.js:284:16)
at Object.lang.mixin._localAuthentication (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:303:23)
at Object.lang.mixin.login (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:133:10)
at declare.loginClickHandler (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/handlers/LoginHandler.js:72:47)
at null.<anonymous> (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/ui/control/UserInterface.js:757:47)
at HTMLButtonElement.e.hitch (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:34:484)
----------------------------------------
undefined"l # dojo.js:59h # dojo.js:59k.around.advice # dojo.js:95e.(anonymous function).k # dojo.js:94g # dojo.js:90o.then.b.then # dojo.js:92lang.mixin._localAuthentication # UserAuthenticationManager.js:304lang.mixin.login # UserAuthenticationManager.js:133declare.loginClickHandler # LoginHandler.js:72(anonymous function) # UserInterface.js:757e.hitch # dojo.js:34g.emit # dojo.js:106declare.fire # Base.js:306declare.release # tap.js:104declare._process # Base.js:273e._hitchArgs # dojo.js:34
Logger.js:163 [TRACE] Authenticating user test1 against realm CustomAuthenticationRealm
Logger.js:231 [TIMER] [COMM] Fetching simulator for connectivity: 0ms
Logger.js:163 [TRACE] ServerAuthenticationProvider.login
Logger.js:231 [TIMER] [COMM] Fetching simulator for connectivity: 1ms
worklight.js:4675 Request [/worklight/apps/services/api/WorkExecution/common/query]
Startup.js:42 === Global promise rejection handling ===
Startup.js:43 === handled: true
Startup.js:44 Hiding the "Loading..." message in 8 seconds
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] false
worklight.js:4675 response [/worklight/apps/services/api/WorkExecution/common/query] success: /*-secure-
{"properties":{"si.auth.type":"maximo"},"isSuccessful":true,"responseID":"7"}*/
Logger.js:163 [TRACE] [COMM] Successfully returned properties: {"si.auth.type":"maximo"}
worklight.js:4675 Request [login]
Logger.js:163 [TRACE] ServerAuthenticationProvider.login
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] true - authStatus
Logger.js:151 [_realmAuthentication] Unable to authenticate user test1 on server
Logger.js:151 Loading message showed by application = true
Logger.js:151 Cancel processing requested
Logger.js:163 [TRACE] Closing local storage
Startup.js:42 === Global promise rejection handling ===
Startup.js:43 === handled: true
Startup.js:44 Hiding the "Loading..." message in 8 seconds
Startup.js:42 === Global promise rejection handling ===
Startup.js:43 === handled: false
Startup.js:44 Hiding the "Loading..." message in 8 seconds
dojo.js:59 Object {oslcError: "null oslcError", errorMsg: "Your user name and password could not be validated. Connect to the server and try again."} "
----------------------------------------
rejected at Object.<anonymous> (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:523:17)
at e.hitch (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:34:484)
at g (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:89:320)
at m (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:89:246)
at q.reject (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:92:33)
at a (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:90:226)
at g (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:89:493)
at m
So you said you restarted the server worklight is installed on. The first thing i would ask then is the war file that you deployed to that server, when it was built, was it pointing to a different Maximo than what your adapter currently has?
If it worked in the liberty server, I would say to update the war file that your worklight server is using, there may be a difference in what it is pointing.
This would involve updating your build.properties'
worklight.server.* properties, then rebuild the app, and then redeploy the war file that you will have in your MaximoAnywhere/bin directory
You have a authentication/login error based on "errorMsg: "Your user name and password could not be validated. Connect to the server and try again." and "oslc:statusCode":"401" . I don't know much about Anywhere. Can you explain how the authentication to the backend (OSLC oto Maximo) is hapenning ? What is the security test declared in for "OSLCGenericAdapter" procedure:"query",? It seems you are doing a request to "http://192.168.1.31:7001/maximo/oslc/os/oslcmaxuser" maybe this server is not available ? Are you using some invalid username/pass ?

FTDI via libusb error EPIPE

I'm trying to work with an FTDI-based USB device and I'm getting a -32 (EPIPE) error:
08-06 16:32:16.328: WARN/System.err(15547): ftdi_usb_open_dev()
08-06 16:32:16.328: WARN/System.err(15547): usb_detach_kernel_driver_np()libusb: 0.029116 debug [libusb_detach_kernel_driver] interface 0
08-06 16:32:16.328: WARN/System.err(15547): ftdi claim interface ...
08-06 16:32:16.328: WARN/System.err(15547): libusb-compat debug: usb_claim_interface: interface 0
08-06 16:32:16.328: WARN/System.err(15547): libusb: 0.030246 debug [libusb_claim_interface] interface 0
08-06 16:32:16.328: WARN/System.err(15547): claiming interface using fd = 4
08-06 16:32:16.328: WARN/System.err(15547): ftdi_usb_reset ...
08-06 16:32:16.328: WARN/System.err(15547): libusb-compat debug: usb_control_msg: RQT=40 RQ=0 V=0 I=0 len=0 timeout=300
08-06 16:32:16.328: WARN/System.err(15547): libusb: 0.031222 debug [libusb_get_next_timeout] next timeout in 0.300000s
08-06 16:32:16.328: WARN/System.err(15547): libusb: 0.031527 debug [libusb_handle_events_timeout_completed] doing our own event handling
08-06 16:32:16.328: WARN/System.err(15547): libusb: 0.032046 debug [handle_events] poll() 2 fds with timeout in 300ms
08-06 16:32:16.328: WARN/System.err(15547): libusb: 0.033023 debug [handle_events] poll() returned 1
08-06 16:32:16.338: WARN/System.err(15547): libusb: 0.033389 debug [reap_for_handle] urb type=2 status=-32 transferred=0
08-06 16:32:16.338: WARN/System.err(15547): libusb: 0.033755 debug [handle_control_completion] handling completion status -32
08-06 16:32:16.338: WARN/System.err(15547): libusb: 0.034091 debug [handle_control_completion] unsupported control request
08-06 16:32:16.338: WARN/System.err(15547): libusb: 0.034366 debug [usbi_handle_transfer_completion] transfer 0x2915e0 has callback 0x5ccb4
08-06 16:32:16.338: WARN/System.err(15547): libusb: 0.034732 debug [ctrl_transfer_cb] actual_length=0
The USB request seems to be exactly as it is required according to FTDI Chip Commands.
FTDI context is initialized without errors, usb_dev is not null and it seems to be okay. The cable is okay as I can use it for uploading Arduino sketches to Duemilanove (FTDI) boards.
So I'm completely stuck.. What should I do?
My code
struct ftdi_context *ftdi_ctx;
struct usb_device *dev;
usb_dev_handle *udev;
// ...
ftdi_ctx = ftdi_new();
if (ftdi_ctx == NULL) {
fprintf(stderr, "error init ftdi context\n");
return 1;
}
ftdi_ctx->usb_write_timeout = 0;
ftdi_ctx->usb_read_timeout = 0;
// ...
udev = usb_open(dev);
int ret = ftdi_usb_open_dev(ftdi_ctx, dev, udev);
if (ret < 0) {
fprintf(stderr, "error opening ftdi device\n");
return ret;
}
ftdi_usb_open_dev() is slightly modified to get ready usb_device and don't do usb_open inside:
libftdi-0.1 code (ftdi.c):
int ftdi_usb_open_dev(struct ftdi_context *ftdi, struct usb_device *dev, struct usb_dev_handle *usb_dev)
{
int detach_errno = 0;
int config_val = 1;
fprintf(stderr, "ftdi_usb_open_dev()\n");
if (ftdi == NULL) {
fprintf(stderr, "ftdi context invalid\n");
ftdi_error_return(-8, "ftdi context invalid");
}
// 4ntoine (no need to open device if usb_dev is already passed)
if (usb_dev == NULL) {
if (!(ftdi->usb_dev = usb_open(dev)))
ftdi_error_return(-4, "usb_open() failed");
} else {
ftdi->usb_dev = usb_dev;
}
#ifdef LIBUSB_HAS_GET_DRIVER_NP
// Try to detach ftdi_sio kernel module.
// Returns ENODATA if driver is not loaded.
//
// The return code is kept in a separate variable and only parsed
// if usb_set_configuration() or usb_claim_interface() fails as the
// detach operation might be denied and everything still works fine.
// Likely scenario is a static ftdi_sio kernel module.
fprintf(stderr, "detaching kernel driver... \n");
if (ftdi->module_detach_mode == AUTO_DETACH_SIO_MODULE)
{
fprintf(stderr, "usb_detach_kernel_driver_np() ...\n");
if (usb_detach_kernel_driver_np(ftdi->usb_dev, ftdi->interface) != 0 && errno != ENODATA) {
fprintf(stderr, "failed to detach\n");
detach_errno = errno;
}
}
#endif
fprintf(stderr, "ftdi claim interface ...\n");
if (usb_claim_interface(ftdi->usb_dev, ftdi->interface) != 0)
{
fprintf(stderr, "failed to claim interface\n");
ftdi_usb_close_internal (ftdi);
if (detach_errno == EPERM)
{
ftdi_error_return(-8, "inappropriate permissions on device!");
}
else
{
ftdi_error_return(-5, "unable to claim usb device. Make sure the default FTDI driver is not in use");
}
}
fprintf(stderr, "ftdi claimed interface\n");
fprintf(stderr, "ftdi_usb_reset ...\n");
if (ftdi_usb_reset (ftdi) != 0)
{
ftdi_usb_close_internal (ftdi);
ftdi_error_return(-6, "ftdi_usb_reset failed");
}
I've tested it with another FTDI-board (Arduino Nano v3) and still the same error, so the problem is not in the board most likely...
I've tested it on another Android device with USB host support too and another Android OS version (4.0.x) and still the same error...
Is your host system Windows or Linux?
It seems that the device failed to respond to the control message issued by ftdi_usb_reset(). And the ftdi_usb_reset() is actually called by ftdi_usb_open_dev().
If checking the libftdi source code:
http://www.intra2net.com/en/developer/libftdi/documentation/ftdi_8c_source.html#l00522
We found that it shall return -6 if ftdi_usb_reset() fails. The entire error log is not posted here, so I wonder if it is what truly happened finally. And maybe there are more interesting things to go see there.
Maybe showing your code here can help get a better understanding. :)
If possible on your side, when trying to do the same thing with D2XX driver provided by ftdichip.com, will the result be the same?
Correct me if my understanding is wrong: You are developing native code that works on Android (the underlying Linux system) that calls libftdi and libusb, right? And I assume the purpose is to use Android devices through libusb without root needed?
A little search on Google tells me that there is no "official" Android port for libusb. Some platform works with libusb while some cannot. People are having different kinds of feedbacks.
So if going back to basics, say, using only the functions in libusb, without the libftdi code you've modified, can you perform device open, close, and send control message to your FTDI device through basic libusb functions?
Or, if possible, try with an unmodified libftdi. Will it to the job it is supposed to do?
And by the way, why libftdi0.1? I knew it should be version 1.0 by now. Older versions could be buggy...
I just try to provide something that is worth trying. It could be a libusb problem, a libftdi problem, or simply a problem of the sequence how you operate the device. So if not sure where it goes wrong, then break them down to pieces and identify what are correct would be what I would try.