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 8489645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:53:05+00:00 2026-06-10T21:53:05+00:00

firends i m using netbeans ide and its placed hibernate.cfg.xml in default src/java folder

  • 0

firends i m using netbeans ide and its placed hibernate.cfg.xml in default src/java folder
but whenever i run the application its displayed below error :

Initial SessionFactory creation failed.org.hibernate.HibernateException: /hibernate.cfg.xml not found

class :

public class myutil {
 private static final SessionFactory sessionFactory = buildsf(); 
 public static SessionFactory buildsf() { 
    try {
      // Create the SessionFactory from standard (hibernate.cfg.xml)
      return new Configuration().configure("config/hibernate.cfg.xml").buildSessionFactory();
    } catch (Throwable ex) { // Log the exception.
      System.err.println("Initial SessionFactory creation failed." + ex);
      throw new ExceptionInInitializerError(ex);
    }
 }
} 
  • 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-10T21:53:07+00:00Added an answer on June 10, 2026 at 9:53 pm

    Use :

     SessionFactory sessionFactory = new Configuration()
            .configure("config/hibernate.cfg.xml") // give path to hibernate.cfg.xml (recommended)
            .buildSessionFactory();
    
            return sessionFactory;
    

    Check here usage. Or directly keep hibernate.cfg.xml directly under src(not recommended).

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

Sidebar

Related Questions

Hey,firends,This is my first post. I'm just begin to using Gcc to compile java,and
I created a Java web application using Netbeans, I only got a .war file
hi friends i'm using Sax parser for parsing my xml file which i recieve
I want to fetch the Facebook user's online friends using Graph API but I
I have just began learning Java programming, I have created a simple game using
I am using below code to get profile image of friends using Resfb. I
The following batch request for retrieve friends using the same app is not working:
I can send requests to friends using Multi Friend Request Selector inside my Page
I'm trying to get a list of user's friends using fb connect for the
I know that using friends_work_history permission, we can access friend's work history. Now, I

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.