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.  [ 1 post ] 
Author Message
 Post subject: [org.hibernate.impl.SessionFactoryObjectFactory] Not found
PostPosted: Sat Aug 25, 2007 6:12 pm 
Beginner
Beginner

Joined: Tue Aug 14, 2007 6:29 pm
Posts: 27
Location: chicago
Hibernate version: 3.0.1 RC1

Mapping documents:
<?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">
<!--
Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
<class name="com.xpedx.ecommerce.order.model.OrderDTO" table="orderstatustable" schema="public" lazy="false">

<id name="id" type="integer">
<column name="id" sql-type="serial" />
<generator class="native" />
</id>

<property name="orderId" type="string">
<column name="onlineorderno" length="29" />
</property>

<property name="orderTime" type="timestamp">
<column name="ordertime" length="29" />
</property>
<property name="customerId" type="string">
<column name="customerno" length="12" />
</property>
<property name="orderStatus" type="integer">
<column name="orderstatus" length="1" />
</property>
<property name="statusTime" type="timestamp">
<column name="statustime" length="29" />
</property>
<property name="batchId" type="string">
<column name="batchid" length="10" />
</property>
<property name="fullfillmentLocation" type="string">
<column name="fullfillment_location" length="3" />
</property>

</class>
</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():

protected Session currentSession() throws DAOException {
Session s = (Session) sessionContext.get();

try {
s = getSessionFactory().openSession();
sessionContext.set(s);
} catch (Throwable e) {
logException("Exception in currentSession()", e);
throw new DAOException(e);
}
return s;

}

private static SessionFactory getSessionFactory() {
if (sf == null) {
try {
Context ctx = new InitialContext();
sf = (SessionFactory) ctx.lookup(HIBERNATE_FACTORY_JNDI);
} catch (NamingException e) {
log.fatal("Could not look up SessionFactory in JNDI: " + HIBERNATE_FACTORY_JNDI, e);
throw new RuntimeException(e);
}
}
return sf;
}



public List findByProperty1(String propertyName , String query) throws DAOException {
List myResult = null;
Session sess;
try {
sess = currentSession();
//String queryString = BaseDAO.retrieveBatch;
System.out.println("1" + propertyName);
//String queryString = getQuery(query);
Query myQuery = sess.createQuery(query);
System.out.println("2");
myQuery.setString("PARAM", propertyName.trim());
System.out.println("3");
myResult = myQuery.list();
System.out.println("4");
return myResult;
} catch (DAOException e) {
e.printStackTrace();
log.info("Problem in getting a session");
throw new DAOException(e);
}
}

Full stack trace of any exception that occurs:

2007-08-25 16:48:46,319 WARN [org.hibernate.impl.SessionFactoryObjectFactory] Not found: 2c98b291149efb2a01149efb2b990000
2007-08-25 16:48:46,319 WARN [org.hibernate.impl.SessionFactoryObjectFactory] Not found: 2c98b291149efb2a01149efb2b990000
2007-08-25 16:48:46,319 ERROR [com.xpedx.ecommerce.BaseDAO] Exception in currentSession()
java.lang.NullPointerException
at com.xpedx.ecommerce.BaseDAO.currentSession(BaseDAO.java:64)

Name and version of the database you are using:
Postgres 8.2.3

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:
2007-08-25 17:00:00,300 DEBUG [DefaultQuartzScheduler_Worker-7] org.hibernate.jdbc.ConnectionManager - connection already null in cleanup : no action
2007-08-25 17:06:41,071 DEBUG [http-xpediate.ipaper.com%2F172.24.50.17-8080-2] org.hibernate.jdbc.JDBCContext - no active transaction, could not register Synchronization
2007-08-25 17:06:41,071 DEBUG [http-xpediate.ipaper.com%2F172.24.50.17-8080-2] org.hibernate.impl.SessionImpl - opened session at timestamp: 4866374045986816
2007-08-25 17:06:41,072 DEBUG [http-xpediate.ipaper.com%2F172.24.50.17-8080-2] org.hibernate.impl.SessionImpl - find: select batchId from com.xpedx.ecommerce.order.model.OrderDTO order where order.orderStatus = 1 and order.orderId = :PARAM
2007-08-25 17:06:41,072 DEBUG [http-xpediate.ipaper.com%2F172.24.50.17-8080-2] org.hibernate.engine.QueryParameters - named parameters: {PARAM=CART009}
2007-08-25 17:06:41,075 DEBUG [http-xpediate.ipaper.com%2F172.24.50.17-8080-2] org.hibernate.hql.ast.QueryTranslatorImpl - parse() - HQL: select batchId from com.xpedx.ecommerce.order.model.OrderDTO order where order.orderStatus = 1 and order.orderId = :PARAM


Problems with Session and transaction handling?
When deployed as HAR file ,log displayed the sessionfactory is bound.

My app runs on jboss 4.0.3 and used postgres 8.2.3.

Any help would be greatly appreciated.

Thanks
Sundar


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.