How can i resolve java.lang.ClassNotFoundException: org.hibernate.util.DTDEntityResolver when using Spring 3.1 with Hibernate 4.0.1?


HOME ยป Java

I recently upgraded to Hibernate 4.0.1.Final and am receiving the
following error on context startup:


Caused by:
java.lang.NoClassDefFoundError:
org/hibernate/util/DTDEntityResolver
at
java.lang.ClassLoader.defineClass1(Native Method)
at
java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) /> at
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2823) /> at
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1160) /> at org.apache.catalina.loader.WebappClassLoader.loadClass(Webap

I am using hibernate with spring in my maven project. This is my
POM file


<?xml version="1.0"
encoding="UTF-8"?>
<project

xmlns="http://maven.apache.org/POM/4.0.0"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0

http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>org.mod.com</groupId>

<artifactId>Services</artifactId>

<version>1.0.0-SNAPSHOT</version>

<packaging>war</packaging>
<name&g
Java

I am getting the below exception when I am trying to test the
spring and hibernate integration.


Caused by:
java.lang.ClassNotFoundException: org.hibernate.cache.CacheProvider />at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at
java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at
java.security.AccessController.doPrivileged(Native Method)
at
java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 18
more

Programming Languages

I am trying to generate a schema (ddl) from my orm.xml file. I'm
using hibernate3-maven-plugin. I'm using JPA with hibernate as the
implementation, but am open to other implementations or maven plugins.
The code in my pom.xml is:


<build>

<plugins>
<plugin>

<groupId>org.codehaus.mojo</groupId>

<artifactId>hibernate3-maven-plugin</artifactId>

<version>3.0</version>

<configuration>
<hibernatetool>

<jpaconfiguration persistenceunit="
Java

I'm very new to hibernate,
and i'm simply trying to make my
first program that use it.


I'm using maven for building
the project. I declared these dependencies:



<dependency>

<groupId>org.hibernate</groupId>

<artifactId>hibernate-core</artifactId>

<version>4.1.5.SP1</version>

</dependency>
<dependency>

<groupId>org.hibernate</groupId>

<artifactId>hibernate-entitymanager</artifactId>

<version>4.1.5.SP1</version>

</dependency>
<depen
Java

I recently upgraded to Hibernate 4.0.1.Final and am receiving the
following error on context startup:


Caused by:
java.lang.NoClassDefFoundError:
org/hibernate/util/DTDEntityResolver
at
java.lang.ClassLoader.defineClass1(Native Method)
at
java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) /> at
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2823) /> at
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1160) /> at org.apache.catalina.loader.WebappClassLoader.loadClass(Webap
Java

I am trying to include spring and hibernate in an application
running on a Weblogic 10.3 server. When I run the application in the
server, while accessing an TestServlet to check my configuration I get
the following exception:

/>org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'mySessionFactory' defined in class path
resource
[spring-config/HorizonModelPeopleConnectionsSpringContext.xml]:
Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class
[org.springframework.orm.hibernate3.LocalSessionFactoryBean]:
Constructor threw exception; nested exception i
Java

- Technology - Languages
+ Webmasters
+ Development
+ Development Tools
+ Internet
+ Mobile Programming
+ Linux
+ Unix
+ Apple
+ Ubuntu
+ Mobile & Tablets
+ Databases
+ Android
+ Network & Servers
+ Operating Systems
+ Coding
+ Design Software
+ Web Development
+ Game Development
+ Access
+ Excel
+ Web Design
+ Web Hosting
+ Web Site Reviews
+ Domain Name
+ Information Security
+ Software
+ Computers
+ Electronics
+ Hardware
+ Windows
+ PHP
+ ASP/ASP.Net
+ C/C++/C#
+ VB/VB.Net
+ JAVA
+ Javascript
+ Programming
Privacy Policy - Copyrights Notice - Feedback - Report Violation 2018 © BigHow