Soru & Cevap

Android Web Service Sorunu

01.04.2015 - 06:25

Arkadaşlar daha düne kadar çalışan uygulama bugün aniden asynctask ile json veri almam gereken yerlerde uygulama durdu hatası vermeye başladı. Uygulama içinden php dosyasına post ve json parse işlemi olan tüm bölümlerde uygulama durdu hatası alıyorum. Dün sorunsuz bir şekilde çalışıyordu ve kodlarda en ufak bir değişiklik yapmadım. Kendim php dosyası ile bilgisayarımdan denedim sunucudaki dosyalarda sorun yok json çıktıyı veriyor. Logcat çıktısı şu şekilde yardımcı olabilirseniz çok memnun kalırım.

 

[code]04-01 15:20:54.840: I/art(1382): Background partial concurrent mark sweep GC freed 78(16KB) AllocSpace objects, 0(0B) LOS objects, 22% free, 6MB/8MB, paused 11.315ms total 42.575ms
04-01 15:20:55.180: I/Choreographer(1382): Skipped 38 frames!  The application may be doing too much work on its main thread.
04-01 15:20:56.914: I/Choreographer(1382): Skipped 386 frames!  The application may be doing too much work on its main thread.
04-01 15:20:57.170: I/Choreographer(1382): Skipped 63 frames!  The application may be doing too much work on its main thread.
04-01 15:20:57.294: D/gralloc_goldfish(1382): Emulator without GPU emulation detected.
04-01 15:20:57.880: I/Choreographer(1382): Skipped 181 frames!  The application may be doing too much work on its main thread.
04-01 15:21:02.682: I/Choreographer(1382): Skipped 154 frames!  The application may be doing too much work on its main thread.
04-01 15:21:02.859: I/Choreographer(1382): Skipped 42 frames!  The application may be doing too much work on its main thread.
04-01 15:21:06.719: I/Choreographer(1382): Skipped 1001 frames!  The application may be doing too much work on its main thread.
04-01 15:21:08.070: I/Choreographer(1382): Skipped 342 frames!  The application may be doing too much work on its main thread.
04-01 15:21:09.268: I/Choreographer(1382): Skipped 311 frames!  The application may be doing too much work on its main thread.
04-01 15:21:10.247: W/System.err(1382): org.apache.http.NoHttpResponseException: The target server failed to respond
04-01 15:21:10.249: W/System.err(1382):     at org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:85)
04-01 15:21:10.249: W/System.err(1382):     at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:174)
04-01 15:21:10.250: W/System.err(1382):     at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:180)
04-01 15:21:10.250: W/System.err(1382):     at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:235)
04-01 15:21:10.250: W/System.err(1382):     at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:259)
04-01 15:21:10.250: W/System.err(1382):     at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:279)
04-01 15:21:10.250: W/System.err(1382):     at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:121)
04-01 15:21:10.251: W/System.err(1382):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:428)
04-01 15:21:10.251: W/System.err(1382):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
04-01 15:21:10.251: W/System.err(1382):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
04-01 15:21:10.251: W/System.err(1382):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
04-01 15:21:10.251: W/System.err(1382):     at com.duphin.bil_al.PostClass.httpPost(PostClass.java:51)
04-01 15:21:10.252: W/System.err(1382):     at com.duphin.bil_al.EnbasarililarActivity$Post.doInBackground(EnbasarililarActivity.java:139)
04-01 15:21:10.252: W/System.err(1382):     at com.duphin.bil_al.EnbasarililarActivity$Post.doInBackground(EnbasarililarActivity.java:1)
04-01 15:21:10.252: W/System.err(1382):     at android.os.AsyncTask$2.call(AsyncTask.java:288)
04-01 15:21:10.252: W/System.err(1382):     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
04-01 15:21:10.252: W/System.err(1382):     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
04-01 15:21:10.252: W/System.err(1382):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
04-01 15:21:10.284: W/System.err(1382):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
04-01 15:21:10.286: W/System.err(1382):     at java.lang.Thread.run(Thread.java:818)
04-01 15:21:10.287: E/Buffer Error(1382): Hata java.lang.NullPointerException: lock == null
04-01 15:21:10.340: E/AndroidRuntime(1382): FATAL EXCEPTION: AsyncTask #1
04-01 15:21:10.340: E/AndroidRuntime(1382): Process: com.duphin.bil_al, PID: 1382
04-01 15:21:10.340: E/AndroidRuntime(1382): java.lang.RuntimeException: An error occured while executing doInBackground()
04-01 15:21:10.340: E/AndroidRuntime(1382):     at android.os.AsyncTask$3.done(AsyncTask.java:300)
04-01 15:21:10.340: E/AndroidRuntime(1382):     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
04-01 15:21:10.340: E/AndroidRuntime(1382):     at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
04-01 15:21:10.340: E/AndroidRuntime(1382):     at java.util.concurrent.FutureTask.run(FutureTask.java:242)
04-01 15:21:10.340: E/AndroidRuntime(1382):     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
04-01 15:21:10.340: E/AndroidRuntime(1382):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
04-01 15:21:10.340: E/AndroidRuntime(1382):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
04-01 15:21:10.340: E/AndroidRuntime(1382):     at java.lang.Thread.run(Thread.java:818)
04-01 15:21:10.340: E/AndroidRuntime(1382): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
04-01 15:21:10.340: E/AndroidRuntime(1382):     at org.json.JSONTokener.nextCleanInternal(JSONTokener.java:116)
04-01 15:21:10.340: E/AndroidRuntime(1382):     at org.json.JSONTokener.nextValue(JSONTokener.java:94)
04-01 15:21:10.340: E/AndroidRuntime(1382):     at org.json.JSONObject.<init>(JSONObject.java:156)
04-01 15:21:10.340: E/AndroidRuntime(1382):     at org.json.JSONObject.<init>(JSONObject.java:173)
04-01 15:21:10.340: E/AndroidRuntime(1382):     at com.duphin.bil_al.EnbasarililarActivity$Post.doInBackground(EnbasarililarActivity.java:141)
04-01 15:21:10.340: E/AndroidRuntime(1382):     at com.duphin.bil_al.EnbasarililarActivity$Post.doInBackground(EnbasarililarActivity.java:1)
04-01 15:21:10.340: E/AndroidRuntime(1382):     at android.os.AsyncTask$2.call(AsyncTask.java:288)
04-01 15:21:10.340: E/AndroidRuntime(1382):     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
04-01 15:21:10.340: E/AndroidRuntime(1382):     ... 4 more
04-01 15:21:10.755: I/Choreographer(1382): Skipped 68 frames!  The application may be doing too much work on its main thread.
04-01 15:21:11.051: I/Choreographer(1382): Skipped 73 frames!  The application may be doing too much work on its main thread.
04-01 15:21:11.416: I/Choreographer(1382): Skipped 93 frames!  The application may be doing too much work on its main thread.
04-01 15:21:11.857: I/Choreographer(1382): Skipped 112 frames!  The application may be doing too much work on its main thread.
04-01 15:21:12.329: I/Choreographer(1382): Skipped 121 frames!  The application may be doing too much work on its main thread.
04-01 15:21:12.676: I/Choreographer(1382): Skipped 85 frames!  The application may be doing too much work on its main thread.
04-01 15:21:13.420: I/Choreographer(1382): Skipped 160 frames!  The application may be doing too much work on its main thread.
04-01 15:21:13.595: I/Choreographer(1382): Skipped 44 frames!  The application may be doing too much work on its main thread.
04-01 15:21:13.695: E/WindowManager(1382): android.view.WindowLeaked: Activity com.duphin.bil_al.EnbasarililarActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{604cd9c V.E..... R.....ID 0,0-456,242} that was originally added here
04-01 15:21:13.695: E/WindowManager(1382):     at android.view.ViewRootImpl.<init>(ViewRootImpl.java:363)
04-01 15:21:13.695: E/WindowManager(1382):     at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:261)
04-01 15:21:13.695: E/WindowManager(1382):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
04-01 15:21:13.695: E/WindowManager(1382):     at android.app.Dialog.show(Dialog.java:298)
04-01 15:21:13.695: E/WindowManager(1382):     at com.duphin.bil_al.EnbasarililarActivity$Post.onPreExecute(EnbasarililarActivity.java:133)
04-01 15:21:13.695: E/WindowManager(1382):     at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:587)
04-01 15:21:13.695: E/WindowManager(1382):     at android.os.AsyncTask.execute(AsyncTask.java:535)
04-01 15:21:13.695: E/WindowManager(1382):     at com.duphin.bil_al.EnbasarililarActivity.onStart(EnbasarililarActivity.java:170)
04-01 15:21:13.695: E/WindowManager(1382):     at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1220)
04-01 15:21:13.695: E/WindowManager(1382):     at android.app.Activity.performStart(Activity.java:5949)
04-01 15:21:13.695: E/WindowManager(1382):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2261)
04-01 15:21:13.695: E/WindowManager(1382):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
04-01 15:21:13.695: E/WindowManager(1382):     at android.app.ActivityThread.access$800(ActivityThread.java:144)
04-01 15:21:13.695: E/WindowManager(1382):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
04-01 15:21:13.695: E/WindowManager(1382):     at android.os.Handler.dispatchMessage(Handler.java:102)
04-01 15:21:13.695: E/WindowManager(1382):     at android.os.Looper.loop(Looper.java:135)
04-01 15:21:13.695: E/WindowManager(1382):     at android.app.ActivityThread.main(ActivityThread.java:5221)
04-01 15:21:13.695: E/WindowManager(1382):     at java.lang.reflect.Method.invoke(Native Method)
04-01 15:21:13.695: E/WindowManager(1382):     at java.lang.reflect.Method.invoke(Method.java:372)
04-01 15:21:13.695: E/WindowManager(1382):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
04-01 15:21:13.695: E/WindowManager(1382):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

[/code]

92 Görüntülenme

3 Cevap

Sitedeki sorulara cevap verebilmek için giriş yapın ya da üye olun.

picture-9199-1385383898.jpg
semih92yilmaz
02.04.2015 - 06:45

new Thread(new Runnable() {

                    @Override
                    public void run() {

 

}}.start();

Bu yap içerisinde çalıştır Http işlemlerini 

picture-20496-1400501549.jpg
emr3karatas
02.04.2015 - 10:06

Başka bi telefonda dener misin? Hata almazsan eğer telefonunun hafızasıyla alakalı veya uygulamanda telefonun dosyalarını kullanan bir yapısı varsa onlardan olabilir.

picture-14630-1392671719.jpg
gulsahgul
02.04.2015 - 10:01

HttpUrlConnection kurduğun ve Json serialization-deserialization yaptığın yerlerde try-catch bloğu ile olası exception'ları handle etmeni ve de Json objenin null dönüp dönmediği kontrolünü yapmanı tavsiye ederim.