0

My Eclipse notified me that a new version of JNA is available for update and so I updated. But after that, my Java Web Application throws an exception;

java.lang.ClassNotFoundException: org.hibernate.cfg.Configuration from

My web application works perfectly before the update. How do I fix this?

I used this hibernate dependency

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

My jar files are on the target folder inside the lib. I'm using JSP, Servlet, Hibernate on JBoss server.

1

1 Answer 1

0

You're getting the error because the hibernate libraries are not available to Tomcat. the hibernate library set there is an empty set called 'Web App Libraries' - this is the set your hibernate libraries need to be in.

Right click your project -> Build Path -> Configure Build Path, and remove the hibernate set from the build path. Now import the jars into the WEB-INF/lib folder. Refresh your project and now you should see them listed in the 'Web App Libraries' set (i appreciate this is somewhat annoying that you have to import them into your code base - someone else might know a better way to do this that doesn't involve copying the jars in) OR THIS MAY HELP YOU

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.