2012-01-08 1 views
1

Hy à nouveau,erreur veille prolongée

Hier fonctionnait très bien et aujourd'hui je reçois l'erreur suivante quand j'ai commencé avec le même code dans la classe et le fichier en veille prolongée. Avez-vous une idée de ce qui est arrivé?

15:56:26 ERROR [AWT-EventQueue-0] (XMLHelper.java:81) - Error parsing XML: XML InputStream(4) The content of element type "class" is incomplete, it must match "(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|composite-id),discriminator?,natural-id?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*,((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-query)*)". 
null 
15:56:26 ERROR [AWT-EventQueue-0] (XMLHelper.java:81) - Error parsing XML: XML InputStream(4) The content of element type "class" is incomplete, it must match "(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|composite-id),discriminator?,natural-id?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*,((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-query)*)". 
15:56:26 ERROR [AWT-EventQueue-0] (XMLHelper.java:81) - Error parsing XML: XML InputStream(13) The element type "hibernate-mapping" must be terminated by the matching end-tag "</hibernate-mapping>". 
Cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [app-data.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from input stream 
15:56:26 ERROR [AWT-EventQueue-0] (XMLHelper.java:81) - Error parsing XML: XML InputStream(13) The element type "hibernate-mapping" must be terminated by the matching end-tag "</hibernate-mapping>". 

J'ai écrit le fichier de mappage de mise en veille prolongée pour la classe Utilizator qui utilise la table Utilizatori dans SQL 2008 et j'obtiens l'erreur suivante lorsque la classe est appelée par l'application:

Cause: org.springframework.beans.factory.BeanCreationException: 
    Error creating bean with name 'utilizatorDAO' defined in class path resource [app-data.xml]: 
    Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanInitializationException: 
    Initialization of DAO failed; nested exception is org.springframework.orm.hibernate3.HibernateQueryException: 
    Utilizatori is not mapped [from Utilizatori where utilizator = ?]; 
nested exception is org.hibernate.hql.ast.QuerySyntaxException: 
    Utilizatori is not mapped [from Utilizatori where utilizator = ?] 

Voici le code de la classe:

/* 
* To change this template, choose Tools | Templates 
* and open the template in the editor. 
*/ 
package domain; 

/** 
* 
* @author Admin 
*/ 
public class Utilizator { 

    private Long idUtilizator; 
    private String utilizator; 
    private String parola; 
    private String nivelAcces; 
    private String nume; 
    private String prenume; 

    public Utilizator() { 

    } 

    public Long getIdUtilizator() { 
     return idUtilizator; 
    } 

    public void setIdUtilizator(Long idUtilizator) { 
     this.idUtilizator = idUtilizator; 
    } 

    public String getUtilizator() { 
     return utilizator; 
    } 

    public void setUtilizator(String utilizator) { 
     this.utilizator = utilizator; 
    } 

    public String getParola() { 
     return parola; 
    } 

    public void setParola(String parola) { 
     this.parola = parola; 
    } 

    public String getNivelAcces() { 
     return nivelAcces; 
    } 

    public void setNivelAcces(String nivelAcces) { 
     this.nivelAcces = nivelAcces; 
    } 

    public String getNume() { 
     return nume; 
    } 

    public void setNume(String nume) { 
     this.nume = nume; 
    } 

    public String getPrenume() { 
     return prenume; 
    } 

    public void setPrenume(String prenume) { 
     this.prenume = prenume; 
    } 

} 

et ma fichier pping:

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> 
<hibernate-mapping> 
    <class name="domain.Utilizator" table="Utilizatori"/> 

     <id name="idUtilizator" column="IDUtilizator"> 
      <generator class="native" /> 
     </id>  

     <property name="utilizator"/> 
     <property name="parola"/> 
     <property name="nivelAcces"/> 
    </class>    
</hibernate-mapping> 
+0

Veuillez poster votre fichier de correspondance et votre code. – ziesemer

+1

La classe 'Utilizator' ou' Utilizatori' est-elle utilisée? HQL devrait utiliser le nom de la classe. –

+0

Utilizator est la classe; Utilizatori est le nom de la table SQL – JavaNUB

Répondre

2

Votre requête est erronée; il devrait utiliser le nom de la classe, pas le nom de la table de base de données; c'est-à-dire, utiliser Utilizator pas Utilizatori.

+0

thnx beaucoup Ernest. cela fonctionne – JavaNUB

+1

Si c'est la solution que vous choisissez, cliquez sur le bouton Accepter à côté! :) –