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

  • Home
  • SEARCH
  • 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 8223757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:49:34+00:00 2026-06-07T14:49:34+00:00

i have src folder and inside it there are many packages, one of which

  • 0

i have src folder and inside it there are many packages, one of which is hibernate.util.

earlier i had placed hibernate.cfg.xml in src folder and gave its absolute path and now since i have to deploy this app , the absolute path is giving me problems.

i tried adding a new resource folder as source folder, included it in source folder , added it to classpath but everytime its gives file not found

i am using eclipse IDE

SEVERE: Allocate exception for servlet sandbox
java.io.FileNotFoundException: .\resources\hibernate.cfg.xml (The system cannot find the path specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:2216)
    at dal.utils.HibernateUtils.buildSessionFactory(HibernateUtils.java:25)
    at dal.utils.HibernateUtils.<clinit>(HibernateUtils.java:19)
    at dal.service.CalcDataMapper.load(CalcDataMapper.java:17)
    at com.renturduniya.www.sandbox.init(sandbox.java:41)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Unknown Source)
  • 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-07T14:49:36+00:00Added an answer on June 7, 2026 at 2:49 pm

    You should not pass it a File. A File represents a path on the file system. Your config file should be bundled in the jar/war along with the classes of your app, and be loaded using the class loader.

    You should use the method taking a URL as argument instead, and pass it the URL returned by

    SomeClassOfYourWebApp.class.getResource(
        "/the/package/where/the/file/is/hibernate.cfg.xml");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have added Images folder inside src folder in Java project. For setting top
I have kept my SqlMapConfig.xml inside the src folder as a packge. When I
How to exclude files from src/main/resources, for ex : I have a folder named
I have different XML-files in my 'src/main/recources' folder, and I'd like to read them
I have been given a source folder ( src ) of a Java Project.
I have a bunch of .java files in a src folder that depend on
I have one button inside webview as : return INPUT TYPE=\button\ type = \image\
I have a folder myApp1 and pom.xml is lying inside myApp1. Here is the
I have a new django project called mysite. Inside mysite is a folder called
I have the third party jar's in my WEB project placed at /src/main/webapp/WEB-INF/lib/ 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.