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 :

exception générer du spring-config.xml


Sujet :

Spring Java

  1. #1
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2013
    Messages
    13
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

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

    Informations forums :
    Inscription : Mars 2013
    Messages : 13
    Points : 9
    Points
    9
    Par défaut exception générer du spring-config.xml
    Bonjour je suis nouveau dans spring et je veux l'utiliser avec hibernate pour créer mes tables à partir de mes entités mais j'ai toujours cette erreur :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    06-May-2014 10:08:47.135 SEVERE [RMI TCP Connection(4)-127.0.0.1] org.springframework.web.context.ContextLoader.initWebApplicationContext Context initialization failed
     org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 36 in XML document from URL [file:/Users/rochdiyassine/IdeaProjects/TestEleve2/out/artifacts/TestEleve2_war_exploded/WEB-INF/classes/spring-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException; systemId: http://www.springframework.org/schema/data/jpa/spring-jpa.xsd; lineNumber: 36; columnNumber: 63; src-resolve : Impossible de resoudre le nom 'repository:auditing-attributes' en un composant 'attribute group'.
    voici mon spring-config.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
    <?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:jpa="http://www.springframework.org/schema/data/jpa"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans.xsd
           http://www.springframework.org/schema/data/jpa
           http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
           http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           ">
     
        <jpa:repositories base-package="Repository"/>
     
        <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
            <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
            <property name="url" value="jdbc:mysql://localhost:8889/testeleve"/>
            <property name="username" value="root"/>
            <property name="password" value="yassine"/>
        </bean>
     
     
        <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
            <property name="jpaProperties">
                <props>
                    <prop key="hibernate.hbm2ddl.auto">create</prop>
                    <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
                    <prop key="show_sql">true</prop>
                </props>
            </property>
            <property name="dataSource" ref="dataSource"/>
            <property name="jpaVendorAdapter">
                <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"/>
            </property>
            <property name="persistenceProvider">
                <bean class="org.hibernate.ejb.HibernatePersistence"/>
            </property>
            <!-- spring scanning for entity classes-->
            <property name="packagesToScan" value="Class"/>
        </bean>
        <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"/>
    </beans>
    que je l'upload de mon fichier 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
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
             version="3.1">
     
     
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>
                classpath*:
            </param-value>
        </context-param>
     
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
    </web-app>

  2. #2
    Rédacteur/Modérateur
    Avatar de andry.aime
    Homme Profil pro
    Inscrit en
    Septembre 2007
    Messages
    8 391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Ile Maurice

    Informations forums :
    Inscription : Septembre 2007
    Messages : 8 391
    Points : 15 059
    Points
    15 059
    Par défaut
    Bonjour,

    Impossible de resoudre le nom 'repository:auditing-attributes'
    Est-ce ton fichier de configuration en entier, ou il y a d'autre?
    Ajoute
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     http://www.springframework.org/schema/data/repository
    http://www.springframework.org/schema/data/repository/spring-repository-1.5.xsd
    dans ton xsi:schemaLocation.

    A+.

  3. #3
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2013
    Messages
    13
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

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

    Informations forums :
    Inscription : Mars 2013
    Messages : 13
    Points : 9
    Points
    9
    Par défaut
    Oui j'utilise qu'un seul fichier de configuration que j'ai copié en entier, j'ai ajouté les deux ligne mais ça marche toujours pas. J'utilise aussi les JAR suivants : Nom : Capture d’écran 2014-05-12 à 09.36.21.png
Affichages : 220
Taille : 52,3 Ko

  4. #4
    Rédacteur/Modérateur
    Avatar de andry.aime
    Homme Profil pro
    Inscrit en
    Septembre 2007
    Messages
    8 391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Ile Maurice

    Informations forums :
    Inscription : Septembre 2007
    Messages : 8 391
    Points : 15 059
    Points
    15 059
    Par défaut
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    <param-value>
                classpath*:
            </param-value>
    Pourquoi tu utilises classpath*? ça va charger n'importe quoi. Remplace par
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    classpath:/cheminVersLeConfigSiilYa/spring-config.xml

    A+.

  5. #5
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2013
    Messages
    13
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

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

    Informations forums :
    Inscription : Mars 2013
    Messages : 13
    Points : 9
    Points
    9
    Par défaut
    Ca ne vas rien changé puisque j'ai qu'un seul fichier de configuration.

Discussions similaires

  1. spring-config.xml dans le fichier web.xml
    Par yassine05 dans le forum Spring
    Réponses: 3
    Dernier message: 05/05/2014, 13h25
  2. [Data] [Tutoriel Serge Tahé] Problème avec le spring-config.xml
    Par zaboug dans le forum Spring
    Réponses: 13
    Dernier message: 24/05/2011, 01h15
  3. Réponses: 0
    Dernier message: 22/07/2009, 16h31
  4. [struts]: struts-config.xml
    Par sleepy2002 dans le forum Struts 1
    Réponses: 2
    Dernier message: 01/10/2004, 10h32
  5. []générer et LIRE du xml avec vb: sélection d'un node
    Par chris21 dans le forum VB 6 et antérieur
    Réponses: 11
    Dernier message: 19/09/2003, 13h14

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