Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Długie]Hibernate Sync - wyjątki

0 views
Skip to first unread message

Uzytkownik

unread,
Jan 10, 2006, 10:06:36 AM1/10/06
to
Użyłem Hibernate Sync.
Na początku wszystko ładnie, ale wyskakuje taki wyjatek:

log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.hibernate.MappingException: Could not read
mappings from resource: org/dyndns/mojastrona/biblog/core/Wydanie.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:484)
(...)
at
org.dyndns.mojastrona.biblog.core.base._BaseRootDAO.initialize(_BaseRootDAO.java:32)
at org.dyndns.mojastrona.biblog.gui.Kategorie.main(Kategorie.java:13)
Caused by: org.hibernate.MappingException: invalid mapping
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:424)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:481)
... 10 more
Caused by: org.xml.sax.SAXParseException: Element type "propertis" must be
declared.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
(...)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:421)
... 11 more

Kod odpowiedzialny za to:
public static void main(String[] args) {
_RootDAO.initialize();
}

hibernate.cfg.xml:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
<!-- local connection properties -->
<property name="hibernate.connection.url">
jdbc:mysql://*****/*****
</property>
<property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="hibernate.connection.username">*****</property>
<property name="hibernate.connection.password">*****</property>
<!-- property name="hibernate.connection.pool_size"></property -->
<!-- dialect for MySQL -->
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="hibernate.show_sql">false</property>
<property name="hibernate.transaction.factory_class">
org.hibernate.transaction.JDBCTransactionFactory
</property>
<mapping resource="org/dyndns/mojastrona/biblog/core/Autor.hbm.xml" />
<mapping resource="org/dyndns/mojastrona/biblog/core/Kategoria.hbm.xml" />
<mapping resource="org/dyndns/mojastrona/biblog/core/Ksiazka.hbm.xml" />
<mapping resource="org/dyndns/mojastrona/biblog/core/Wydanie.hbm.xml" />
</session-factory>
</hibernate-configuration>

'Path' z eclipse (biblog to projekt):
/biblog/org/dyndns/mojastrona/biblog/core/Wydanie.hbm.xml
I sam plik mapowania:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<hibernate-mapping package="org.dyndns.mojastrona.biblog.core">
<class name="Wydanie" table="Wydanie">
<id name="id" type="integer">
<generator class="native"/>
</id>
<propertis name="wydanie" unique="true">
<property name="tytul" type="string" not-null="true" length="255" />
<property name="isbn" type="string" not-null="false" length="11" />
</propertis>
<property name="rokWydania" type="date" column="rok_wydania" not-null="true" />
<many-to-one class="Kategoria" name="kategoria" not-null="true" />
<set name="autorzy" table="WydanieAutor">
<key column="wydanie_id" />
<many-to-many column="autor_id" class="Autor" />
</set>
<set name="egzemplarze" inverse="true">
<key column="wydanie" />
<one-to-many class="Ksiazka" />
</set>
</class>
</hibernate-mapping>

Czy ktos wie, o co chodzi?

--
Wysłano z serwisu Usenet w portalu Gazeta.pl -> http://www.gazeta.pl/usenet/

Grzegorz Mucha

unread,
Jan 10, 2006, 10:16:52 AM1/10/06
to
On Tue, 10 Jan 2006 15:06:36 +0000 (UTC), Uzytkownik wrote:

> <propertis name="wydanie" unique="true">
> <property name="tytul" type="string" not-null="true" length="255" />
> <property name="isbn" type="string" not-null="false" length="11" />
> </propertis>

A co to kurde jest "propertis"? Jak dla mnei to ewidentny strzał jest.

mucher

Uzytkownik

unread,
Jan 10, 2006, 12:56:32 PM1/10/06
to
Grzegorz Mucha napisał:

Properties z błędem :)
W dodatku hibernate sync(a hibernate 3.1 tak) tego nie trawi :)

Pozdrawiam

0 new messages