i am trying to execute one example using hibernate my database is microsoft sql server and database driver is freetds, eclipse ide
i am not able to create connection pool while connection is being created as i have seen through profiler, second how to generate ide,
this is my log,
19:01:54,921 INFO Environment:462 - Hibernate 2.1.2
19:01:54,953 INFO Environment:496 - loaded properties from resource hibernate.properties: {hibernate.dbcp.ps.maxIdle=100, hibernate.dbcp.ps.whenExhaustedAction=1, hibernate.dbcp.whenExhaustedAction=1, hibernate.dbcp.ps.maxWait=120000, hibernate.connection.driver_class=com.internetcds.jdbc.tds.Driver, hibernate.default_schema=adminp, hibernate.cglib.use_reflection_optimizer=true, hibernate.dialect=net.sf.hibernate.dialect.SQLServerDialect, hibernate.dbcp.maxIdle=10, hibernate.dbcp.maxWait=120000, hibernate.dbcp.maxActive=100, hibernate.connection.username=adminp, hibernate.connection.url=jdbc:freetds:sqlserver://192.168.1.6/hibernate;TDS=4.2, hibernate.show_sql=true, hibernate.connection.password=990101, hibernate.dbcp.ps.maxActive=100, hibernate.connection.pool_size=1}
19:01:54,953 INFO Environment:519 - using CGLIB reflection optimizer
19:01:54,953 INFO Configuration:329 - Mapping resource: dbdemo/User.hbm.xml
19:01:55,656 INFO Binder:229 - Mapping class: dbdemo.User -> Users
19:01:55,781 INFO Binder:547 - Mapping collection: dbdemo.User.books -> Book_User_Link
19:01:55,796 INFO Configuration:329 - Mapping resource: dbdemo/Contact.hbm.xml
19:01:55,843 INFO Binder:229 - Mapping class: dbdemo.Contact -> Contacts
19:01:55,843 INFO Configuration:329 - Mapping resource: dbdemo/Book.hbm.xml
19:01:55,890 INFO Binder:229 - Mapping class: dbdemo.Book -> Books
19:01:55,906 INFO Binder:547 - Mapping collection: dbdemo.Book.users -> Book_User_Link
19:01:55,906 INFO Configuration:329 - Mapping resource: dbdemo/Address.hbm.xml
19:01:55,953 INFO Binder:229 - Mapping class: dbdemo.Address -> Address2
19:01:55,953 INFO Configuration:595 - processing one-to-many association mappings
19:01:55,953 INFO Binder:1154 - Mapping collection: dbdemo.User.contacts -> Contacts
19:01:55,953 INFO Configuration:604 - processing one-to-one association property references
19:01:55,953 INFO Configuration:629 - processing foreign key constraints
19:01:55,984 INFO Dialect:82 - Using dialect: net.sf.hibernate.dialect.SQLServerDialect
19:01:55,984 INFO SettingsFactory:62 - Use outer join fetching: true
19:01:56,000 INFO DBCPConnectionProvider:56 - DBCP using driver: com.internetcds.jdbc.tds.Driver at URL: jdbc:freetds:sqlserver://192.168.1.6/hibernate;TDS=4.2
19:01:56,000 INFO DBCPConnectionProvider:57 - Connection properties: {user=adminp, password=990101}
19:01:56,046 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
19:01:56,343 WARN SettingsFactory:95 - Could not obtain connection metadata
org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted, cause:
java.util.NoSuchElementException: Could not create a validated object
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:851)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:140)
at net.sf.hibernate.connection.DBCPConnectionProvider.getConnection(DBCPConnectionProvider.java:41)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1119)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:748)
at dbdemo.HibernateDemo.run(HibernateDemo.java:61)
at dbdemo.HibernateDemo.main(HibernateDemo.java:30)
19:01:56,343 INFO SettingsFactory:102 - Use scrollable result sets: false
19:01:56,343 INFO SettingsFactory:105 - Use JDBC3 getGeneratedKeys(): false
19:01:56,343 INFO SettingsFactory:108 - Optimize cache for minimal puts: false
19:01:56,343 INFO SettingsFactory:111 - Default schema set to: adminp
19:01:56,343 INFO SettingsFactory:114 - echoing all SQL to stdout
19:01:56,343 INFO SettingsFactory:117 - Query language substitutions: {}
19:01:56,343 INFO SettingsFactory:128 - cache provider: net.sf.ehcache.hibernate.Provider
19:01:56,359 INFO Configuration:1080 - instantiating and configuring caches
19:01:56,500 INFO SessionFactoryImpl:119 - building session factory
MappingException could not instantiate id generator
java.lang.NullPointerException
at dbdemo.HibernateDemo.run(HibernateDemo.java:168)
at dbdemo.HibernateDemo.main(HibernateDemo.java:30)
Exception in thread "main"
|