-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: ClassCastException when building the
PostPosted: Mon Aug 29, 2005 8:54 am 
Newbie

Joined: Mon Aug 01, 2005 7:22 am
Posts: 2
Location: Egypt,Giza,Dokki
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.0.5

I am using the following configuration file

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

<!--

     Attention: Generated code! Do not modify by hand!

     Generated by: hibernate.cfg.xml.vsl in andromda-hibernate-cartridge.

  -->

<!DOCTYPE

    hibernate-configuration

    PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"

           "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

    <session-factory>

        <!-- properties -->

        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>

        <property name="connection.username">mdeyab</property>

        <property name="connection.password">mdeyab</property>

        <property name="connection.url">jdbc:mysql://localhost/timesheet</property>

        <property name="jta.UserTransaction">UserTransaction</property>

        <property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>

        <property name="transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>

        <property name="show_sql">true</property>

        <property name="session_factory_name">java:/hibernate/SessionFactory</property>

        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>

        <property name="default_schema">timesheet</property>

        <property name="jdbc.batch_size">0</property>

        <property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>

        <property name="hibernate.cache.use_query_cache">false</property>

        <property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>

        <property name="hibernate.cache.query_cache_factory">org.hibernate.cache.StandardQueryCacheFactory</property>

        <!-- mapping files -->

        <mapping resource="timesheet/hibernate/ProjectManagerWeeklyApproval.hbm.xml"/>

        <mapping resource="timesheet/hibernate/TimeSheetEntry.hbm.xml"/>

        <mapping resource="timesheet/hibernate/Task.hbm.xml"/>

        <mapping resource="timesheet/hibernate/Allocation.hbm.xml"/>

        <mapping resource="timesheet/hibernate/OperationManagerWeeklyApproval.hbm.xml"/>

        <mapping resource="timesheet/hibernate/Project.hbm.xml"/>

    </session-factory>

</hibernate-configuration>



when I try to execute the following statement

Code:
new Configuration().configure().buildSessionFactory();


the function buildDialect at the class org.hibernate.dialect.DialectFactory
throws a Class Cast Exception why is that


java.lang.ClassCastException
at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:78)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 30, 2005 11:36 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
Strange,

your code should work.
Try to set a breakpoint at line 78 of DialectFactory
and see what kind of instance you get.
You should get a MySQLDialect instance as you
specified in your hibernate.cfg.xml.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.