• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

get hibernate session problem --> throw null pointer exception

 
Ranch Hand
Posts: 91
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I find that it is because some versioning of the jar file that caused the problem.
Solved.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic