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 :

Web Service JAX-WS avec Spring


Sujet :

Services Web Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Femme Profil pro
    Étudiant
    Inscrit en
    Juin 2011
    Messages
    35
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 36
    Localisation : Maroc

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2011
    Messages : 35
    Par défaut Web Service JAX-WS avec Spring
    Salut tout le monde,
    Je voudrais créer des web services Jax ws avec les frameworks spring et hibernate ( avec Tomcat ), je me suis inspirée de ce tutoriel :
    http://www.mkyong.com/webservices/ja...ation-example/

    Je voudrais tester une méthode qui retourne une liste de "Type de service" voilà ce que j'ai fait dans ma méthode :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    @WebMethod(operationName="afficherListType")
    public List<Typeservice> afficherListType(){
     
        return (List<Typeservice>)typeserviceBo.findAllTypeService();
    }
    J'ai crée un autre projet pour tester ce webservice, et pour tester cette méthode j'ai fait comme ceci:

    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
        <%
        try {
    	webservices.NewWebService_Service service = new webservices.NewWebService_Service();
    	webservices.NewWebService port = service.getNewWebServicePort();
     
    	java.util.List<webservices.Typeservice> result = port.afficherListType();
     
     
            for(webservices.Typeservice s:result){
                out.println("Libelle "+s.getLibelleType().toString());
            }
        } catch (Exception ex) {
    	// TODO handle custom exceptions here
        }
        %>
    Quand j'exécute la partie cliente ça m'affiche rien dans l'exécution, et aussi ça me donne quelques erreurs, je voudrais savoir svp si ce que j'ai fait est correcte ou pas car vraiment là je suis bloquée.
    Merci

  2. #2
    Membre averti
    Femme Profil pro
    Étudiant
    Inscrit en
    Juin 2011
    Messages
    35
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 36
    Localisation : Maroc

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2011
    Messages : 35
    Par défaut
    Et voilà l'erreur que ça me donne quand le web service est exécuté:

    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
    7 août 2012 21:29:01 org.hibernate.LazyInitializationException <init>
    GRAVE: could not initialize proxy - no Session
    org.hibernate.LazyInitializationException: could not initialize proxy - no Session
    	at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:57)
    	at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
    	at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:150)
    	at ma.eitconsulting.annuaire.model.Abonnement$$EnhancerByCGLIB$$83ff4d4f.getCommande(<generated>)
    	at ma.eitconsulting.annuaire.model.Abonnement$JaxbAccessorM_getCommande_setCommande_ma_eitconsulting_annuaire_model_Commande.get(MethodAccessor_Ref.java:52)
    	at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:127)
    	at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:340)
    	at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:696)
    	at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:152)
    	at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:340)
    	at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:696)
    	at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:65)
    	at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:168)
    	at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:155)
    	at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:340)
    	at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:696)
    	at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:65)
    	at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:168)
    	at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:155)
    	at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:340)
    	at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:696)
    	at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:264)
    	at com.sun.xml.bind.v2.runtime.BridgeImpl.marshal(BridgeImpl.java:100)
    	at com.sun.xml.bind.api.Bridge.marshal(Bridge.java:141)
    	at com.sun.xml.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.java:317)
    	at com.sun.xml.ws.message.AbstractMessageImpl.writeTo(AbstractMessageImpl.java:142)
    	at com.sun.xml.ws.encoding.StreamSOAPCodec.encode(StreamSOAPCodec.java:109)
    	at com.sun.xml.ws.encoding.SOAPBindingCodec.encode(SOAPBindingCodec.java:278)
    	at com.sun.xml.ws.transport.http.HttpAdapter.encodePacket(HttpAdapter.java:380)
    	at com.sun.xml.ws.transport.http.HttpAdapter.access$100(HttpAdapter.java:92)
    	at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:525)
    	at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:285)
    	at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:143)
    	at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:155)
    	at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:189)
    	at com.sun.xml.ws.transport.http.servlet.WSSpringServlet.doPost(WSSpringServlet.java:52)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    	at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
    	at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
    	at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
    	at java.lang.Thread.run(Thread.java:662)

  3. #3
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2012
    Messages
    2
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2012
    Messages : 2
    Par défaut erreur dans une classe hibernate
    bonjour , ce qu'il parait que tu a un attribut (Implémentation c'est je me suis pas trempé) dans une de tes classes qui déclarer comme "lazy" il faut le changer vers "eager"

Discussions similaires

  1. [JAX-RS 2.0] Client de web service pour REST avec JEE 7
    Par geforce dans le forum Services Web
    Réponses: 2
    Dernier message: 20/01/2015, 17h09
  2. Consommer un web service JAX-WS avec un client JDK 1.4 ?
    Par Jibee dans le forum Services Web
    Réponses: 1
    Dernier message: 23/10/2008, 10h47
  3. pooling de connexions sur web service jax-ws
    Par zais_ethael dans le forum Services Web
    Réponses: 8
    Dernier message: 09/04/2008, 13h06
  4. securisation de Web Services dans Jonas avec Axis
    Par emeras dans le forum Services Web
    Réponses: 1
    Dernier message: 08/02/2007, 15h54
  5. [Axis]dépoiement web service sur tomcat avec axis
    Par lili2704 dans le forum Tomcat et TomEE
    Réponses: 7
    Dernier message: 02/02/2005, 13h44

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