IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Android Discussion :

WA java.net.SocketTimeoutException: SSL handshake timed out


Sujet :

Android

  1. #1
    Membre éclairé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2010
    Messages
    391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Mauritanie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2010
    Messages : 391
    Par défaut WA java.net.SocketTimeoutException: SSL handshake timed out
    bonjour , j essaie de me connecter a serveur distant avec des requtes https via un certficat auto signé . mais je reçois une erreur dont j arrive pas à connaitre la source si quelqu'un en a deja rencontré merci

    voici les trace


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
     
    06-20 11:28:27.258: WARN/ActivityManager(58): Launch timeout has expired, giving up wake lock!
    06-20 11:28:27.607: WARN/ActivityManager(58): Activity idle timeout for HistoryRecord{4507de98 com.connexion/.Connexion}
    06-20 11:35:58.661: WARN/ActivityManager(58): Launch timeout has expired, giving up wake lock!
    06-20 11:35:59.489: WARN/ActivityManager(58): Activity idle timeout for HistoryRecord{4507a1f0 com.connexion/.Connexion}
    06-20 11:36:27.491: WARN/System.err(739): java.net.SocketTimeoutException: SSL handshake timed out
    06-20 11:36:27.500: WARN/System.err(739):     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.nativeconnect(Native Method)
    06-20 11:36:27.500: WARN/System.err(739):     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:316)
    06-20 11:36:27.526: WARN/System.err(739):     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.<init>(OpenSSLSocketImpl.java:520)
    06-20 11:36:27.526: WARN/System.err(739):     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.java:461)
    06-20 11:36:27.531: WARN/System.err(739):     at org.apache.http.impl.io.SocketInputBuffer.<init>(SocketInputBuffer.java:93)
    06-20 11:36:27.531: WARN/System.err(739):     at org.apache.http.impl.SocketHttpClientConnection.createSessionInputBuffer(SocketHttpClientConnection.java:83)
    06-20 11:36:27.531: WARN/System.err(739):     at org.apache.http.impl.conn.DefaultClientConnection.createSessionInputBuffer(DefaultClientConnection.java:170)
    06-20 11:36:27.531: WARN/System.err(739):     at org.apache.http.impl.SocketHttpClientConnection.bind(SocketHttpClientConnection.java:106)
    06-20 11:36:27.531: WARN/System.err(739):     at org.apache.http.impl.conn.DefaultClientConnection.openCompleted(DefaultClientConnection.java:129)
    06-20 11:36:27.531: WARN/System.err(739):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:171)
    06-20 11:36:27.551: WARN/System.err(739):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
    06-20 11:36:27.551: WARN/System.err(739):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
    06-20 11:36:27.551: WARN/System.err(739):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)
    06-20 11:36:27.551: WARN/System.err(739):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
    06-20 11:36:27.551: WARN/System.err(739):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
    06-20 11:36:27.551: WARN/System.err(739):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
    06-20 11:36:27.551: WARN/System.err(739):     at com.connexion.Connexion.onCreate(Connexion.java:101)
    06-20 11:36:27.551: WARN/System.err(739):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    06-20 11:36:27.551: WARN/System.err(739):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
    06-20 11:36:27.551: WARN/System.err(739):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
    06-20 11:36:27.551: WARN/System.err(739):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
    06-20 11:36:27.551: WARN/System.err(739):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
    06-20 11:36:27.551: WARN/System.err(739):     at android.os.Handler.dispatchMessage(Handler.java:99)
    06-20 11:36:27.570: WARN/System.err(739):     at android.os.Looper.loop(Looper.java:123)
    06-20 11:36:27.570: WARN/System.err(739):     at android.app.ActivityThread.main(ActivityThread.java:4627)
    06-20 11:36:27.570: WARN/System.err(739):     at java.lang.reflect.Method.invokeNative(Native Method)
    06-20 11:36:27.570: WARN/System.err(739):     at java.lang.reflect.Method.invoke(Method.java:521)
    06-20 11:36:27.570: WARN/System.err(739):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
    06-20 11:36:27.570: WARN/System.err(739):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
    06-20 11:36:27.570: WARN/System.err(739):     at dalvik.system.NativeStart.main(Native Method)
    06-20 11:36:27.640: WARN/dalvikvm(739): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
    06-20 11:36:27.662: ERROR/AndroidRuntime(739): FATAL EXCEPTION: main
    06-20 11:36:27.662: ERROR/AndroidRuntime(739): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.connexion/com.connexion.Connexion}: java.lang.NullPointerException
    06-20 11:36:27.662: ERROR/AndroidRuntime(739):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
    06-20 11:36:27.662: ERROR/AndroidRuntime(739):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
    06-20 11:36:27.662: ERROR/AndroidRuntime(739):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
    06-20 11:36:27.662: ERROR/AndroidRuntime(739):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
    06-20 11:36:27.662: ERROR/AndroidRuntime(739):     at android.os.Handler.dispatchMessage(Handler.java:99)
    06-20 11:36:27.662: ERROR/AndroidRuntime(739):     at android.os.Looper.loop(Looper.java:123)
    06-20 11:36:27.662: ERROR/AndroidRuntime(739):     at android.app.ActivityThread.main(ActivityThread.java:4627)
    06-20 11:36:27.662: ERROR/AndroidRuntime(739):     at java.lang.reflect.Method.invokeNative(Native Method)
    06-20 11:36:27.662: ERROR/AndroidRuntime(739):     at java.lang.reflect.Method.invoke(Method.java:521)
    06-20 11:36:27.662: ERROR/AndroidRuntime(739):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
    06-20 11:36:27.662: ERROR/AndroidRuntime(739):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
    06-20 11:36:27.662: ERROR/AndroidRuntime(739):     at dalvik.system.NativeStart.main(Native Method)
    06-20 11:36:27.662: ERROR/AndroidRuntime(739): Caused by: java.lang.NullPointerException
    06-20 11:36:27.662: ERROR/AndroidRuntime(739):     at com.connexion.Connexion.onCreate(Connexion.java:109)
    06-20 11:36:27.662: ERROR/AndroidRuntime(739):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    06-20 11:36:27.662: ERROR/AndroidRuntime(739):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
    06-20 11:36:27.662: ERROR/AndroidRuntime(739):     ... 11 more
    06-20 11:36:27.680: WARN/ActivityManager(58):   Force finishing activity com.connexion/.Connexion
    06-20 11:36:28.397: WARN/ActivityManager(58): Activity pause timeout for HistoryRecord{4507a1f0 com.connexion/.Connexion}
    06-20 11:36:38.987: WARN/ActivityManager(58): Activity destroy timeout for HistoryRecord{4507a1f0 com.connexion/.Connexion}
    merci d avance

  2. #2
    Expert confirmé

    Avatar de Feanorin
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    4 589
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 4 589
    Par défaut
    Bonjour,

    Pourrais - ton voir comment est créer la socket ainsi que sa connexion .
    Car de ce que l'on voit dans les logs tu as un time out sur ta connexion ( donc il y a surement un problème sur celle ci ) ainsi qu'après tu as un null pointeur surement dû à ta non connexion précédente .

    Merci .

  3. #3
    Membre chevronné
    Profil pro
    Inscrit en
    Mars 2011
    Messages
    322
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2011
    Messages : 322
    Par défaut
    Bonjour,
    Tu dois avoir un élément non initialisé à la ligne 109 de ton fichier Connexion.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    06-20 11:36:27.662: ERROR/AndroidRuntime(739): Caused by: java.lang.NullPointerException
    06-20 11:36:27.662: ERROR/AndroidRuntime(739):     at com.connexion.Connexion.onCreate(Connexion.java:109)

  4. #4
    Membre éclairé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2010
    Messages
    391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Mauritanie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2010
    Messages : 391
    Par défaut
    merci de votre reponse , pour le nullpoint c est à cause de l echec de la connexion

    voici ma classe :


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
     
     
     
    public class Connexion extends Activity {
    	private static final int CONNECTION_TIMEOUT =36000;
    	private static final int WAIT_RESPONSE_TIMEOUT =36000;
    	/** Called when the activity is first created. */
     
    	  String  url="https://10.214.123.132/webapp/wcs/stores/servlet/TrackOrderStatus?storeId=10101&catalogId=10101&langId=-2";
     
    		private  ClientConnectionManager  clienConnectionManager ;
    		private   HttpContext  context;
    		private   HttpParams  params;
     
     
    	  @Override
    	public void onCreate(Bundle savedInstanceState) {
    		super.onCreate(savedInstanceState);
    		setContentView(R.layout.main);
     
     
    		 SchemeRegistry  registre= new SchemeRegistry();
    		   registre.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 8002));
    		   registre.register(new Scheme("https", new EasySSLSocketFactory(), 443));
    		   params = new BasicHttpParams();
     
    		   HttpConnectionParams.setConnectionTimeout( params, CONNECTION_TIMEOUT); 
    		   HttpConnectionParams.setSoTimeout( params, WAIT_RESPONSE_TIMEOUT);
    		   HttpConnectionParams.setTcpNoDelay( params, true);
     
    		   params.setParameter(ConnManagerPNames.MAX_TOTAL_CONNECTIONS,1);
    		   params.setParameter(ConnManagerPNames.MAX_CONNECTIONS_PER_ROUTE, new  ConnPerRouteBean(1));
    		   params.setParameter(HttpProtocolParams.USE_EXPECT_CONTINUE, false);
    		   HttpProtocolParams.setVersion(params,HttpVersion.HTTP_1_1 );
    		   HttpProtocolParams.setContentCharset(params,"utf8");
    		   CredentialsProvider  credentialsProvider  = new BasicCredentialsProvider();
     
    		   credentialsProvider.setCredentials( new AuthScope ("localhost:443",AuthScope.ANY_PORT),
    				     new  UsernamePasswordCredentials("19851985", "passw85"));
    		   clienConnectionManager = new ThreadSafeClientConnManager(params,registre);
    		   context  = new BasicHttpContext();
    		   context.setAttribute("http.auth.credentials-fournisseur", credentialsProvider);
     
     
     
    		   HttpClient client = new  DefaultHttpClient(clienConnectionManager, params);
     
    		HttpGet get = new HttpGet(url);
    		get.addHeader("User-Agent", "Android");
    		HttpResponse httpresponse = null;
    		try {
    			httpresponse = client.execute(get);
    		} catch (ClientProtocolException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		} catch (IOException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}
    		HttpEntity entity = httpresponse.getEntity();
    		InputStream chaine = null;
    		try {
    			chaine = entity.getContent();
    		} catch (IllegalStateException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		} catch (IOException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}
          String result = null;
    	try {
    		result = stream2String(chaine);
    	} catch (UnsupportedEncodingException e2) {
    		// TODO Auto-generated catch block
    		e2.printStackTrace();
    	}
     
        JSONArray jsonOrdArray = null;
    	try {
    		jsonOrdArray = new JSONArray(result);
    	} catch (JSONException e1) {
    		// TODO Auto-generated catch block
    		e1.printStackTrace();
    	}
     
     
        for (int i = 0; i < jsonOrdArray.length(); i++) {
    		Order order = new Order();
     
    		JSONObject commande = null;
     
    			try {
    				commande = jsonOrdArray.getJSONObject(i);
    			} catch (JSONException e) {
    				// TODO Auto-generated catch block
    				e.printStackTrace();
    			}
     
     
    			try {
    				order.reference = commande.getString("reference");
    			} catch (JSONException e) {
    				// TODO Auto-generated catch block
    				e.printStackTrace();
    			}
     
    	}
     
    	}
     
    	private String stream2String(InputStream stream)
    			throws UnsupportedEncodingException {
    		String charSet = "iso-8859-1";
    		InputStreamReader reader = new InputStreamReader(stream, charSet);
     
    		BufferedReader buffer = new BufferedReader(reader);
    		StringBuilder sb = new StringBuilder();
    		try {
    			String cur;
    			while ((cur = buffer.readLine()) != null) {
    				sb.append(cur);
    			}
    		} catch (IOException e) {
    			e.printStackTrace();
    		}
    		try {
    			stream.close();
    		} catch (IOException e) {
    			e.printStackTrace();
    		}
    		return sb.toString();
    	}
     
    }
    merci d avance

  5. #5
    Expert confirmé

    Avatar de Feanorin
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    4 589
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 4 589
    Par défaut
    Re,

    Essayes de mieux gérer tes exceptions à l'avenir elles sont la pour ça....

    Je vois que tu as enlevé les TCPNODELAY ? est ce voulue ? cela t'enlève une sûreté en plus ..
    Determines whether Nagle's algorithm is to be used. The Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. When applications wish to decrease network latency and increase performance, they can disable Nagle's algorithm (that is enable TCP_NODELAY). Data will be sent earlier, at the cost of an increase in bandwidth consumption.
    Ensuite quelques question :

    Est ce que ton serveur tourne ? L'as tu testé ?

    car un time out veut dire souvent que soit tu n'as pas accès au net , soit tu n'accèdes pas au serveur .

  6. #6
    Membre éclairé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2010
    Messages
    391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Mauritanie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2010
    Messages : 391
    Par défaut
    merci bien , ce qui de mon serveur ça tourne bien j arrive a y acceder a partir des requêtes http.

    j ai changer dans mon url
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
      String  url="https://10.214.123.132/webapp/wcs/stores/servlet/TrackOrderStatus?storeId=10101&catalogId=10101&langId=-2";
    par
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
      String  url="https://10.0.2.2/webapp/wcs/stores/servlet/TrackOrderStatus?storeId=10101&catalogId=10101&langId=-2";
    et la j ai une autre erreur di a l echec de l autentification vous avez une idée ?
    voici la trace

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
     
    06-20 12:41:47.450: WARN/System.err(865): org.json.JSONException: Value null at 0 of type org.json.JSONObject$1 cannot be converted to JSONObject
    06-20 12:41:47.450: WARN/System.err(865):     at org.json.JSON.typeMismatch(JSON.java:96)
    06-20 12:41:47.461: WARN/System.err(865):     at org.json.JSONArray.getJSONObject(JSONArray.java:484)
    06-20 12:41:47.471: WARN/System.err(865):     at com.connexion.Connexion.onCreate(Connexion.java:143)
    06-20 12:41:47.471: WARN/System.err(865):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    06-20 12:41:47.480: WARN/System.err(865):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
    06-20 12:41:47.480: WARN/System.err(865):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
    06-20 12:41:47.491: WARN/System.err(865):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
    06-20 12:41:47.491: WARN/System.err(865):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
    06-20 12:41:47.500: WARN/System.err(865):     at android.os.Handler.dispatchMessage(Handler.java:99)
    06-20 12:41:47.500: WARN/System.err(865):     at android.os.Looper.loop(Looper.java:123)
    06-20 12:41:47.500: WARN/System.err(865):     at android.app.ActivityThread.main(ActivityThread.java:4627)
    06-20 12:41:47.510: WARN/System.err(865):     at java.lang.reflect.Method.invokeNative(Native Method)
    06-20 12:41:47.510: WARN/System.err(865):     at java.lang.reflect.Method.invoke(Method.java:521)
    06-20 12:41:47.522: WARN/System.err(865):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
    06-20 12:41:47.522: WARN/System.err(865):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
    06-20 12:41:47.531: WARN/System.err(865):     at dalvik.system.NativeStart.main(Native Method)
    06-20 12:41:47.540: WARN/dalvikvm(865): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
    06-20 12:41:47.570: ERROR/AndroidRuntime(865): FATAL EXCEPTION: main
    06-20 12:41:47.570: ERROR/AndroidRuntime(865): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.connexion/com.connexion.Connexion}: java.lang.NullPointerException
    06-20 12:41:47.570: ERROR/AndroidRuntime(865):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
    06-20 12:41:47.570: ERROR/AndroidRuntime(865):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
    06-20 12:41:47.570: ERROR/AndroidRuntime(865):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
    06-20 12:41:47.570: ERROR/AndroidRuntime(865):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
    06-20 12:41:47.570: ERROR/AndroidRuntime(865):     at android.os.Handler.dispatchMessage(Handler.java:99)
    06-20 12:41:47.570: ERROR/AndroidRuntime(865):     at android.os.Looper.loop(Looper.java:123)
    06-20 12:41:47.570: ERROR/AndroidRuntime(865):     at android.app.ActivityThread.main(ActivityThread.java:4627)
    06-20 12:41:47.570: ERROR/AndroidRuntime(865):     at java.lang.reflect.Method.invokeNative(Native Method)
    06-20 12:41:47.570: ERROR/AndroidRuntime(865):     at java.lang.reflect.Method.invoke(Method.java:521)
    06-20 12:41:47.570: ERROR/AndroidRuntime(865):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
    06-20 12:41:47.570: ERROR/AndroidRuntime(865):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
    06-20 12:41:47.570: ERROR/AndroidRuntime(865):     at dalvik.system.NativeStart.main(Native Method)
    06-20 12:41:47.570: ERROR/AndroidRuntime(865): Caused by: java.lang.NullPointerException
    06-20 12:41:47.570: ERROR/AndroidRuntime(865):     at com.connexion.Connexion.onCreate(Connexion.java:151)
    06-20 12:41:47.570: ERROR/AndroidRuntime(865):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    06-20 12:41:47.570: ERROR/AndroidRuntime(865):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
    06-20 12:41:47.570: ERROR/AndroidRuntime(865):     ... 11 more
    06-20 12:41:47.592: WARN/ActivityManager(58):   Force finishing activity com.connexion/.Connexion
    06-20 12:41:48.101: WARN/ActivityManager(58): Activity pause timeout for HistoryRecord{45084900 com.connexion/.Connexion}
    06-20 12:41:58.443: WARN/ActivityManager(58): Activity destroy timeout for HistoryRecord{45084900 com.connexion/.Connexion}
    mercu d avance

  7. #7
    Membre éclairé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2010
    Messages
    391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Mauritanie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2010
    Messages : 391
    Par défaut
    bonsoir , quelqu un pourrait m aider sur ce truc d authentification
    je veux utiliser ce genre d authentification:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     
      CredentialsProvider  credentialsProvider  = new BasicCredentialsProvider();
     
    		   credentialsProvider.setCredentials( new AuthScope (HOST,PORT),
    				     new  UsernamePasswordCredentials(username, password));
    j ai deux urls :
    url1 : qui contient les informations que je veux recuperer
    url2 : c est la page de login

    ce que je ne comprend c au niveau AuthScope (HOST,PORT)
    si je doit mettre url de le login a la place host ou l url que je veux recuperer ?
    je n arrive vraiment pas a comprendre si quelqu un peu m eclaircir .
    merci d avance

  8. #8
    Membre éclairé
    Profil pro
    Inscrit en
    Mars 2007
    Messages
    542
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2007
    Messages : 542
    Par défaut
    qu'est ce qu'il y a à la ligne 143 et 151 ??

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    12:41:47.570: ERROR/AndroidRuntime(865):     at com.connexion.Connexion.onCreate(Connexion.java:151)

  9. #9
    Membre éclairé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2010
    Messages
    391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Mauritanie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2010
    Messages : 391
    Par défaut
    Merci pour ta réponse la ligne est la suivante :
    order.reference = commande.getString("reference");
    Au fait c'est un nullpoint dû à l'échec de l authentification . Car il va retourner un tableau vide qui est la cause de l'exception.
    Mon souci se trouve au niveau de l'authentification pourquoi il y a l échec de l 'authentification ?
    Je ne sais pas si j'ai mal codé ou non ? Votre aide s'il vous plaît et merci d'avance.

  10. #10
    Membre éclairé
    Profil pro
    Inscrit en
    Mars 2007
    Messages
    542
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2007
    Messages : 542
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    credentialsProvider.setCredentials( new AuthScope ("localhost:443",AuthScope.ANY_PORT),
    				     new  UsernamePasswordCredentials("19851985", "passw85"));
    d'après ce que je constate vous vous connecter sur l'hote localhost:443 ; ne serais ce pas le port 443?

  11. #11
    Membre éclairé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2010
    Messages
    391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Mauritanie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2010
    Messages : 391
    Par défaut
    merci bien de ta reponse au faite j ai changer maintenant je me connecte avecle host localhost et le port 443 mais rien ne marche apres j ai changer le host par 10.0.2.5 sans succes j ai pas vraiment compris le principe de cette authentification est ce que je fais est correct? sinon que dois je faire ?
    merci d avance

  12. #12
    Membre éclairé
    Profil pro
    Inscrit en
    Mars 2007
    Messages
    542
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2007
    Messages : 542
    Par défaut
    Ton serveur tourne ici:

    Pourquoi veut tu faire de l'authentification avec l'hote localhost ?

  13. #13
    Membre éclairé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2010
    Messages
    391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Mauritanie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2010
    Messages : 391
    Par défaut
    au fait j utilise cette url
    url="https://10.0.2.2/webapp/wcs/stores/servlet/TrackOrderStatus?storeId=10101&catalogId=10101&langId=-2";
    pour acceder a mon serveur donc ça 10.0.2.2 pour android et locahost pour le serveur

  14. #14
    Membre éclairé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2010
    Messages
    391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Mauritanie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2010
    Messages : 391
    Par défaut
    bonsoir , quelqu’un un peut m aidait en me donnant des explications sur le mode de fonctionnant de l 'authentification via CredentialsProvider ou même une manière de s’authentifier (android serveur distant ) , des explications avec des exemples , je galère avec ce truc . merci d avance

Discussions similaires

  1. Réponses: 2
    Dernier message: 04/04/2013, 10h04
  2. Réponses: 0
    Dernier message: 29/01/2013, 16h48
  3. Réponses: 1
    Dernier message: 26/07/2010, 16h38
  4. java.net.SocketTimeoutException: Read timed out
    Par riadhhwajdii dans le forum Tomcat et TomEE
    Réponses: 3
    Dernier message: 22/12/2009, 14h15
  5. [API java.net] gestion du time out et de nombre de conn max
    Par java_fun dans le forum Entrée/Sortie
    Réponses: 1
    Dernier message: 02/11/2006, 23h06

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo