WilsonPena
WilsonPena

Reputation: 1571

Hibernate/SQLite - Not finding org/hibernate/dialect/unique/UniqueDelegate

I'm trying to create a project with Hibernate and SQLite in Eclipse IDE.

My pom.xml looks like this:

<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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>xmlTesting</groupId>
  <artifactId>xmlTesting</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.5.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.4</version>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.3.2</version>
    </dependency>

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

    <dependency>
        <groupId>org.xerial</groupId>
        <artifactId>sqlite-jdbc</artifactId>
        <version>3.7.2</version>
    </dependency>

    <dependency>
        <groupId>com.enigmabridge</groupId>
        <artifactId>hibernate4-sqlite-dialect</artifactId>
        <version>0.1.2</version>
    </dependency>


  </dependencies>
</project>

And file hibernate.cfg.xml:

<?xml version = "1.0" encoding = "utf-8"?>
<!DOCTYPE hibernate-configuration SYSTEM 
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
   <session-factory>

      <property name="show_sql">true</property>
      <property name="format_sql">true</property>
      <property name="dialect">com.enigmabridge.hibernate.dialect.SQLiteDialect</property>
      <property name="connection.driver_class">org.sqlite.JDBC</property>
      <property name="connection.url">jdbc:sqlite:test.db</property>
      <property name="connection.username"></property>
      <property name="connection.password"></property>

      <property name="hibernate.hbm2ddl.auto">update</property>

      <mapping class="xmlTesting.models.Employee"/>
   </session-factory>
</hibernate-configuration>

But when I try to run the project I get this error:

java.lang.NoClassDefFoundError: org/hibernate/dialect/unique/UniqueDelegate

which makes sense because I can't find this package (org.hibernate.dialect.unique) inside the MavenDependencies in Eclipse IDE.

I'm kind of trying to follow this tutorial http://www.srccodes.com/p/article/7/Annotation-based-Hibernate-Hello-World-example-using-Maven-build-tool-and-SQLite-database . But it doesn't seem anyone has had this same problem.

Upvotes: 1

Views: 1305

Answers (1)

miskender
miskender

Reputation: 7968

Change your hibernate-core version 4.3.11.Final. Your current version don't have UniqueDelegate class.

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

Upvotes: 1

Related Questions