我的应用程序在 模拟器 中运行良好。当我将应用程序安装到设备中时,我收到以下异常"screenjava.lang.NullPointerException"
。因此,我的应用程序没有响应。怎么处理?任何人都可以帮助我。
以下是Logcat:
06-30 15:42:54.528: DEBUG/dalvikvm(231): GC freed 2362 objects / 145704 bytes in 186ms
06-30 15:42:56.017: DEBUG/AndroidRuntime(1371): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
06-30 15:42:56.027: DEBUG/AndroidRuntime(1371): CheckJNI is ON
06-30 15:42:56.268: DEBUG/AndroidRuntime(1371): --- registering native functions ---
06-30 15:42:56.627: DEBUG/ddm-heap(1371): Got feature list request
06-30 15:42:57.028: DEBUG/AndroidRuntime(1371): Shutting down VM
06-30 15:42:57.037: DEBUG/dalvikvm(1371): DestroyJavaVM waiting for non-daemon threads to exit
06-30 15:42:57.037: DEBUG/dalvikvm(1371): DestroyJavaVM shutting VM down
06-30 15:42:57.037: DEBUG/dalvikvm(1371): HeapWorker thread shutting down
06-30 15:42:57.048: DEBUG/dalvikvm(1371): HeapWorker thread has shut down
06-30 15:42:57.048: DEBUG/jdwp(1371): JDWP shutting down net...
06-30 15:42:57.057: INFO/dalvikvm(1371): Debugger has detached; object registry had 1 entries
06-30 15:42:57.067: DEBUG/dalvikvm(1371): VM cleaning up
06-30 15:42:57.087: ERROR/AndroidRuntime(1371): ERROR: thread attach failed
06-30 15:42:57.107: DEBUG/dalvikvm(1371): LinearAlloc 0x0 used 628628 of 5242880 (11%)
06-30 15:42:57.617: DEBUG/AndroidRuntime(1379): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
06-30 15:42:57.617: DEBUG/AndroidRuntime(1379): CheckJNI is ON
06-30 15:42:57.916: DEBUG/AndroidRuntime(1379): --- registering native functions ---
06-30 15:42:58.267: DEBUG/ddm-heap(1379): Got feature list request
06-30 15:42:58.667: INFO/ActivityManager(51): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.ibkr.roadbrake/.RB_Login }
06-30 15:42:58.727: DEBUG/AndroidRuntime(1379): Shutting down VM
06-30 15:42:58.737: DEBUG/dalvikvm(1379): DestroyJavaVM waiting for non-daemon threads to exit
06-30 15:42:58.747: DEBUG/dalvikvm(1379): DestroyJavaVM shutting VM down
06-30 15:42:58.747: DEBUG/dalvikvm(1379): HeapWorker thread shutting down
06-30 15:42:58.758: DEBUG/dalvikvm(1379): HeapWorker thread has shut down
06-30 15:42:58.768: DEBUG/jdwp(1379): JDWP shutting down net...
06-30 15:42:58.768: INFO/dalvikvm(1379): Debugger has detached; object registry had 1 entries
06-30 15:42:58.787: DEBUG/dalvikvm(1379): VM cleaning up
06-30 15:42:58.797: ERROR/AndroidRuntime(1379): ERROR: thread attach failed
06-30 15:42:59.027: DEBUG/dalvikvm(1379): LinearAlloc 0x0 used 638596 of 5242880 (12%)
06-30 15:42:59.287: INFO/System.out(231): User Exit->false
06-30 15:42:59.427: INFO/ActivityManager(51): Displayed activity com.ibkr.roadbrake/.RB_Login: 735 ms (total 735 ms)
06-30 15:43:01.848: WARN/KeyCharacterMap(231): No keyboard for id 0
06-30 15:43:01.858: WARN/KeyCharacterMap(231): Using default keymap:
/system/usr/keychars/qwerty.kcm.bin
06-30 15:43:05.196: DEBUG/dalvikvm(106): GC freed 312 objects / 16168 bytes in 141ms
06-30 15:43:10.107: INFO/System.out(231): {"status":"SUCCESS","reason":"SUCCESS","response":{"userid":"1"}}
06-30 15:43:10.156: INFO/System.out(231): The Id is -- 1
06-30 15:43:10.247: INFO/System.out(231): Insert Start
06-30 15:43:10.257: INFO/System.out(231): Insert End
06-30 15:43:10.328: INFO/System.out(231): User not there in DB
06-30 15:43:10.367: INFO/System.out(231): 1false
06-30 15:43:10.388: INFO/System.out(231): 2true
06-30 15:43:10.417: INFO/System.out(231): 3false
06-30 15:43:10.417: INFO/System.out(231): 4false
06-30 15:43:10.417: INFO/System.out(231): 5false
06-30 15:43:10.447: INFO/ActivityManager(51): Starting activity: Intent { cmp=com.ibkr.roadbrake/.RB_UpcomingExits }
06-30 15:43:10.697: DEBUG/GpsLocationProvider(51): setMinTime 100
06-30 15:43:10.836: INFO/System.out(231): Request Value->GetUpcomingExits{strlatitude1=; strLongitude1=; strlatitude2=; strLongitude2=; nPrevHighway=0; headingdirection=0; strStates=; strHighways=; strCities=; strCategories=; strChains=; strCuisines=; strFavDishes=; strAlcohol=; strDining=; strFeatures=; totalRating=; restroomrating=; kidsrating=; strFoodQuality=; strServiceQuality=; strAtmosphere=; distance=; exits=; businesses=; keywords=; numReviews=; reviewedinLastDays=; rbPercent=; numFavs=; addedInLastDays=; strDiningReservations=; strDiningOthers=; strDiningOpenFor=; strPriceLow=; strPriceHigh=; strWifi=; strBusinessType=; nPage=1; nPageSize=2; }
06-30 15:43:11.178: INFO/ActivityManager(51): Displayed activity com.ibkr.roadbrake/.RB_UpcomingExits: 698 ms (total 698 ms)
06-30 15:43:11.236: INFO/System.out(231): Soap Method Error ->SoapFault - faultcode: 'soap:Server' faultstring: 'Server was unable to process request. ---> Input string was not in a correct format.' faultactor: 'null' detail: org.kxml2.kdom.Node@44e5e7b8
06-30 15:43:11.387: INFO/System.out(231): Error from WSResponse:java.lang.NullPointerException
06-30 15:43:19.666: INFO/ActivityManager(51): Starting activity: Intent { cmp=com.ibkr.roadbrake/.RB_StaticSearchFilters }
06-30 15:43:20.226: INFO/System.out(231): Filtertabopenornot:0
06-30 15:43:20.258: INFO/System.out(231): Request Value->GetUserSavedSearches{strUserName=mohan.g; }
06-30 15:43:20.797: INFO/ActivityManager(51): Displayed activity
com.ibkr.roadbrake/.RB_StaticSearchFilters: 1089 ms (total 1089 ms)
06-30 15:43:21.137: INFO/System.out(231): web service response->{"status":"SUCCESS","reason":"SUCCESS","response":[{"filtersetId":4,"name":"CT-95 exit 55","description":"entities around 55 exit of 95 highway in CT","filters":{"State":"Connecticut","HighWay":"95","Exit":"55"}},{"filtersetId":13,"name":"secaucus \u003c 1mi","description":"sdf dsf ","filters":{"State":"New Jersey","City":"Secaucus","Distance":"\u003c= 1"}},{"filtersetId":14,"name":"exit 17","description":"","filters":{"State":"New Jersey","City":"Secaucus","Exit":"17","Distance":"\u003c= 1"}},{"filtersetId":16,"name":"businesses - one review","description":"All businesses having at lease one review.","filters":{"MinNumReviews":"1"}},{"filtersetId":56,"name":"fastfood in californio","description":"california center","filters":{"State":"California,"}}]}
06-30 15:43:21.618: INFO/System.out(231): User selected spineer:Select saved search
06-30 15:43:21.618: INFO/System.out(231): User selected position:0
06-30 15:43:21.626: INFO/System.out(231): User selected getfiltersetId:0
感谢
答案 0 :(得分:0)
我在你的堆栈跟踪中看到的NPE是由一个名为WSResponse的东西引起的。看起来您正在使用第三方库进行WSDL / SOAP通信。我是对的吗?
我的猜测是NPE正上方的错误信息导致问题。根据错误消息,您没有正确格式化我们的“输入字符串”,可能是因为您提供了空值。首先,检查您提供给WSDL / SOAP库的输入字符串是否正确。
如果这没有帮助,请检查此库的API,看看是否有关于可能导致堆栈跟踪中出现“肥皂方法错误”的文档。如果API是开源的,您还可以检查WSResponse类的代码,以查看可能导致NPE的原因。