Bonjour à tous !
J'essaye de faire une appli web avec Spring, JPA/Hibernate, JSF.
Seulement, ça fait plusieurs jours que je galère et je ne trouve pas la solution à mon pb...
Donc voilà ce que j'ai :

Liste des jars :
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
 
antlr-2.7.6.jar
com.springsource.org.aopalliance-1.0.0.jar
commons-beanutils-1.7.0.jar
commons-codec-1.3.jar
commons-collections-3.1.jar
commons-collections-3.2.jar
commons-digester-1.8.jar
commons-discovery-0.4.jar
commons-logging-1.1.1.jar
db2jcc_license_cisuz.jar
db2jcc_license_cu.jar
db2jcc.jar
dom4j-1.6.1.jar
hibernate3.jar
hibernate-jpa-2.0-api-1.0.0.Final.jar
javassist-3.12.0.GA.jar
jstl.jar
jta-1.1.jar
log4j-1.2.16.jar
myfaces-api-1.2.9.jar
myfaces-impl-1.2.9.jar
org.springframework.aop-3.0.5.RELEASE.jar
org.springframework.asm-3.0.5.RELEASE.jar
org.springframework.aspects-3.0.5.RELEASE.jar
org.springframework.beans-3.0.5.RELEASE.jar
org.springframework.context.support-3.0.5.RELEASE.jar
org.springframework.context-3.0.5.RELEASE.jar
org.springframework.core-3.0.5.RELEASE.jar
org.springframework.expression-3.0.5.RELEASE.jar
org.springframework.instrument.tomcat-3.0.5.RELEASE.jar
org.springframework.instrument-3.0.5.RELEASE.jar
org.springframework.jdbc-3.0.5.RELEASE.jar
org.springframework.jms-3.0.5.RELEASE.jar
org.springframework.orm-3.0.5.RELEASE.jar
org.springframework.oxm-3.0.5.RELEASE.jar
org.springframework.test-3.0.5.RELEASE.jar
org.springframework.transaction-3.0.5.RELEASE.jar
org.springframework.web.portlet-3.0.5.RELEASE.jar
org.springframework.web.servlet-3.0.5.RELEASE.jar
org.springframework.web.struts-3.0.5.RELEASE.jar
org.springframework.web-3.0.5.RELEASE.jar
slf4j-api-1.6.1.jar
slf4j-log4j12-1.6.1.jar
standard.jar
/META-INF/persistence.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
 
<persistence xmlns="http://java.sun.com/xml/ns/persistence" 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" 
             version="2.0">
 
	<persistence-unit name="myPersistenceUnit" transaction-type="RESOURCE_LOCAL">
 
		<provider>org.hibernate.ejb.HibernatePersistence</provider>
 
		<properties>
			<property name="hibernate.jdbc.Schema" value="ADMTDB2" />
			<property name="hibernate.connection.driver_class" value="com.ibm.db2.jcc.DB2Driver" /> 
			<property name="hibernate.connection.url" value="jdbc:db2://serveur:50000/base;" /> 
			<property name="hibernate.connection.username" value="user" /> 
			<property name="hibernate.connection.password" value="pwd" /> 
			<property name="hibernate.Log" value="none" /> 
			<property name="hibernate.dialect" value="org.hibernate.dialect.DB2Dialect" />
		</properties>	
 
		<class>bean.MyTest</class>
 
	</persistence-unit>
 
</persistence>
/WEB-INF/web.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
 
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" 
         xmlns="http://java.sun.com/xml/ns/javaee" 
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5">
 
	<display-name>My Test</display-name>
 
	<!-- Log4j -->	
 	<context-param>
 		<param-name>log4jConfigLocation</param-name>
 		<param-value>/WEB-INF/log4j.xml</param-value>
 	</context-param>
	<listener>
		<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
	</listener>
 
	<!-- Spring -->
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>
 
	<!-- Faces servlet -->	
	<servlet>
		<servlet-name>Faces servlet</servlet-name>
		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
 
	<!-- Faces servlet mapping -->
	<servlet-mapping>
		<servlet-name>Faces servlet</servlet-name>
		<url-pattern>*.faces</url-pattern>
	</servlet-mapping>
 
	<!-- Pages d'accueil -->	
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
	</welcome-file-list>
 
</web-app>
/WEB-INF/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
 
<?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:p="http://www.springframework.org/schema/p" 
       xmlns:tx="http://www.springframework.org/schema/tx" 
       xmlns:context="http://www.springframework.org/schema/context" 
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd 
                           http://www.springframework.org/schema/p http://www.springframework.org/schema/p/spring-p.xsd 
                           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd 
                           http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
 
	<!-- Database Connection definition -->
	<bean id="myDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
		<property name="driverClassName" value="com.ibm.db2.jcc.DB2Driver" />
		<property name="url" value="jdbc:db2://serveur:50000/base" />
		<property name="username" value="user" />
		<property name="password" value="mdp" />
	</bean>
 
	<!-- JPA EntityManagerFactory -->
    <bean id="myEntityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
    	<property name="persistenceUnitName" value="myPersistenceUnit" />
    	<property name="jpaVendorAdapter">
			<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
				<property name="showSql" value="true" />
				<property name="generateDdl" value="true" />
				<property name="databasePlatform" value="org.hibernate.dialect.DB2Dialect" />
			</bean>
		</property>
	</bean>
 
	<bean id="myTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
		<property name="entityManagerFactory" ref="myEntityManagerFactory" />
		<property name="dataSource" ref="myDataSource"/>
	</bean>
 
    <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
 
	<!-- DAO -->	
	<bean id="myTestDao" class="dao.impl.MyTestDaoImpl">
	</bean>
 
	<!-- Service -->	
	<bean id="myTestService" class="service.impl.MyTestServiceImpl">
		<property name="myTestDao" ref="myTestDao" />
	</bean>
 
	<!-- Web -->	
	<bean id="myTestWeb" class="web.MyTestWeb">
		<property name="myTestService" ref="myTestService" />
	</bean>
 
	<tx:annotation-driven transaction-manager="myTransactionManager" />
 
</beans>
et 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
 
 nov. 2010 16:38:37 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\IBM\SDP\jdk\jre\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\Program Files\IBM\SDP\bin
5 nov. 2010 16:38:37 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Spring4' did not find a matching property.
5 nov. 2010 16:38:37 org.apache.coyote.http11.Http11Protocol init
INFO: Initialisation de Coyote HTTP/1.1 sur http-8080
5 nov. 2010 16:38:37 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 668 ms
5 nov. 2010 16:38:37 org.apache.catalina.core.StandardService start
INFO: Démarrage du service Catalina
5 nov. 2010 16:38:37 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
log4j:WARN No appenders could be found for logger (org.apache.myfaces.webapp.StartupServletContextListener).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
5 nov. 2010 16:38:38 org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "org.apache.myfaces.webapp.StartupServletContextListener" is already configured for this context. The duplicate definition has been ignored.
5 nov. 2010 16:38:38 org.apache.catalina.core.ApplicationContext log
INFO: Set web app root system property: 'webapp.root' = [C:\EclipseDir\workspaces\Spring_tests\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\Spring4\]
5 nov. 2010 16:38:38 org.apache.catalina.core.ApplicationContext log
INFO: Initializing log4j from [C:\EclipseDir\workspaces\Spring_tests\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\Spring4\WEB-INF\log4j.xml]
5 nov. 2010 16:38:38 org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/EclipseDir/apache-tomcat-6.0.29/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/EclipseDir/workspaces/Spring_tests/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/Spring4/WEB-INF/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
ERROR - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myEntityManagerFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: PersistenceProvider [org.hibernate.ejb.HibernatePersistence@4eb74eb7] did not return an EntityManagerFactory for name 'myPersistenceUnit'
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
	at org.apache.catalina.core.StandardService.start(StandardService.java:519)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at java.lang.reflect.Method.invoke(Method.java:600)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.IllegalStateException: PersistenceProvider [org.hibernate.ejb.HibernatePersistence@4eb74eb7] did not return an EntityManagerFactory for name 'myPersistenceUnit'
	at org.springframework.orm.jpa.LocalEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalEntityManagerFactoryBean.java:84)
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:308)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
	... 27 more
Alors pourquoi "PersistenceProvider [org.hibernate.ejb.HibernatePersistence@4eb74eb7] did not return an EntityManagerFactory" ???

Please, je galère car je suis débutant dans ce domaine, et je ne sais plus quoi faire...

Merci d'avance !