The whole setup used to work fine before I migrated the app.
I tried debugging it and found that the session factory is not instatiating.
sessionFactory = configuration.configure().buildSessionFactory();
The above returns a null reference.
I followed the migration guide and did everything by the book.But cant seem to figure out whats going on.
any help would be greatly appreciated.
Hibernate version:3.05
Mapping documents:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory >
<property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="connection.url">jdbc:hsqldb:hsql://localhost/mustang</property>
<property name="connection.username">sa</property>
<property name="connection.password"></property>
<property name="connection.pool_size">5</property>
<!--<property name="connection.datasource">java:/mustang</property>-->
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.HSQLDialect</property>
<property name="hibernate.max_fetch_depth">2</property>
<!-- Mapping files -->
<mapping resource="my/app/domain/RoleLookup.hbm.xml"/>
<mapping resource="my/app/domain/UserProfile.hbm.xml"/>
<mapping resource="my/app/domain/Shipment.hbm.xml"/>
<mapping resource="my/app/domain/CodeLibrary.hbm.xml"/>
<mapping resource="my/app/domain/ValueSet.hbm.xml"/>
<mapping resource="my/app/domain/Sample.hbm.xml"/>
<mapping resource="my/app/domain/SampleAdditionalIdentifier.hbm.xml"/>
<mapping resource="my/app/domain/Subject.hbm.xml"/>
<mapping resource="my/app/domain/Event.hbm.xml"/>
<mapping resource="my/app/domain/ValueSetCode.hbm.xml"/>
<mapping resource="my/app/domain/Job.hbm.xml"/>
</session-factory>
</hibernate-configuration>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="my.app.domain.Subject" table="SUBJECT">
<id name="subjectUid" column="SUBJECT_UID" type="java.lang.Long">
<generator class="native"/>
</id>
<timestamp column="_MODIFY_ON" name="ModifyOn"/>
<property name="subjectIdentifier" column="SUBJECT_IDENTIFIER"
type="java.lang.String" length="20" not-null="true"/>
<property name="ActiveFlag" column="_ACTIVE_FLAG"
type="yes_no" length="1" not-null="true"/>
<property name="subjectInternalIdentifier"
column="SUBJECT_INTERNAL_IDENTIFIER" type="java.lang.String"
length="20"/>
<property name="Source" column="_SOURCE" type="java.lang.String"
length="100"/>
<!-- associations -->
<many-to-one name="ModifiedBy" column="_MODIFIED_BY"
class="my.app.domain.UserProfile" cascade="none"/>
<many-to-one name="subjectType" column="SUBJECT_TYPE_UID"
class="my.app.domain.CodeLibrary" cascade="none"/>
<!-- subclasses -->
<joined-subclass name="my.app.domain.WaterSubject"
table="WATER_SUBJECT">
<key column="SUBJECT_UID"/>
<property name="description" column="DESCRIPTION"
type="java.lang.String" length="2000"/>
<property name="addressLine1" column="ADDRESS_LINE_1"
type="java.lang.String" length="100"/>
<property name="addressLine2" column="ADDRESS_LINE_2"
type="java.lang.String" length="100"/>
<property name="city" column="CITY" type="java.lang.String"
length="80"/>
<property name="zip" column="ZIP_CODE" type="java.lang.String"
length="20"/>
<many-to-one name="state" column="STATE_UID"
class="my.app.domain.CodeLibrary" cascade="none"/>
</joined-subclass>
<joined-subclass name="my.app.domain.FoodSubject"
table="FOOD_SUBJECT">
<key column="SUBJECT_UID"/>
<property name="description" column="DESCRIPTION"
type="java.lang.String" length="2000"/>
</joined-subclass>
<joined-subclass name="my.app.domain.EnvironmentalSubject"
table="ENVIRONMENTAL_SUBJECT">
<key column="SUBJECT_UID"/>
<property name="locationName" column="LOCATION_NAME"
type="java.lang.String" length="120"/>
<property name="locationAddressLine1"
column="LOCATION_ADDRESS_LINE_1" type="java.lang.String"
length="100"/>
<property name="locationAddressLine2"
column="LOCATION_ADDRESS_LINE_2" type="java.lang.String"
length="100"/>
<property name="locationCity" column="LOCATION_CITY"
type="java.lang.String" length="80"/>
<property name="locationZipCode" column="LOCATION_ZIP_CODE"
type="java.lang.String" length="20"/>
<property name="locationDetail" column="LOCATION_DETAIL"
type="java.lang.String" length="2000"/>
<many-to-one name="locationState" column="LOCATION_STATE_UID"
class="my.app.domain.CodeLibrary" cascade="none"/>
</joined-subclass>
<joined-subclass name="my.app.domain.ClinicalSubject" table="CLINICAL_SUBJECT">
<key column="SUBJECT_UID"/>
<property name="personNamePrefix" column="PERSON_NAME_PREFIX" type="java.lang.String" length="20"/>
<property name="personFirstName" column="PERSON_FIRST_NAME" type="java.lang.String" length="40"/>
<property name="dateOfBirth" column="DATE_OF_BIRTH" type="java.util.Date"/>
<property name="personLastName" column="PERSON_LAST_NAME" type="java.lang.String" length="40"/>
<property name="addressLine1" column="ADDRESS_LINE_1" type="java.lang.String" length="100"/>
<property name="addressLine2" column="ADDRESS_LINE_2" type="java.lang.String" length="100"/>
<property name="city" column="CITY" type="java.lang.String" length="80"/>
<property name="zipCode" column="ZIP_CODE" type="java.lang.String" length="20"/>
<property name="personNameSuffix" column="PERSON_NAME_SUFFIX" type="java.lang.String" length="20"/>
<property name="personMiddleName" column="PERSON_MIDDLE_NAME" type="java.lang.String" length="40"/>
<property name="deidentifyFlag" column="DEIDENTIFY_FLAG" type="yes_no" length="1"/>
<many-to-one name="state" column="STATE_UID" class="my.app.domain.CodeLibrary" cascade="none"/>
<many-to-one name="gender" column="GENDER_UID" class="my.app.domain.CodeLibrary" cascade="none"/>
<many-to-one name="deathIndicator" column="DEATH_INDICATOR_UID" class="my.app.domain.CodeLibrary" cascade="none"/>
</joined-subclass>
<joined-subclass name="my.app.domain.AnimalSubject"
table="ANIMAL_SUBJECT">
<key column="SUBJECT_UID"/>
<property name="animalName" column="ANIMAL_NAME"
type="java.lang.String" length="100"/>
<property name="animalDateOfBirth" column="ANIMAL_DATE_OF_BIRTH"
type="java.util.Date"/>
<property name="ownerNamePrefix" column="OWNER_NAME_PREFIX"
type="java.lang.String" length="20"/>
<property name="ownerLastName" column="OWNER_LAST_NAME"
type="java.lang.String" length="40"/>
<property name="ownerNameSuffix" column="OWNER_NAME_SUFFIX"
type="java.lang.String" length="20"/>
<property name="ownerAddressLine1" column="OWNER_ADDRESS_LINE_1"
type="java.lang.String" length="100"/>
<property name="ownerAddressLine2" column="OWNDER_ADDRESS_LINE_2"
type="java.lang.String" length="100"/>
<property name="ownerCity" column="OWNER_CITY"
type="java.lang.String" length="80"/>
<property name="ownerZipCode" column="OWNER_ZIP_CODE"
type="java.lang.String" length="20"/>
<property name="comments" column="COMMENTS" type="java.lang.String"
length="2000"/>
<property name="ownerMiddleName" column="OWNER_MIDDLE_NAME"
type="java.lang.String" length="40"/>
<property name="ownerFirstName" column="OWNER_FIRST_NAME"
type="java.lang.String" length="40"/>
<property name="animalTypeOtherText"
column="ANIMAL_TYPE_OTHER_TEXT" type="java.lang.String"
length="100"/>
<property name="deidentifyFlag" column="DEIDENTIFY_FLAG"
type="yes_no" length="1"/>
<many-to-one name="animalType" column="ANIMAL_TYPE_UID"
class="my.app.domain.CodeLibrary" cascade="none"/>
<many-to-one name="ownerState" column="OWNER_STATE_UID"
class="my.app.domain.CodeLibrary" cascade="none"/>
</joined-subclass>
<joined-subclass name="my.app.domain.BioWatchLocation"
table="BIOWATCH_LOCATION">
<key column="SUBJECT_UID"/>
<property name="groupingInformation" column="GROUPING_INFORMATION"
type="java.lang.String" length="255"/>
<property name="gpsLatitude" column="GPS_LATITUDE"
type="java.lang.String" length="20"/>
<property name="gpsLongitude" column="GPS_LONGITUDE"
type="java.lang.String" length="20"/>
<property name="location" column="LOCATION" type="java.lang.String"
length="255"/>
<property name="zip" column="ZIP" type="java.lang.String"
length="20"/>
<property name="sensorCorrespondence"
column="SENSOR_CORRESPONDENCE" type="java.lang.String"
length="255"/>
<many-to-one name="biowatchCity" column="BIOWATCH_CITY_UID"
class="my.app.domain.CodeLibrary" cascade="none"/>
</joined-subclass>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
package my.app.dao;
import org.apache.commons.logging.*;
import org.hibernate.classic.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.HibernateException;
import org.hibernate.Interceptor;
import org.hibernate.cfg.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
//import net.sf.hibernate.*;
//import net.sf.hibernate.cfg.Configuration;
//import org.apache.commons.logging.*;
/**
* Basic Hibernate helper class, handles SessionFactory, Session and Transaction.
* <p>
* Uses a static initializer for the initial SessionFactory creation
* and holds Session and Transactions in thread local variables. All
* exceptions are wrapped in an unchecked DaoException.
*
* @author
christian@hibernate.org
*/
public class HibernateUtil {
private static Log log = LogFactory.getLog(HibernateUtil.class);
private static Configuration configuration;
private static SessionFactory sessionFactory;
private static final ThreadLocal threadSession = new ThreadLocal();
private static final ThreadLocal threadTransaction = new ThreadLocal();
private static final ThreadLocal threadInterceptor = new ThreadLocal();
// Create the initial SessionFactory from the default configuration files
static {
try {
configuration = new Configuration();
sessionFactory = configuration.configure().buildSessionFactory();
//log.info("Create session factory"+sessionFactory.getCurrentSession().isConnected());
//sessionFactory = new Configuration().configure().buildSessionFactory();
// We could also let Hibernate bind it to JNDI:
// configuration.configure().buildSessionFactory()
} catch (Throwable ex) {
// We have to catch Throwable, otherwise we will miss
// NoClassDefFoundError and other subclasses of Error
log.fatal("Building SessionFactory failed.", ex);
//commented to allow for unit testing
//throw new ExceptionInInitializerError(ex);
}
}
/**
* Returns the SessionFactory used for this static class.
*
* @return SessionFactory
*/
public static SessionFactory getSessionFactory() {
// Instead of a static variable, use JNDI:
// SessionFactory sessions = null;
// try {
// Context ctx = new InitialContext();
// String jndiName = "java:hibernate/HibernateFactory";
// sessions = (SessionFactory)ctx.lookup(jndiName);
// } catch (NamingException ex) {
// throw new DaoException(ex);
// }
// return sessions;
return sessionFactory;
}
/**
* Returns the original Hibernate configuration.
*
* @return Configuration
*/
public static Configuration getConfiguration() {
return configuration;
}
/**
* Rebuild the SessionFactory with the static Configuration.
*
*/
public static void rebuildSessionFactory()
throws DaoException {
synchronized(sessionFactory) {
try {
sessionFactory = getConfiguration().buildSessionFactory();
} catch (Exception ex) {
throw new DaoException(ex);
}
}
}
/**
* Rebuild the SessionFactory with the given Hibernate Configuration.
*
* @param cfg
*/
public static void rebuildSessionFactory(Configuration cfg)
throws DaoException {
try {
sessionFactory = cfg.buildSessionFactory();
configuration = cfg;
} catch (Exception ex) {
throw new DaoException(ex);
}
}
/**
* Retrieves the current Session local to the thread.
* <p/>
* If no Session is open, opens a new Session for the running thread.
*
* @return Session
*/
public static Session getSession()
throws DaoException {
Session s = (Session) threadSession.get();
try {
if (s == null) {
log.debug("Opening new Session for this thread.");
if (getInterceptor() != null) {
log.debug("Using interceptor: " + getInterceptor().getClass());
s = getSessionFactory().openSession(getInterceptor());
} else {
s = getSessionFactory().openSession();
}
threadSession.set(s);
}
} catch (HibernateException ex) {
throw new DaoException(ex);
}
return s;
}
/**
* Closes the Session local to the thread.
*/
public static void closeSession()
throws DaoException {
try {
Session s = (Session) threadSession.get();
threadSession.set(null);
if (s != null && s.isOpen()) {
log.debug("Closing Session of this thread.");
s.close();
}
} catch (HibernateException ex) {
throw new DaoException(ex);
}
}
/**
* Start a new database transaction.
*/
public static void beginTransaction()
throws DaoException {
Transaction tx = (Transaction) threadTransaction.get();
try {
if (tx == null) {
log.debug("Starting new database transaction in this thread.");
tx = getSession().beginTransaction();
threadTransaction.set(tx);
}
} catch (HibernateException ex) {
throw new DaoException(ex);
}
}
/**
* Commit the database transaction.
*/
public static void commitTransaction()
throws DaoException {
Transaction tx = (Transaction) threadTransaction.get();
try {
if ( tx != null && !tx.wasCommitted()
&& !tx.wasRolledBack() ) {
log.debug("Committing database transaction of this thread.");
tx.commit();
}
threadTransaction.set(null);
} catch (HibernateException ex) {
rollbackTransaction();
throw new DaoException(ex);
}
}
/**
* Commit the database transaction.
*/
public static void rollbackTransaction()
throws DaoException {
Transaction tx = (Transaction) threadTransaction.get();
try {
threadTransaction.set(null);
if ( tx != null && !tx.wasCommitted() && !tx.wasRolledBack() ) {
log.debug("Tyring to rollback database transaction of this thread.");
tx.rollback();
}
} catch (HibernateException ex) {
throw new DaoException(ex);
} finally {
closeSession();
}
}
/**
* Reconnects a Hibernate Session to the current Thread.
*
* @param session The Hibernate Session to be reconnected.
*/
public static void reconnect(Session session)
throws DaoException {
try {
session.reconnect();
threadSession.set(session);
} catch (HibernateException ex) {
throw new DaoException(ex);
}
}
/**
* Disconnect and return Session from current Thread.
*
* @return Session the disconnected Session
*/
public static Session disconnectSession()
throws DaoException {
Session session = getSession();
try {
threadSession.set(null);
if (session.isConnected() && session.isOpen())
session.disconnect();
} catch (HibernateException ex) {
throw new DaoException(ex);
}
return session;
}
/**
* Register a Hibernate interceptor with the current thread.
* <p>
* Every Session opened is opened with this interceptor after
* registration. Has no effect if the current Session of the
* thread is already open, effective on next close()/getSession().
*/
public static void registerInterceptor(Interceptor interceptor) {
threadInterceptor.set(interceptor);
}
private static Interceptor getInterceptor() {
Interceptor interceptor =
(Interceptor) threadInterceptor.get();
return interceptor;
}
}
Full stack trace of any exception that occurs:
22:11:52,359 INFO [InternalResourceViewResolver] Cached view 'login'
22:11:52,437 INFO [Engine] StandardContext[/mustang] Velocity [info] ResourceManager : found /login.vm with loader org.apache.velocity.tools.view.servlet.WebappLoader
22:11:52,453 INFO [Engine] StandardContext[/mustang] Velocity [info] ResourceManager : found header.vm with loader org.apache.velocity.tools.view.servlet.WebappLoader
22:11:52,453 INFO [Engine] StandardContext[/mustang] Velocity [info] ResourceManager : found banner.vm with loader org.apache.velocity.tools.view.servlet.WebappLoader
22:11:52,515 INFO [Engine] StandardContext[/mustang] Velocity [error] RHS of #set statement is null. Context will not be modified. banner.vm [line 1, column 1]
22:11:52,531 INFO [Engine] StandardContext[/mustang] Velocity [info] ResourceManager : found footer.vm with loader org.apache.velocity.tools.view.servlet.WebappLoader
22:11:52,687 INFO [Environment] Hibernate 3.0.5
22:11:52,687 INFO [Environment] hibernate.properties not found
22:11:52,703 INFO [Environment] using CGLIB reflection optimizer
22:11:52,703 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
22:11:53,390 INFO [Configuration] configuring from resource: /hibernate.cfg.xml
22:11:53,390 INFO [Configuration] Configuration resource: /hibernate.cfg.xml
22:11:53,437 INFO [Configuration] Mapping resource: my/app/domain/RoleLookup.hbm.xml
22:11:53,843 INFO [HbmBinder] Mapping class: my.app.domain.RoleLookup -> ROLE_LOOKUP
22:11:53,953 INFO [Configuration] Mapping resource: my/app/domain/UserProfile.hbm.xml
22:11:54,031 INFO [HbmBinder] Mapping class: my.app.domain.UserProfile -> USER_PROFILE
22:11:54,468 INFO [HbmBinder] Mapping collection: my.app.domain.UserProfile.programs -> USER_PROGRAM
22:11:54,468 INFO [Configuration] Mapping resource: my/app/domain/Shipment.hbm.xml
22:11:54,640 INFO [HbmBinder] Mapping class: my.app.domain.Shipment -> SHIPMENT
22:11:54,656 INFO [Configuration] Mapping resource: my/app/domain/CodeLibrary.hbm.xml
22:11:54,687 INFO [HbmBinder] Mapping class: my.app.domain.CodeLibrary -> CODE_LIBRARY
22:11:54,687 INFO [Configuration] Mapping resource: my/app/domain/ValueSet.hbm.xml
22:11:54,750 INFO [HbmBinder] Mapping class: my.app.domain.ValueSet -> VALUE_SET
22:11:54,750 INFO [Configuration] Mapping resource: my/app/domain/Sample.hbm.xml
22:11:54,796 INFO [HbmBinder] Mapping class: my.app.domain.Sample -> SAMPLE
22:11:54,953 INFO [HbmBinder] Mapping joined-subclass: my.app.domain.BioWatchSample -> BIOWATCH_SAMPLE
22:11:54,953 INFO [HbmBinder] Mapping joined-subclass: my.app.domain.ClinicalAnimalSample -> CLINICAL_ANIMAL_SAMPLE
22:11:54,953 INFO [HbmBinder] Mapping joined-subclass: my.app.domain.EnvironmentalSample -> ENVIRONMENTAL_SAMPLE
22:11:54,968 INFO [HbmBinder] Mapping joined-subclass: my.app.domain.FoodSample -> FOOD_SAMPLE
22:11:54,968 INFO [HbmBinder] Mapping joined-subclass: my.app.domain.WaterSample -> WATER_SAMPLE
22:11:54,968 INFO [Configuration] Mapping resource: my/app/domain/SampleAdditionalIdentifier.hbm.xml
22:11:55,000 INFO [HbmBinder] Mapping class: my.app.domain.SampleAdditionalIdentifier -> SAMPLE_ADDITIONAL_IDENTIFIER
22:11:55,015 INFO [Configuration] Mapping resource: my/app/domain/Subject.hbm.xml
22:11:55,093 INFO [HbmBinder] Mapping class: my.app.domain.Subject -> SUBJECT
22:11:55,093 INFO [HbmBinder] Mapping joined-subclass: my.app.domain.WaterSubject -> WATER_SUBJECT
22:11:55,109 INFO [HbmBinder] Mapping joined-subclass: my.app.domain.FoodSubject -> FOOD_SUBJECT
22:11:55,109 INFO [HbmBinder] Mapping joined-subclass: my.app.domain.EnvironmentalSubject -> ENVIRONMENTAL_SUBJECT
22:11:55,109 INFO [HbmBinder] Mapping joined-subclass: my.app.domain.ClinicalSubject -> CLINICAL_SUBJECT
22:11:55,109 INFO [HbmBinder] Mapping joined-subclass: my.app.domain.AnimalSubject -> ANIMAL_SUBJECT
22:11:55,125 INFO [HbmBinder] Mapping joined-subclass: my.app.domain.BioWatchLocation -> BIOWATCH_LOCATION
22:11:55,125 INFO [Configuration] Mapping resource: my/app/domain/Event.hbm.xml
22:11:55,187 INFO [HbmBinder] Mapping class: my.app.domain.Event -> EVENT
22:11:55,187 INFO [Configuration] Mapping resource: my/app/domain/ValueSetCode.hbm.xml
22:11:55,265 INFO [HbmBinder] Mapping class: my.app.domain.ValueSetCode -> VALUE_SET_CODE
22:11:55,281 INFO [Configuration] Mapping resource: my/app/domain/Job.hbm.xml
22:11:55,296 INFO [HbmBinder] Mapping class: my.app.domain.Job -> JOB
22:11:55,296 INFO [HbmBinder] Mapping collection: my.app.domain.Job.samples -> JOB_SAMPLE
22:11:55,296 INFO [Configuration] Configured SessionFactory: null
22:11:55,296 INFO [Configuration] processing extends queue
22:11:55,312 INFO [Configuration] processing collection mappings
22:11:55,312 INFO [HbmBinder] Mapping collection: my.app.domain.ValueSet.valueSetCodeRels -> VALUE_SET_CODE
22:11:55,312 INFO [HbmBinder] Mapping collection: my.app.domain.Sample.ids -> SAMPLE_ADDITIONAL_IDENTIFIER
22:11:55,312 INFO [Configuration] processing association property references
22:11:55,312 INFO [Configuration] processing foreign key constraints
22:11:55,343 INFO [DriverManagerConnectionProvider] Using Hibernate built-in connection pool (not for production use!)
22:11:55,343 INFO [DriverManagerConnectionProvider] Hibernate connection pool size: 5
22:11:55,343 INFO [DriverManagerConnectionProvider] autocommit mode: false
22:11:55,359 INFO [STDOUT] DriverManager.initialize: jdbc.drivers = null
22:11:55,359 INFO [STDOUT] JDBC DriverManager initialized
22:11:55,359 INFO [STDOUT] registerDriver: driver[className=org.hsqldb.jdbcDriver,org.hsqldb.jdbcDriver@69b25f]
22:11:55,359 INFO [DriverManagerConnectionProvider] using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:hsql://localhost/mustang
22:11:55,359 INFO [DriverManagerConnectionProvider] connection properties: {user=sa, password=}
22:11:55,359 INFO [STDOUT] DriverManager.getConnection("jdbc:hsqldb:hsql://localhost/mustang")
22:11:55,359 INFO [STDOUT] trying driver[className=org.hsqldb.jdbcDriver,org.hsqldb.jdbcDriver@69b25f]
22:11:55,437 INFO [STDOUT] [Server@119b1ca]: [Thread[HSQLDB Server @119b1ca,5,jboss]]: handleConnection(Socket[addr=/127.0.0.1,port=2683,localport=9001]) entered
22:11:55,437 INFO [STDOUT] [Server@119b1ca]: [Thread[HSQLDB Server @119b1ca,5,jboss]]: handleConnection() exited
22:11:55,453 INFO [STDOUT] [Server@119b1ca]: [Thread[HSQLDB Connection @151e824,5,HSQLDB Connections @119b1ca]]: 0:trying to connect user SA
22:11:55,453 INFO [STDOUT] getConnection returning driver[className=org.hsqldb.jdbcDriver,org.hsqldb.jdbcDriver@69b25f]
22:11:55,453 INFO [STDOUT] [Server@119b1ca]: 0:HSQLCLI:GETSESSIONATTR
22:11:55,453 INFO [STDOUT] [Server@119b1ca]: 0:HSQLCLI:SETSESSIONATTR:AUTOCOMMIT false CONNECTION_READONLY null
22:11:55,484 INFO [STDOUT] [Server@119b1ca]: 0:call "org.hsqldb.Library.getDatabaseProductName"()
22:11:55,515 INFO [STDOUT] [Server@119b1ca]: 0:call "org.hsqldb.Library.getDatabaseMajorVersion"()
22:11:55,515 INFO [STDOUT] [Server@119b1ca]: 0:call "org.hsqldb.Library.getDatabaseProductVersion"()
22:11:55,515 INFO [SettingsFactory] RDBMS: HSQL Database Engine, version: 1.7.2
22:11:55,515 INFO [SettingsFactory] JDBC driver: HSQL Database Engine Driver, version: 1.7.2
22:11:55,687 INFO [Dialect] Using dialect: org.hibernate.dialect.HSQLDialect
22:11:55,734 INFO [TransactionFactoryFactory] Using default transaction strategy (direct JDBC transactions)
22:11:55,765 INFO [TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
22:11:55,765 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled
22:11:55,765 INFO [SettingsFactory] Automatic session close at end of transaction: disabled
22:11:55,765 INFO [SettingsFactory] JDBC batch size: 15
22:11:55,765 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
22:11:55,765 INFO [SettingsFactory] Scrollable result sets: enabled
22:11:55,765 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
22:11:55,765 INFO [SettingsFactory] Connection release mode: null
22:11:55,781 INFO [SettingsFactory] Maximum outer join fetch depth: 2
22:11:55,781 INFO [SettingsFactory] Default batch fetch size: 1
22:11:55,781 INFO [SettingsFactory] Generate SQL with comments: disabled
22:11:55,781 INFO [SettingsFactory] Order SQL updates by primary key: disabled
22:11:55,781 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
22:11:55,796 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
22:11:55,796 INFO [SettingsFactory] Query language substitutions: {}
22:11:55,796 INFO [SettingsFactory] Second-level cache: enabled
22:11:55,796 INFO [SettingsFactory] Query cache: disabled
22:11:55,796 INFO [SettingsFactory] Cache provider: org.hibernate.cache.EhCacheProvider
22:11:55,812 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
22:11:55,812 INFO [SettingsFactory] Structured second-level cache entries: disabled
22:11:55,859 INFO [SettingsFactory] Echoing all SQL to stdout
22:11:55,859 INFO [SettingsFactory] Statistics: disabled
22:11:55,859 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
22:11:55,859 INFO [SettingsFactory] Default entity-mode: pojo
22:11:56,343 INFO [SessionFactoryImpl] building session factory
22:11:56,390 WARN [Configurator] No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/Work/PhinLX/bin/jboss-4.0.1/server/mustang/tmp/deploy/tmp37854mustang-exp.war/WEB-INF/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
22:12:02,343 FATAL [HibernateUtil] Building SessionFactory failed.
org.hibernate.InstantiationException: could not instantiate test objectmy.app.domain.ClinicalSubject
at org.hibernate.engine.UnsavedValueFactory.instantiate(UnsavedValueFactory.java:25)
at org.hibernate.engine.UnsavedValueFactory.getUnsavedIdentifierValue(UnsavedValueFactory.java:44)
at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:42)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:108)
at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400)
at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:87)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:58)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
at my.app.dao.HibernateUtil.<clinit>(HibernateUtil.java:44)
at my.app.ui.HibernateSessionFilter.doFilter(HibernateSessionFilter.java:33)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at my.app.ui.AuthoriziedUserInterceptor.doFilter(AuthoriziedUserInterceptor.java:49)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:54)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at org.hibernate.engine.UnsavedValueFactory.instantiate(UnsavedValueFactory.java:22)
... 46 more
Caused by: my.app.dao.DaoException: java.lang.NullPointerException
at my.app.dao.DaoImpl.loadCodeLibrary(DaoImpl.java:224)
at my.app.domain.CodeLibrary.find(CodeLibrary.java:24)
at my.app.domain.ClinicalSubject.<init>(ClinicalSubject.java:26)
... 51 more
Caused by: java.lang.NullPointerException
at my.app.dao.HibernateUtil.getSession(HibernateUtil.java:134)
at my.app.dao.DaoImpl.loadCodeLibrary(DaoImpl.java:218)
... 53 more
Name and version of the database you are using:
HSQLDB server 1.7.2