-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Error when buildSessionFactory()
PostPosted: Sat Oct 11, 2003 11:38 pm 
Newbie

Joined: Sat Oct 11, 2003 11:24 pm
Posts: 7
3 entity class:
PoliceStation -> Archive -> Policeman
The 2 relations are both "one-to-many".

Junit console:
Code:
.[INFO] Environment - -Hibernate 2.0.3
[INFO] Environment - -loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=org.gjt.mm.mysql.Driver, hibernate.cglib.use_reflection_optimizer=true, hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.jdbc.batch_size=0, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.query.imports=net.sf.hibernate.test, net.sf.hibernate.eg, hibernate.proxool.pool_alias=pool1, hibernate.connection.username=root, hibernate.connection.url=jdbc:mysql://localhost:3306/ps2003, hibernate.show_sql=true, hibernate.connection.provider_class=net.sf.hibernate.connection.DriverManagerConnectionProvider, hibernate.connection.password=, hibernate.statement_cache.size=25, hibernate.connection.pool_size=1}
[INFO] Environment - -using java.io streams to persist binary types
[INFO] Environment - -using CGLIB reflection optimizer
[INFO] Environment - -JVM proxy support: true
[INFO] Configuration - -Mapping resource: net/muziq/ps2003/entity/PoliceStation.hbm.xml
[INFO] Binder - -Mapping class: net.muziq.ps2003.entity.PoliceStation -> PoliceStation
[WARN] Binder - -Attribute "order-by" ignored in JDK1.3 or less
[INFO] Configuration - -Mapping resource: net/muziq/ps2003/entity/Archive.hbm.xml
[INFO] Binder - -Mapping class: net.muziq.ps2003.entity.Archive -> Archive
[INFO] Configuration - -Mapping resource: net/muziq/ps2003/entity/Policeman.hbm.xml
[INFO] Binder - -Mapping class: net.muziq.ps2003.entity.Policeman -> Policeman
[INFO] Configuration - -processing one-to-many association mappings
[INFO] Binder - -Mapping collection: net.muziq.ps2003.entity.PoliceStation.archives -> Archive
[INFO] Binder - -Mapping collection: net.muziq.ps2003.entity.Archive.policemen -> Policeman
[INFO] Configuration - -processing foreign key constraints
[INFO] SessionFactoryImpl - -building session factory
[INFO] Dialect - -Using dialect: net.sf.hibernate.dialect.MySQLDialect
[INFO] ConnectionProviderFactory - -Initializing connection provider: net.sf.hibernate.connection.DriverManagerConnectionProvider
[INFO] DriverManagerConnectionProvider - -Hibernate connection pool size: 1
[INFO] DriverManagerConnectionProvider - -using driver: org.gjt.mm.mysql.Driver at URL: jdbc:mysql://localhost:3306/ps2003
[INFO] DriverManagerConnectionProvider - -connection properties: {user=root, password=}
[INFO] PreparedStatementCache - -prepared statement cache size: 25
[INFO] SessionFactoryImpl - -Use outer join fetching: true
[INFO] SessionFactoryImpl - -Use scrollable result sets: true
[INFO] SessionFactoryImpl - -echoing all SQL to stdout
E
Time: 17.665
There was 1 error:
1) testAddPoliceStation(net.muziq.ps2003.entity.BussinessFacadeTest)java.lang.AbstractMethodError: net/sf/hibernate/persister/AbstractEntityPersister.insert
   at net.sf.hibernate.loader.OuterJoinLoader.walkClassTree(OuterJoinLoader.java:172)
   at net.sf.hibernate.loader.OuterJoinLoader.walkTree(OuterJoinLoader.java:74)
   at net.sf.hibernate.loader.OneToManyLoader.<init>(OneToManyLoader.java:57)
   at net.sf.hibernate.collection.CollectionPersister.createCollectionQuery(CollectionPersister.java:277)
   at net.sf.hibernate.collection.CollectionPersister.<init>(CollectionPersister.java:268)
   at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216)
   at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:627)
   at net.muziq.ps2003.BussinessFacade.getNewSession(BussinessFacade.java:82)
   at net.muziq.ps2003.BussinessFacade.addPoliceStation(BussinessFacade.java:34)
   at net.muziq.ps2003.entity.BussinessFacadeTest.testAddPoliceStation(BussinessFacadeTest.java:19)
   at com.intellij.rt.execution.junit.TextTestRunner.main(TextTestRunner.java:12)

FAILURES!!!
Tests run: 1,  Failures: 0,  Errors: 1



PoliceStation.hbm.xml
Code:
<hibernate-mapping>
    <class name="net.muziq.ps2003.entity.PoliceStation">
        <id type="java.lang.String">
            <generator class="hilo"/>
        </id>
        <set name="archives" lazy="true" inverse="true" cascade="all" order-by="year desc">
            <key column="policeStation"/>
            <one-to-many class="net.muziq.ps2003.entity.Archive"/>
        </set>
    </class>
</hibernate-mapping>


Archive.hbm.xml
Code:
<hibernate-mapping>
    <class name="net.muziq.ps2003.entity.Archive">
        <id type="java.lang.String">
            <generator class="hilo"/>
        </id>
        <many-to-one name="policeStation" class="net.muziq.ps2003.entity.PoliceStation"/>
        <set name="policemen" lazy="true" inverse="true" cascade="all">
            <key column="archive"/>
            <one-to-many class="net.muziq.ps2003.entity.Policeman"/>
        </set>
        <property name="year" type="java.lang.Integer"/>
        <property name="name" type="java.lang.String"/>
    </class>
</hibernate-mapping>


Policeman.hbm.xml
Code:
<hibernate-mapping>
    <class name="net.muziq.ps2003.entity.Policeman">
        <id type="java.lang.String">
            <generator class="hilo"/>
        </id>
        <many-to-one name="archive" class="net.muziq.ps2003.entity.Archive"/>
    </class>
</hibernate-mapping>


Need your help!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 12, 2003 3:14 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
This is an FAQ: Rebuild hibernate.jar from source.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 12, 2003 4:09 am 
Newbie

Joined: Sat Oct 11, 2003 11:24 pm
Posts: 7
Yes! That's it!
Thank you, christian!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.