Bonjour,

je suis en train de mettre en place une nouvelle architecture d'application, basée sur JPA, Hibernate,Spring sur base MySQL5
Cette architecture est à déployée sur un serveur JBOSS 5.
Au déploiement de l'application la console JBOSS me soulève cette 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
 
** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
 
persistence.unit:unitName=SpringProjectEAR.ear/Test.war#JPA
 -> jboss.jca:name=
         java:MyDS
      ,service=DataSourceBinding{Create:** NOT FOUND Depends on 'jboss.jca:name=
         java:MyDS
      ,service=DataSourceBinding' **}
 
 
*** CONTEXTS IN ERROR: Name -> Error
 
jboss.jca:name=
         java:MyDS
      ,service=DataSourceBinding -> ** NOT FOUND Depends on 'jboss.jca:name=
         java:MyDS
      ,service=DataSourceBinding' **
Voici le code de mon fichier persistence.xml
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
 
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" 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_1_0.xsd">
  <persistence-unit name="JPA" transaction-type="JTA">
    <jta-data-source>java:MyDS</jta-data-source>
    <properties/>
  </persistence-unit>
</persistence>

Voici le code de mon fichier mysql-ds.xml placé dans le repertoire deploy du serveur JBOSS
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
 
<?xml version="1.0" encoding="UTF-8"?>
 
<!-- $Id: mysql-ds.xml,v 1.2 2003/12/12 19:22:31 starksm Exp $ -->
<!--  Datasource config for MySQL using 3.0.9 available from:
http://www.mysql.com/downloads/api-jdbc-stable.html
-->
 
<datasources>
  <local-tx-datasource>	
    <jndi-name>MyDS</jndi-name>
    <connection-url>jdbc:mysql://localhost:3306/skillbrowser</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>root</user-name>
    <password></password>
  </local-tx-datasource>
</datasources>

voici le code de mon fichier applicationContextJpa.xml nécessaire à Spring
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
65
 
<?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"
	xsi:schemaLocation="http://www.springframework.org/schema/beans 
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context-2.5.xsd
           http://www.springframework.org/schema/tx 
           http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
 
 
	<!-- Placholders to import inherited variables -->
	<bean id="project-properties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="ignoreUnresolvablePlaceholders">
			<value>true</value>
		</property>
		<property name="locations">
			<list>
				<value>
					classpath*:com/tuto/domain/dao/jpa/database.properties
				</value>
			</list>
		</property>
	</bean>
 
	<!-- post-processors for all standard config annotations -->
	<context:annotation-config />
	<context:component-scan base-package="com.tuto" />
 
	<!-- Exception translation bean post processor -->
	<bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
 
	<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" destroy-method="close">
		<property name="driverClassName" value="${hibernate.connection.driver_class}" />
		<property name="url" value="${hibernate.connection.url}" />
		<property name="username" value="${hibernate.connection.username}" />
		<property name="password" value="${hibernate.connection.password}" />
	</bean>
 
	<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
		<property name="dataSource" ref="dataSource" />
		<property name="jpaDialect">
			<bean class="${jpa.dialect}" />
		</property>
		<property name="jpaVendorAdapter">
			<bean class="org.springframework.orm.jpa.vendor.${jpa.vendor.adapter}">
				<property name="showSql" value="${hibernate.show_sql}" />
				<property name="databasePlatform" value="${hibernate.dialect}" />
				<!-- On ne genere pas la BDD au demarrage -->
				<property name="generateDdl" value="false" />
			</bean>
		</property>
	</bean>
 
	<bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionManager">
		<property name="entityManagerFactory" ref="entityManagerFactory" />
	</bean>
 
	<!-- enable the configuration of transactional behavior based on annotations -->
	<tx:annotation-driven transaction-manager="txManager" />
 
</beans>
et enfin le code du fichier database.properties
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
 
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost:3306/skillbrowser
hibernate.connection.username=root
hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
hibernate.show_sql=true
jpa.dialect=org.springframework.orm.jpa.vendor.HibernateJpaDialect
jpa.vendor.adapter=HibernateJpaVendorAdapter
Merci pour votre aide