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

Hibernate Java Discussion :

configurer hibernate sous Spring web services


Sujet :

Hibernate Java

  1. #1
    Futur Membre du Club
    Inscrit en
    Octobre 2008
    Messages
    10
    Détails du profil
    Informations forums :
    Inscription : Octobre 2008
    Messages : 10
    Points : 6
    Points
    6
    Par défaut configurer hibernate sous Spring web services
    bonjour a tous.
    J'ai un problème qui ne veut pas sde debloquer depuis plus qu'une semaine maintenant.
    Voici tout d'abord un petit apercu: Je bosse sur un projet mis en place sur le web service springWS et travaillant sur SQL Server. Le web service marche parfaitement, et j'injecte les données dans ma base de données remote.

    J'ai maintenant mis en place une couche de persistence basée sur Hibernate.
    Je n'arrive pas a configurer Hibernate dans le fichier de configuration de springWs qui est le suivant:
    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
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
     
    <bean id="insertionEndpoint" class="com.recruit.ws.InsertionEndpoint">
    	<constructor-arg ref="insertionService"/>
    </bean>
    <bean id="insertionService" class="com.recruit.service.StubSpeedInsertion"/>
    <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
    	<property name="mappings">
    		<props>
     
    			 			 <prop key="{http://com.recruit.ws/schema/recruit}InsertionInscriptionRequest">insertionEndpoint</prop>	
    		</props>
     
     
    		</property>
     
    	<property name="interceptors">
    		<list>
    		<bean class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor"></bean>
    </list>
    </property>
    </bean>
    <bean id="displayEndpoint" class="com.recruit.ws.DisplayEndpoint">
    	<constructor-arg ref="displayService" />
    </bean>
    <bean id="displayService" class="com.recruit.service.StubDisplay"/>
    <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
    	<property name="mappings">
    		<props>
    			 <prop key="{http://com.recruit.ws/schema/recruit}DisplayTelephoneRequest">displayEndpoint</prop>	
     
    		</props>
     
    	</property>
     
     
    	<property name="interceptors">
    		<list>
    		<bean class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor"></bean>
    </list>
    </property>
    </bean>
     
     
    <bean id="recruit" class="org.springframework.ws.wsdl.wsdl11.DynamicWsdl11Definition">   
      <property name="builder">
        <bean class="org.springframework.ws.wsdl.wsdl11.builder.XsdBasedSoap11Wsdl4jDefinitionBuilder">
          <property name="schema" value="/WEB-INF/recruit.xsd"/>                                  
          <property name="portTypeName" value="Recruit"/>                              
          <property name="locationUri" value="http://localhost:8080/project/recruit"/>       
     
        </bean>
      </property>
    </bean>
     
    </beans>
    le fichier ci dessous est le fichier spring-ws-servlet.xml. ici je n'ai pas ajouter les beans de config d'hibernate et le web service marche normalement.

    Maintenant voisi les beans que j'ai ajouté a ce fichier:
    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
    <bean id="dataSource"
    	class="org.springframework.jdbc.datasource.DriverManagerDataSource"
    	destroy-method="close">
    	<property name="driverClassName"><!-- <value>org.hsqldb.jdbcDriver</value> -->
    		<value>com.microsoft.sqlserver.jdbc.SQLServerDriver</value>
    	</property>
    	<property name="url">
    		<value>jdbc:sqlserver://10.166.88.235:1433;databaseName=E-Recruitment</value>
    	</property>
    	<property name="username">
    		<value>hr</value>
    	</property>
    	<property name="password">
    		<value>hr</value>
    	</property>
     </bean>
     
    <bean id="myHibernateProperties"
    	class="org.springframework.beans.factory.config.PropertiesFactoryBean">
    	<property name="properties">
    		<props>
    			<prop key="hibernate.dialect">
    				org.hibernate.dialect.SQLServerDialect
    			</prop>
    			<prop key="hibernate.show_sql">true</prop>
    			<prop key="hibernate.use_outer_join">true</prop>
    			<prop key="hibernate.transaction.factory_class">
    			org.hibernate.transaction.JDBCTransactionFactory </prop>
     
    		</props>
    	</property>
    </bean>
     
     <bean id="mySessionFactory"
            class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
     
        <property name="mappingResources">
          <list>
            <value>/TContact.hbm.xml</value>
          </list>
        </property>
      <property name="hibernateProperties">
    		<ref bean="myHibernateProperties" />
    	</property>
    	<property name="dataSource">
    		<ref bean="dataSource" />
    	</property>
     
     </bean>
     <bean id="mappingData"
             class="org.springframework.orm.hibernate3.HibernateTransactionManager">
         <property name="mySessionFactory" ref="mySessionFactory" />
       </bean>
    maintenant le fichier ne veut plus detecter le web service.
    est ce que svp vous aurez une idée sur la façon avec laquelle se configure hibernate sous springWS.
    merci a tous
    PS: ce n'est pas la meme chose que sous spring framework.

  2. #2
    Membre régulier
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2008
    Messages
    146
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Avril 2008
    Messages : 146
    Points : 101
    Points
    101
    Par défaut
    essaye de voir la démonstration dans le site developpez ça peut t'aider , bonne chance.

  3. #3
    Futur Membre du Club
    Inscrit en
    Octobre 2008
    Messages
    10
    Détails du profil
    Informations forums :
    Inscription : Octobre 2008
    Messages : 10
    Points : 6
    Points
    6
    Par défaut
    quelle Démonstration?

Discussions similaires

  1. [Web Services] Intégration de Esper avec Spring Web Service
    Par lollita2321 dans le forum Spring
    Réponses: 0
    Dernier message: 15/04/2013, 21h20
  2. [Web Services] Spring Web Services
    Par Ho(c)ine. dans le forum Spring
    Réponses: 7
    Dernier message: 03/11/2010, 10h53
  3. Configuration Hibernate sous Eclipse
    Par the fog dans le forum Hibernate
    Réponses: 1
    Dernier message: 07/05/2010, 14h57
  4. Réponses: 3
    Dernier message: 15/05/2007, 16h47
  5. [debutant] configurer hibernate sous myeclipse
    Par solawe dans le forum Hibernate
    Réponses: 3
    Dernier message: 22/11/2006, 10h36

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