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

Services Web Java Discussion :

Unknown Host Exception


Sujet :

Services Web Java

  1. #1
    Membre éclairé Avatar de rockley
    Homme Profil pro
    Inscrit en
    Décembre 2010
    Messages
    404
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Décembre 2010
    Messages : 404
    Par défaut Unknown Host Exception
    Bonjour

    Je dois développer un client web service en java.

    J'arrive à tout faire marcher sur netbeans (JDK1.6).
    Sur eclipse, en créant un Web service en local, et en créant le client, ça marche. Mais dès que je tente d'accéder à un serveur externe, ça marche plus.

    Pour tester j'ai pris un web service gratuit (dans le fichier joint)
    Et j'ai également mis les logs. (J'utilise eclipse 3.4.2 et J2sdk 1.4)

    A défaut de me donner la solution, pouvez vous me dire d'où peut venir l'erreur.
    Réglage eclipse, tomcat, proxy d'éclipse, proxy du client généré, ...

    Merci d'avance pour votre aide
    Fichiers attachés Fichiers attachés

  2. #2
    Membre éclairé Avatar de rockley
    Homme Profil pro
    Inscrit en
    Décembre 2010
    Messages
    404
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Décembre 2010
    Messages : 404
    Par défaut
    Bon en ajoutant ça dans le code, je n'ai plus l'erreur du host :


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    System.setProperty("http.proxySet", "true");
    System.setProperty("http.proxyHost", "xxxxxxxx");
    System.setProperty("http.proxyPort", "8888");
    System.setProperty("http.nonProxyHosts","xxxxxxx");
    // si passe world
    System.setProperty("http.proxyUser", "");
    System.setProperty("http.proxyPassword", "");
    // si besoin d'un certificat
    System.setProperty("javax.net.ssl.trustStore", "chemin vers le fichier .keystore" );
    System.setProperty("javax.net.ssl.trustStorePassword", "mot de passe défini lors de la création du .keystore" );
    Mais là j'ai une nouvelle erreur

    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
    AxisFault
     faultCode: {http://xml.apache.org/axis/}HTTP
     faultSubcode: 
     faultString: (407)Proxy Authentication Required
     faultActor: 
     faultNode: 
     faultDetail: 
    	{}:return code:  407
    Access denied
    	{http://xml.apache.org/axis/}HttpErrorCode:407
     
    (407)Proxy Authentication Required
    	at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)
    	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
    	at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    	at org.apache.axis.client.Call.invoke(Call.java:2767)
    	at org.apache.axis.client.Call.invoke(Call.java:2443)
    	at org.apache.axis.client.Call.invoke(Call.java:2366)
    	at org.apache.axis.client.Call.invoke(Call.java:1812)
    	at com.microsoft.webservices.PrimeNumbersSoapStub.getPrimeNumbers(PrimeNumbersSoapStub.java:106)
    	at com.microsoft.webservices.PrimeNumbersSoapProxy.getPrimeNumbers(PrimeNumbersSoapProxy.java:52)
    	at org.lol.main(lol.java:13)
    Exception in thread "main"

  3. #3
    Membre éclairé Avatar de rockley
    Homme Profil pro
    Inscrit en
    Décembre 2010
    Messages
    404
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Décembre 2010
    Messages : 404
    Par défaut
    Je remet l'erreur de début pour les recherches.


    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
    Exception in thread "main" AxisFault
     faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
     faultSubcode: 
     faultString: java.net.UnknownHostException: www50.brinkster.com
     faultActor: 
     faultNode: 
     faultDetail: 
    	{http://xml.apache.org/axis/}stackTrace:java.net.UnknownHostException: www50.brinkster.com
    	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
    	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364)
    	at java.net.Socket.connect(Socket.java:507)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:585)
    	at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:153)
    	at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:120)
    	at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
    	at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
    	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
    	at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    	at org.apache.axis.client.Call.invoke(Call.java:2767)
    	at org.apache.axis.client.Call.invoke(Call.java:2443)
    	at org.apache.axis.client.Call.invoke(Call.java:2366)
    	at org.apache.axis.client.Call.invoke(Call.java:1812)
    	at com.microsoft.webservices.PrimeNumbersSoapStub.getPrimeNumbers(PrimeNumbersSoapStub.java:106)
    	at com.microsoft.webservices.PrimeNumbersSoapProxy.getPrimeNumbers(PrimeNumbersSoapProxy.java:50)
    	at a.main(a.java:7)
     
    	{http://xml.apache.org/axis/}hostname:XXXXXXXXX
     
    java.net.UnknownHostException: www50.brinkster.com
    	at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
    	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
    	at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    	at org.apache.axis.client.Call.invoke(Call.java:2767)
    	at org.apache.axis.client.Call.invoke(Call.java:2443)
    	at org.apache.axis.client.Call.invoke(Call.java:2366)
    	at org.apache.axis.client.Call.invoke(Call.java:1812)
    	at com.microsoft.webservices.PrimeNumbersSoapStub.getPrimeNumbers(PrimeNumbersSoapStub.java:106)
    	at com.microsoft.webservices.PrimeNumbersSoapProxy.getPrimeNumbers(PrimeNumbersSoapProxy.java:50)
    	at a.main(a.java:7)
    Caused by: java.net.UnknownHostException: www50.brinkster.com
    	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
    	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364)
    	at java.net.Socket.connect(Socket.java:507)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:585)
    	at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:153)
    	at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:120)
    	at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
    	at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
    	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
    	... 12 more

  4. #4
    Membre éclairé Avatar de rockley
    Homme Profil pro
    Inscrit en
    Décembre 2010
    Messages
    404
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Décembre 2010
    Messages : 404
    Par défaut
    Donc si on à
    UnknownHostException : www.xxx.com
    comme erreur, on met
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    System.setProperty("http.proxySet", "true");
    System.setProperty("http.proxyHost", "xxxxxxxx");
    System.setProperty("http.proxyPort", "8888");
    System.setProperty("http.nonProxyHosts","xxxxxxx"); // si besoin

    Si on à
    Proxy Authentication Required
    comme erreur, on met
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    System.setProperty("http.proxyUser", "");
    System.setProperty("http.proxyPassword", "");

    si l'authentification ne marche pas, demandez qu'on vous donne les droits.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Virtual HOST Exception.
    Par sekaijin dans le forum Websphere
    Réponses: 0
    Dernier message: 22/03/2011, 10h36
  2. [Liferay] Unknown entity exception
    Par lamis2009 dans le forum Portails
    Réponses: 1
    Dernier message: 10/04/2010, 14h56
  3. Error : Unknown Miktex Exception
    Par Azra-Hell dans le forum Distributions
    Réponses: 1
    Dernier message: 29/09/2007, 21h58
  4. Réponses: 4
    Dernier message: 15/05/2006, 00h26
  5. Réponses: 8
    Dernier message: 29/03/2006, 15h50

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