• Post Reply Bookmark Topic Watch Topic
  • New Topic

get hibernate session problem --> throw null pointer exception  RSS feed

 
Raymond Chiu Wing Hing
Ranch Hand
Posts: 91
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

I have problems in struts1 web project on web logic 12.1.3.. It throw exception as below mention. Previously no problem but today it throws this.


public class SPropertyDAO extends BaseHibernateDAO  {


public List findByProperty(String propertyName, Object value) {
      log.debug("finding SProperty instance with property: " + propertyName
            + ", value: " + value);
      try {
         String queryString = "from SProperty as model where model."
         + propertyName + "= ?";
  Line 89 -->       Query queryObject = getSession().createQuery(queryString);

<-- Throw exception here, 29 Jun 2017 16:20:36,218 [ERROR]
<-- (SPropertyDAO.java:93)  - find by property name failed
<-- java.lang.NullPointerException
<-- at com.aeon.awip.hibernate.SPropertyDAO.findByProperty(SPropertyDAO.java:89)



queryObject.setParameter(0, value);
return queryObject.list();
      } catch (RuntimeException re) {
         log.error("find by property name failed", re);
         throw re;
      }
}

}
//-------------------------------------------------------------------

package com.aeon.awip.hibernate;

import org.hibernate.Session;


/**
* Data access object (DAO) for domain model
* @author MyEclipse Persistence Tools
*/
public class BaseHibernateDAO implements IBaseHibernateDAO {

public Session getSession() {
return HibernateSessionFactory.getSession();
}

}
 
Raymond Chiu Wing Hing
Ranch Hand
Posts: 91
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems weblogic is out of memory.
Now I am looking at the web logic fine tuning.
And do I need to check the matching of web logic 12.1.3 with my program hibernate jar file version and also jdk version used??
 
Raymond Chiu Wing Hing
Ranch Hand
Posts: 91
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I find that it is because some versioning of the jar file that caused the problem.
Solved.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!