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

Spring Java Discussion :

JSF Spring3 Tomcat6


Sujet :

Spring Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Inscrit en
    Décembre 2006
    Messages
    33
    Détails du profil
    Informations forums :
    Inscription : Décembre 2006
    Messages : 33
    Par défaut JSF Spring3 Tomcat6
    Bonjour,
    j'utilise Spring 3.0.0, JPA 2 avec un serveur Tomcat 6.0.18 et j'ai paramétré mon fichier /WEB-INF/applicationContext.xml afin que Spring utilise les annotations et injecte l'entityManager.
    Mais lorsque je deploie mon application en utilisant Maven la console m'affiche :

    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
     
    31 mars 2010 17:04:23 org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    31 mars 2010 17:04:23 org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/31  config=null
    31 mars 2010 17:04:23 org.apache.catalina.startup.Catalina start
    INFO: Server startup in 4759 ms
    31 mars 2010 17:04:44 org.apache.catalina.startup.HostConfig deployWAR
    INFO: D�ploiement de l'archive reservationhotelliere.war de l'application web
    31 mars 2010 17:04:50 com.sun.faces.config.ConfigureListener contextInitialized
    INFO: Initializing Mojarra (1.2_12-b01-FCS) for context '/reservationhotelliere'
    log4j:WARN No appenders could be found for logger (org.ajax4jsf.renderkit.ChameleonRenderKitFactory).
    log4j:WARN Please initialize the log4j system properly.
    31 mars 2010 17:04:54 org.apache.catalina.core.ApplicationContext log
    INFO: Initializing Spring root WebApplicationContext
    voilà mon applicationContext.xml :

    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
     
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:tx="http://www.springframework.org/schema/tx"
    	xmlns:p="http://www.springframework.org/schema/p"
    	xmlns:aop="http://www.springframework.org/schema/aop"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans
    						http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    						http://www.springframework.org/schema/context
    						http://www.springframework.org/schema/context/spring-context-3.0.xsd
    						http://www.springframework.org/schema/tx
    						http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
    						http://www.springframework.org/schema/aop
    						http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
     
    	<!-- holding properties for database connectivity /-->
    	<context:component-scan base-package="com.bgi" />
    	<context:property-placeholder location="classpath:jdbc.properties"/>
     
    	<!-- enabling annotation driven configuration /-->
    	<context:annotation-config />
     
    	<tx:annotation-driven transaction-manager="transactionManager" />
     
    	<bean
    		class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
     
    	<bean id="entityManagerFactory"
    		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
    		p:dataSource-ref="dataSource"
    		p:jpaVendorAdapter-ref="jpaAdapter">
    		<property name="loadTimeWeaver">
    			<bean
    				class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver" />
    		</property>
    		<property name="persistenceUnitName" value="reservationPU"></property>
    	</bean>
     
    	<bean id="dataSource"
    		class="org.springframework.jdbc.datasource.DriverManagerDataSource"
    		p:driverClassName="oracle.jdbc.driver.OracleDriver"
    		p:url="jdbc:oracle:thin:@192.168.1.87:1521:BGIBD"
    		p:username="resrevation"
    		p:password="resrevation" />
     
    	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
    		p:entityManagerFactory-ref="entityManagerFactory" />
     
    	<bean id="jpaAdapter"
    		class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
    		p:database="ORACLE"
    		p:databasePlatform="org.hibernate.dialect.OracleDialect"
    		p:generateDdl="true"
    		p:showSql="true" />
    </beans>
    j'ai pas compris pourquoi ça ne fonctionne pas !
    Merci de votre Aide.

  2. #2
    Membre averti
    Homme Profil pro
    Développeur blockchain
    Inscrit en
    Avril 2003
    Messages
    20
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur blockchain
    Secteur : Finance

    Informations forums :
    Inscription : Avril 2003
    Messages : 20
    Par défaut
    Ou se trouve le message d'erreur ???

    Citation Envoyé par aboualhassen Voir le message
    Bonjour,
    j'utilise Spring 3.0.0, JPA 2 avec un serveur Tomcat 6.0.18 et j'ai paramétré mon fichier /WEB-INF/applicationContext.xml afin que Spring utilise les annotations et injecte l'entityManager.
    Mais lorsque je deploie mon application en utilisant Maven la console m'affiche :

    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
     
    31 mars 2010 17:04:23 org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    31 mars 2010 17:04:23 org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/31  config=null
    31 mars 2010 17:04:23 org.apache.catalina.startup.Catalina start
    INFO: Server startup in 4759 ms
    31 mars 2010 17:04:44 org.apache.catalina.startup.HostConfig deployWAR
    INFO: D�ploiement de l'archive reservationhotelliere.war de l'application web
    31 mars 2010 17:04:50 com.sun.faces.config.ConfigureListener contextInitialized
    INFO: Initializing Mojarra (1.2_12-b01-FCS) for context '/reservationhotelliere'
    log4j:WARN No appenders could be found for logger (org.ajax4jsf.renderkit.ChameleonRenderKitFactory).
    log4j:WARN Please initialize the log4j system properly.
    31 mars 2010 17:04:54 org.apache.catalina.core.ApplicationContext log
    INFO: Initializing Spring root WebApplicationContext
    voilà mon applicationContext.xml :

    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
     
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:tx="http://www.springframework.org/schema/tx"
    	xmlns:p="http://www.springframework.org/schema/p"
    	xmlns:aop="http://www.springframework.org/schema/aop"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans
    						http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    						http://www.springframework.org/schema/context
    						http://www.springframework.org/schema/context/spring-context-3.0.xsd
    						http://www.springframework.org/schema/tx
    						http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
    						http://www.springframework.org/schema/aop
    						http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
     
    	<!-- holding properties for database connectivity /-->
    	<context:component-scan base-package="com.bgi" />
    	<context:property-placeholder location="classpath:jdbc.properties"/>
     
    	<!-- enabling annotation driven configuration /-->
    	<context:annotation-config />
     
    	<tx:annotation-driven transaction-manager="transactionManager" />
     
    	<bean
    		class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
     
    	<bean id="entityManagerFactory"
    		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
    		p:dataSource-ref="dataSource"
    		p:jpaVendorAdapter-ref="jpaAdapter">
    		<property name="loadTimeWeaver">
    			<bean
    				class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver" />
    		</property>
    		<property name="persistenceUnitName" value="reservationPU"></property>
    	</bean>
     
    	<bean id="dataSource"
    		class="org.springframework.jdbc.datasource.DriverManagerDataSource"
    		p:driverClassName="oracle.jdbc.driver.OracleDriver"
    		p:url="jdbc:oracle:thin:@192.168.1.87:1521:BGIBD"
    		p:username="resrevation"
    		p:password="resrevation" />
     
    	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
    		p:entityManagerFactory-ref="entityManagerFactory" />
     
    	<bean id="jpaAdapter"
    		class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
    		p:database="ORACLE"
    		p:databasePlatform="org.hibernate.dialect.OracleDialect"
    		p:generateDdl="true"
    		p:showSql="true" />
    </beans>
    j'ai pas compris pourquoi ça ne fonctionne pas !
    Merci de votre Aide.

  3. #3
    Membre confirmé
    Homme Profil pro
    Expert MDE
    Inscrit en
    Janvier 2008
    Messages
    183
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Expert MDE
    Secteur : High Tech - Électronique et micro-électronique

    Informations forums :
    Inscription : Janvier 2008
    Messages : 183
    Par défaut
    Salut,

    Pourrait-on avoir ton fichier web.xml?

    --
    Charlie Mordant,
    media.helloworld.is-an-engineer.com

Discussions similaires

  1. JSF vs Struts
    Par peuh dans le forum JSF
    Réponses: 22
    Dernier message: 06/04/2013, 22h49
  2. Crud JPA/SPRING3/JSF sur google app engine
    Par rouissi.asma dans le forum Cloud Computing
    Réponses: 0
    Dernier message: 11/05/2011, 21h22
  3. JSF et Tomcat6
    Par aboualhassen dans le forum JSF
    Réponses: 6
    Dernier message: 18/03/2010, 16h46
  4. JSF et Eclipse gallileo serveur Tomcat6.0
    Par Deign dans le forum JSF
    Réponses: 6
    Dernier message: 27/07/2009, 00h47
  5. configurer jsf et hibernate sous tomcat6
    Par info_plus dans le forum JSF
    Réponses: 5
    Dernier message: 10/04/2008, 11h01

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