My Swing application under eclipse using MySQL cannot create a session factory.
I have used the helloworld from the "Java Persistence with Hibernate " book as a guideline for placing and configuring classes, mapping files and hibernate.cfg.xml.
If I open the hibernate configuration in the eclipse hibernate configurations view, the Java domain code of the Java mapping classes shows OK under Configuration (I see all three classes), however SessionFactory shows "<SessionFactory Error: Entity class not found: Sound> while the example helloworld shows OK in sessionfactory
In the "database" branch of the tree, my database shows OK
If I run my application it cannot create a SessionFactory.
The listing
15:57:55,110 INFO Configuration:1547 - Configured SessionFactory: null
shows that there is no session factory. I used exactly the same HibernateUtil as in the HelloWorld example.
I'm getting lost in struggling with this, the only time I got it to work is when I put everything (all mapped Java classes) in the root.
I have exported a build jar containing everythin in the output bin root directory, this doesn't help either.
Any hint is appreciated
see console output below
thx
leo
15:57:54,704 INFO Environment:514 - Hibernate 3.2.6
15:57:54,704 INFO Environment:532 - loaded properties from resource hibernate.properties: {hibernate.bytecode.use_reflection_optimizer=false}
15:57:54,719 INFO Environment:681 - Bytecode provider name : cglib
15:57:54,719 INFO Environment:598 - using JDK 1.4 java.sql.Timestamp handling
15:57:54,766 INFO Configuration:1432 - configuring from resource: /hibernate.cfg.xml
15:57:54,766 INFO Configuration:1409 - Configuration resource: /hibernate.cfg.xml
15:57:54,938 INFO Configuration:559 - Reading mappings from resource : soundz/Sound.hbm.xml
15:57:55,016 INFO HbmBinder:300 - Mapping class: Sound -> sound
15:57:55,032 INFO Configuration:559 - Reading mappings from resource : soundz/Workorder.hbm.xml
15:57:55,047 INFO HbmBinder:300 - Mapping class: Workorder -> workorder
15:57:55,110 INFO Configuration:559 - Reading mappings from resource : soundz/Card.hbm.xml
15:57:55,110 INFO HbmBinder:300 - Mapping class: Card -> card
15:57:55,110 INFO Configuration:1547 - Configured SessionFactory: null
15:57:55,125 INFO HbmBinder:2382 - Mapping collection: Sound.workorders -> workorder
15:57:55,125 INFO HbmBinder:2382 - Mapping collection: Card.workorders -> workorder
15:57:55,125 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
15:57:55,125 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 20
15:57:55,125 INFO DriverManagerConnectionProvider:45 - autocommit mode: false
15:57:55,141 INFO DriverManagerConnectionProvider:80 - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/soundz
15:57:55,141 INFO DriverManagerConnectionProvider:86 - connection properties: {user=soundz, password=****}
15:57:55,391 INFO SettingsFactory:89 - RDBMS: MySQL, version: 5.0.51a-community-nt
15:57:55,391 INFO SettingsFactory:90 - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.6 ( Revision: ${svn.Revision} )
15:57:55,407 INFO Dialect:152 - Using dialect: org.hibernate.dialect.MySQL5Dialect
15:57:55,422 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)
15:57:55,422 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
15:57:55,422 INFO SettingsFactory:143 - Automatic flush during beforeCompletion(): disabled
15:57:55,422 INFO SettingsFactory:147 - Automatic session close at end of transaction: disabled
15:57:55,422 INFO SettingsFactory:154 - JDBC batch size: 15
15:57:55,422 INFO SettingsFactory:157 - JDBC batch updates for versioned data: disabled
15:57:55,422 INFO SettingsFactory:162 - Scrollable result sets: enabled
15:57:55,422 INFO SettingsFactory:170 - JDBC3 getGeneratedKeys(): enabled
15:57:55,422 INFO SettingsFactory:178 - Connection release mode: auto
15:57:55,422 INFO SettingsFactory:202 - Maximum outer join fetch depth: 2
15:57:55,422 INFO SettingsFactory:205 - Default batch fetch size: 1
15:57:55,422 INFO SettingsFactory:209 - Generate SQL with comments: disabled
15:57:55,422 INFO SettingsFactory:213 - Order SQL updates by primary key: disabled
15:57:55,422 INFO SettingsFactory:217 - Order SQL inserts for batching: disabled
15:57:55,422 INFO SettingsFactory:386 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
15:57:55,422 INFO ASTQueryTranslatorFactory:24 - Using ASTQueryTranslatorFactory
15:57:55,422 INFO SettingsFactory:225 - Query language substitutions: {}
15:57:55,422 INFO SettingsFactory:230 - JPA-QL strict compliance: disabled
15:57:55,422 INFO SettingsFactory:235 - Second-level cache: enabled
15:57:55,422 INFO SettingsFactory:239 - Query cache: disabled
15:57:55,422 INFO SettingsFactory:373 - Cache provider: org.hibernate.cache.NoCacheProvider
15:57:55,422 INFO SettingsFactory:254 - Optimize cache for minimal puts: disabled
15:57:55,422 INFO SettingsFactory:263 - Structured second-level cache entries: disabled
15:57:55,422 INFO SettingsFactory:290 - Statistics: disabled
15:57:55,422 INFO SettingsFactory:294 - Deleted entity synthetic identifier rollback: disabled
15:57:55,422 INFO SettingsFactory:309 - Default entity-mode: pojo
15:57:55,422 INFO SettingsFactory:313 - Named query checking : enabled
15:57:55,454 INFO SessionFactoryImpl:161 - building session factory
Exception in thread "main" java.lang.ExceptionInInitializerError
at control.HibernateUtil.<clinit>(HibernateUtil.java:15)
at test.FiTest.main(FiTest.java:43)
|