-->
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: SessionFactory is null. Please help
PostPosted: Tue Apr 19, 2005 5:23 am 
Regular
Regular

Joined: Fri Feb 25, 2005 3:02 am
Posts: 71
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)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 20, 2005 10:28 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
<!-- Upgrade grammar from Hibernate2 to Hibernate3 -->
<replace dir="${generated.home}">
<include name="**/*.hbm.xml"/>
<replacefilter token="readonly=" value="inverse="/>
<replacefilter token="role=" value="name="/>
<replacefilter
token="-//Hibernate/Hibernate Mapping DTD 2.0//EN"
value="-//Hibernate/Hibernate Mapping DTD 3.0//EN"
/>
<replacefilter token="hibernate-mapping-2.0.dtd" value="hibernate-mapping-3.0.dtd"/>
</replace>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 21, 2005 12:56 am 
Regular
Regular

Joined: Fri Feb 25, 2005 3:02 am
Posts: 71
Thanks for the reply. it works


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.