-1

I'm making this app that has an activity that enables user to log in, the program check´s the information against a database and then sends the user to the dashboard screen. It has been working perfectly but now I'm getting some strange errors that i can't make out where they're coming from.

Here's the logcat:

01-18 14:54:22.160: E/AndroidRuntime(2621): FATAL EXCEPTION: AsyncTask #5
01-18 14:54:22.160: E/AndroidRuntime(2621): java.lang.RuntimeException: An error occured while executing doInBackground()
01-18 14:54:22.160: E/AndroidRuntime(2621):     at android.os.AsyncTask$3.done(AsyncTask.java:299)
01-18 14:54:22.160: E/AndroidRuntime(2621):     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
01-18 14:54:22.160: E/AndroidRuntime(2621):     at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
01-18 14:54:22.160: E/AndroidRuntime(2621):     at java.util.concurrent.FutureTask.run(FutureTask.java:239)
01-18 14:54:22.160: E/AndroidRuntime(2621):     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
01-18 14:54:22.160: E/AndroidRuntime(2621):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
01-18 14:54:22.160: E/AndroidRuntime(2621):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
01-18 14:54:22.160: E/AndroidRuntime(2621):     at java.lang.Thread.run(Thread.java:856)
01-18 14:54:22.160: E/AndroidRuntime(2621): Caused by: java.lang.IllegalStateException: Target host must not be null, or set in parameters. scheme=null, host=null, path=192.168.0.2/android_login/
01-18 14:54:22.160: E/AndroidRuntime(2621):     at org.apache.http.impl.client.DefaultRequestDirector.determineRoute(DefaultRequestDirector.java:591)
01-18 14:54:22.160: E/AndroidRuntime(2621):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:293)
01-18 14:54:22.160: E/AndroidRuntime(2621):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
01-18 14:54:22.160: E/AndroidRuntime(2621):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
01-18 14:54:22.160: E/AndroidRuntime(2621):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
01-18 14:54:22.160: E/AndroidRuntime(2621):     at com.example.androidbasic12.library.JSONParser.getJSONFromUrl(JSONParser.java:42)
01-18 14:54:22.160: E/AndroidRuntime(2621):     at com.example.androidbasic12.library.UserFunctions.loginUser(UserFunctions.java:40)
01-18 14:54:22.160: E/AndroidRuntime(2621):     at com.example.androidbasic12.MainActivity$LoginTask.doInBackground(MainActivity.java:78)
01-18 14:54:22.160: E/AndroidRuntime(2621):     at com.example.androidbasic12.MainActivity$LoginTask.doInBackground(MainActivity.java:1)
01-18 14:54:22.160: E/AndroidRuntime(2621):     at android.os.AsyncTask$2.call(AsyncTask.java:287)
01-18 14:54:22.160: E/AndroidRuntime(2621):     at java.util.concurrent.FutureTask.run(FutureTask.java:234)
01-18 14:54:22.160: E/AndroidRuntime(2621):     ... 4 more

Anyone that can se what the problem is here?

John Woo
  • 258,903
  • 69
  • 498
  • 492
Erik Soderstrom
  • 313
  • 5
  • 19

2 Answers2

0

I think you can not have a URL with underscore, try removing it. See the accepted answer to this post: Target host must not be null, or set in parameters

Community
  • 1
  • 1
Yoggi
  • 572
  • 4
  • 11
  • Changed the name of folder of my api files to "androidlogin" and updated it in my android code, but I'm getting the same error. – Erik Soderstrom Jan 18 '13 at 15:06
0

as in log :

IllegalStateException: Target host must not be null, or set in parameters

means you have not added a protocol(http or https) to the URL. try after to change URL as :

String yoururl="http://xxx.xxx.x.x";
ρяσѕρєя K
  • 132,198
  • 53
  • 198
  • 213