Hyは、今日では、私は次のエラーを受け取ります。 何が起こったのか何か手がかりを持っていますか?休止エラーもう一度、</p> <p>昨日は罰金を働いていた
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>".
私はSQL 2008でUtilizatori
テーブルを使用するクラスUtilizator
のHibernateマッピングファイルを書かれていると私はクラスがアプリケーションによって呼び出されたときに、次のエラーを取得しています:
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 = ?]
クラスコードは次のとおりです。
/*
* 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;
}
}
とma 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>
マッピングファイルとコードを投稿してください。 – ziesemer
クラスは「Utilizator」または「Utilizatori」ですか? HQLはクラス名を使用する必要があります。 –
Utilizatorはクラスです。 UtilizatoriはSQLテーブルの名前です – JavaNUB