org.hibernate.HibernateException: Dialect class not found when using custom Dialect

699 views Asked by At

Hello I'm trying to find a solution for Oracle conversions problem (doesn't accept "number" to be Double) with JBoss 7.1 and Hibernate. So, best suggested solution was to make a custom Dialect this way :

public class MyOracle10gDialect extends Oracle10gDialect {
public MyOracle10gDialect() {
    super();
}
protected void registerNumericTypeMappings() {
    super.registerNumericTypeMappings();
    registerColumnType( Types.DOUBLE, "number" );
}}

In the hibernate.cfg.xml I added :

<property name="hibernate.dialect">com.d2i.sssim.hibercommun.MyOracle10gDialect</property>

But this is what I got :

org.hibernate.HibernateException: Dialect class not found: com.d2i.sssim.hibercommun.MyOracle10gDialect

It's about the same project, with hibernate connection. Should I really create another project with one class (MyOracle10gDialect) and include it in my project as a lib? Why the hibernate.cfg.xml can't see the classes in it's own project? Any help?

1

There are 1 answers

0
Dragan Bozanovic On

You may be using Hibernate as JBoss module and as such it cannot see your custom class in your application. You can try to deploy your dialect classes as a custom JBoss module.