I got a nullPointer Exception when I do the following:
sessionFactory = configuration.buildSessionFactory();
Can anyone please help me. solve my problem. my hibernate.cfg.xml file has been generated successfully using ant. Am working with hibernate 3.0. But my hibernate.cfg.xml file contains the following line:
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
How to tell ant to take hibernate-configuration-3.0.dtd??
This is the msg from Jonas console:
2005-04-19 13:18:46,604 : Environment.<clinit> : Hibernate 3.0
2005-04-19 13:18:46,620 : Environment.<clinit> : hibernate.properties not found
2005-04-19 13:18:46,636 : Environment.<clinit> : using CGLIB reflection optimizer
2005-04-19 13:18:46,636 : Environment.<clinit> : using JDK 1.4 java.sql.Timestamp handling
2005-04-19 13:18:47,167 : Configuration.configure : configuring from resource: /hibernate.cfg.xml
2005-04-19 13:18:47,167 : Configuration.getConfigurationInputStream : Configuration resource: /hibernate.cfg.xml
2005-04-19 13:18:48,573 : Configuration.addResource : Mapping resource: org/objectweb/alarm/beans/GlopUser.hbm.xml
2005-04-19 13:18:51,464 : HbmBinder.bindRootPersistentClassCommonValues : Mapping class: org.objectweb.alarm.beans.GlopUser -> glop_user
2005-04-19 13:18:51,604 : Configuration.addResource : Mapping resource: org/objectweb/alarm/beans/AlarmData.hbm.xml
2005-04-19 13:18:54,089 : HbmBinder.bindRootPersistentClassCommonValues : Mapping class: org.objectweb.alarm.beans.AlarmData -> alarm_data
2005-04-19 13:18:54,104 : Configuration.doConfigure : Configured SessionFactory: null
2005-04-19 13:18:54,276 : Dialect.<init> : Using dialect: org.hibernate.dialect.PostgreSQLDialect
2005-04-19 13:18:54,651 : NamingHelper.getInitialContext : JNDI InitialContext properties:{}
2005-04-19 13:18:54,698 : DatasourceConnectionProvider.configure : Using datasource: jdbc_hibernate
2005-04-19 13:18:54,698 : SchemaUpdate.execute : Running hbm2ddl schema update
2005-04-19 13:18:54,698 : SchemaUpdate.execute : fetching database metadata
2005-04-19 13:18:55,604 : SchemaUpdate.execute : updating schema
2005-04-19 13:18:56,276 : Configuration.secondPassCompile : processing extends queue
2005-04-19 13:18:56,276 : Configuration.secondPassCompile : processing collection mappings
2005-04-19 13:18:56,276 : Configuration.secondPassCompile : processing association property references
2005-04-19 13:18:56,292 : Configuration.secondPassCompile : processing foreign key constraints
2005-04-19 13:18:56,589 : TableMetadata.<init> : table found: public.alarm_data
2005-04-19 13:19:00,479 : TableMetadata.<init> : columns: [device, message, state, date, count, id]
2005-04-19 13:19:00,479 : TableMetadata.<init> : foreign keys: []
2005-04-19 13:19:00,479 : TableMetadata.<init> : indexes: [alarm_data_pkey]
2005-04-19 13:19:00,636 : TableMetadata.<init> : table found: public.glop_user
2005-04-19 13:19:02,683 : TableMetadata.<init> : columns: [password, login, isdeleted, datecreated, id]
2005-04-19 13:19:02,683 : TableMetadata.<init> : foreign keys: []
2005-04-19 13:19:02,683 : TableMetadata.<init> : indexes: [glop_user_pkey]
2005-04-19 13:19:02,948 : SchemaUpdate.execute : schema update complete
PRE-CONFIGURE
2005-04-19 13:19:03,776 : Configuration.secondPassCompile : processing extends queue
2005-04-19 13:19:03,792 : Configuration.secondPassCompile : processing collection mappings
2005-04-19 13:19:03,792 : Configuration.secondPassCompile : processing association property references
2005-04-19 13:19:03,792 : Configuration.secondPassCompile : processing foreign key constraints
2005-04-19 13:19:03,808 : Dialect.<init> : Using dialect: org.hibernate.dialect.PostgreSQLDialect
2005-04-19 13:19:03,823 : SettingsFactory.buildSettings : Default batch fetch size: 1
2005-04-19 13:19:03,839 : SettingsFactory.buildSettings : Generate SQL with comments: disabled
2005-04-19 13:19:03,839 : SettingsFactory.buildSettings : Order SQL updates by primary key: disabled
2005-04-19 13:19:03,854 : SettingsFactory.createQueryTranslatorFactory : Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
2005-04-19 13:19:03,870 : ASTQueryTranslatorFactory.<init> : Using ASTQueryTranslatorFactory
2005-04-19 13:19:07,151 : SettingsFactory.buildSettings : Query language substitutions: {}
2005-04-19 13:19:07,151 : NamingHelper.getInitialContext : JNDI InitialContext properties:{}
2005-04-19 13:19:07,167 : DatasourceConnectionProvider.configure : Using datasource: jdbc_hibernate
2005-04-19 13:19:07,167 : SettingsFactory.buildSettings : JDBC batch size: 15
2005-04-19 13:19:07,167 : SettingsFactory.buildSettings : JDBC batch updates for versioned data: disabled
2005-04-19 13:19:07,183 : SettingsFactory.buildSettings : Scrollable result sets: enabled
2005-04-19 13:19:07,183 : SettingsFactory.buildSettings : JDBC3 getGeneratedKeys(): disabled
2005-04-19 13:19:07,198 : TransactionFactoryFactory.buildTransactionFactory : Using default transaction strategy (direct JDBC transactions)
2005-04-19 13:19:07,229 : TransactionManagerLookupFactory.getTransactionManagerLookup : No TransactionManagerLookup configured (in JTA envir
onment, use of read-write or transactional second-level cache is not recommended)
2005-04-19 13:19:07,229 : SettingsFactory.buildSettings : Automatic flush during beforeCompletion(): disabled
2005-04-19 13:19:07,229 : SettingsFactory.buildSettings : Automatic session close at end of transaction: disabled
2005-04-19 13:19:07,229 : SettingsFactory.createCacheProvider : Cache provider: org.hibernate.cache.EhCacheProvider
2005-04-19 13:19:07,276 : SettingsFactory.buildSettings : Second-level cache: enabled
2005-04-19 13:19:07,276 : SettingsFactory.buildSettings : Optimize cache for minimal puts: disabled
2005-04-19 13:19:07,276 : SettingsFactory.buildSettings : Structured second-level cache entries: enabled
2005-04-19 13:19:07,276 : SettingsFactory.buildSettings : Query cache: disabled
2005-04-19 13:19:07,276 : SettingsFactory.buildSettings : Statistics: disabled
2005-04-19 13:19:09,495 : SettingsFactory.buildSettings : Deleted entity synthetic identifier rollback: disabled
2005-04-19 13:19:09,495 : SettingsFactory.buildSettings : Default entity-mode: pojo
2005-04-19 13:19:09,839 : JFactory.postInvoke : system exception in business method:
java.lang.NullPointerException
at org.objectweb.alarm.beans.SessionTataBean.createUser(Unknown Source)
at org.objectweb.alarm.beans.JOnASSessionTata437579213Remote.createUser(JOnASSessionTata437579213Remote.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at org.objectweb.carol.rmi.jrmp.server.JUnicastServerRef.runDispatch(JUnicastServerRef.java:160)
at org.objectweb.carol.rmi.jrmp.server.JUnicastServerRef.dispatch(JUnicastServerRef.java:145)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)
|