Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8004293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:52:29+00:00 2026-06-04T16:52:29+00:00

I am making a web application on STS. I am using jars of Spring

  • 0

I am making a web application on STS. I am using jars of Spring 3.1.0 and HIbernate 4.0.1. I am including jars in project build path.
In DAO layer when I am trying to make a HibernateTemplate object , it is not getting instantiate, It is null there. I don’t understand why it is null.

Earlier I was getting an error like NoClassDefinitionFound: org.springframework.orm.hibernate3.HibernateTemplate….Then I included these jars in WEB-INF->lib folder and then this error was removed but still hibernateTemplate object is null. Can there be any issue regarding position of beans.xml in project folders. ? Can anyone help me.

Below is code for my beans.xml and Userinfo.java.


[b]Beans.xml[/b]

Only relevant part of bean.xml

<bean id="hibTemplateBean" class="org.springframework.orm.hibernate3.HibernateTemplate" >
    <property name="sessionFactory" ref="sfBean" />
</bean>

[b]UserinfoDao.java[/b]

package com.home.dao;

import org.springframework.orm.hibernate3.HibernateTemplate;

import com.home.pojo.User;

public class UserinfoDao {

    public UserinfoDao() {

            super();

        }

    private static HibernateTemplate hibernateTemplate;

    public void setHibernateTemplate(HibernateTemplate hibernateTemplate) {
        UserinfoDao.hibernateTemplate = hibernateTemplate;
    }

    public static void fetchUserInfo(){
        try{
            User user = (User)hibernateTemplate.get(User.class, 111);
        }catch(NullPointerException npe){
            npe.printStackTrace();
        }
    }
}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:52:31+00:00Added an answer on June 4, 2026 at 4:52 pm

    You are using Hibernate 4 and you are using org.springframework.orm.hibernate3.HibernateTemplate from Hibernate 3 package.

    This template is not supported anymore. You can do declarative transaction management.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a web application using JBOSS and Seam but I am trying
I am making an web application using silverlight 3.0 . In that application i
I am new to sturts2 and hibernate frameworks. I am making test web application.
I am making a RIA application using Silverlight and web services. The method of
we are making an web application using some big asp.net web toolkit. At the
I am making a PHP web Application in which i am using MySQL as
I am making a web application using JBoss Seam 2.2.0, and I want to
I'm making a web application using ASP and AJAX, and I have a DropDownList
I am programming with Visual Studio 2008 and making a web application using .NET
I am making a data intensive web application that I am trying to optimize.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.