-->
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: Hibernate Eclipse Plugin: Could not locate SessionFactory
PostPosted: Mon Mar 10, 2008 6:51 am 
Newbie

Joined: Mon Mar 10, 2008 6:15 am
Posts: 2
Hi

I’m using this plugin (http://www.hibernate.org/255.html) to reverse engineer a MySQL database with eclipse. I’ve successfully create the DAO and VO classes, but when I try to use them from a simple application I keep getting this error:

Exception in thread "main" java.lang.IllegalStateException: Could not locate SessionFactory in JNDIjava.lang.ClassCastException: org.hibernate.type.StringType cannot be cast to org.hibernate.type.VersionType

I assume I’m missing a basic step, but cant figure out which. My intention is to use the JDBC driver, not the JNDI. This is my configuration file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="hibernate.connection.password">pass</property>
        <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/pharma_backend</property>
        <property name="hibernate.connection.username">user</property>
        <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
    </session-factory>
</hibernate-configuration>

Do I need to code a SessionFactory myself?
What am I missing?

Thanks

Gonzo


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 22, 2008 9:27 am 
Newbie

Joined: Sat Mar 22, 2008 9:25 am
Posts: 1
Location: Cincinnati, Ohio
Pretty sure you need to edit your configuration and add your mapping files. Once you've done that right click your console configuration and 'Rebuild Configuration' then attempt to open up your session factory.


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.