I am learning to use Hibernate in my Java web app. I have the following sessionFactory started with a configuration for the location of my hibernate.cfg.xml file, but it still complains: `resources/hibernate.cfg.xml not found`

**The "resources" folder is a subdirectory of my "src" folder in the java project.**

```
public class HibernateUtil
{
    private static final SessionFactory sessionFactory = new Configuration().configure("resources/hibernate.cfg.xml").buildSessionFactory();

    public static void main(String[] args)
    {
        Session session = sessionFactory.getCurrentSession();
        Transaction tx = session.beginTransaction();

        Book book1 = new Book("John Wright", "Unknown Title");
        session.save(book1);
        tx.commit();

        System.out.println("Book committed: book title: " + book1.getTitle() + ", author is: " + book1.getAuthor());
        sessionFactory.close();
    }

}

```

The hibernate dependency I'm using in my pom.xml is as follows, but **intelliJ warns that the buildSessionFactory() method is deprecated** by highlight a "Strikethrough"

```
<dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.3.5.Final</version>
        </dependency>

```

I am posting the error message from my i at the very bottom as well. What is going wrong? thanks

```
10:43:12.737 [main] INFO  o.h.annotations.common.Version - HCANN000001: Hibernate Commons Annotations {4.0.4.Final}
10:43:12.746 [main] INFO  org.hibernate.Version - HHH000412: Hibernate Core {4.3.1.Final}
10:43:12.747 [main] INFO  org.hibernate.cfg.Environment - HHH000206: hibernate.properties not found
10:43:12.749 [main] INFO  org.hibernate.cfg.Environment - HHH000021: Bytecode provider name : javassist
Exception in thread "main" java.lang.ExceptionInInitializerError
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:259)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:116)
Caused by: org.hibernate.HibernateException: resources/hibernate.cfg.xml not found
    at org.hibernate.internal.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:173)
    at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:2093)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:2074)
    at persistence.HibernateUtil.<clinit>(HibernateUtil.java:14)
    ... 3 more
10:43:12.763 [main] INFO  org.hibernate.cfg.Configuration - HHH000043: Configuring from resource: resources/hibernate.cfg.xml
10:43:12.763 [main] INFO  org.hibernate.cfg.Configuration - HHH000040: Configuration resource: resources/hibernate.cfg.xml

Process finished with exit code 1

```