-->
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: Reverse Engineering with Netbeans
PostPosted: Thu Sep 23, 2010 6:22 am 
Beginner
Beginner

Joined: Thu Jun 17, 2010 7:36 am
Posts: 26
Hello,
Im working on a small application with hibernate and spring

There are some problems when I try to use Hibernate Tools for Reverse Engineering (create mapping files from cfg.xml and database)

For the Hibernate Reverse Engineering Wizard a hibernate.cfg.xml is required.
I only have a xml file, where the settings for my database connection and for hibernate are stored.
Now I splitted them in two: the xml file for my database is now looking like this:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">

  <tx:annotation-driven transaction-manager="txManager"/>

  <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
       <property name="sessionFactory" ref="sessionFactory"/>
  </bean>

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="configLocation" value="classpath:hibernate.cfg.xml" />
        <property name="dataSource" ref="securityDataSource" />
</bean>


   <bean id="securityDataSource" destroy-method="close"
       class="org.apache.commons.dbcp.BasicDataSource">
        <property name="driverClassName" value="${db.driver}"/>
        <property name="url" value="${db.url}"/>
        <property name="username" value="${db.user}"/>
        <property name="password" value="${db.password}"/>
   </bean>

   <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
           <property name="location" value="WEB-INF/config/backend/db.properties"/>
   </bean>


</beans>


and this is my hibernate.cfg.xml

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="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>

        <mapping resource="users.hbm.xml"/>

    </session-factory>

</hibernate-configuration>


Unfortunately by trying to create the reverse engineering file I get this errormessage:

the database drivers are not added to the project classpath. go to project properties and add database library


Thats not possible. I can run the project and the database connection IS working!! So what is missing that I can not create that reverse engineering file??? I tried every library I could imagine.

Until yesterday I used SpringFramework 3.0.2
I even changed to 3.0.4 to see if it would work
I use hibernate3.jar and the mysql jdbc connector.

Here I got two pictures with my libraries in build path. in this moment the webinf/lib folder is empty because it didnt make any difference. please help!!

http://img42.imageshack.us/f/bibs1.png/
http://img33.imageshack.us/f/bibs2.png/


Top
 Profile  
 
 Post subject: Re: Reverse Engineering with Netbeans
PostPosted: Mon Sep 27, 2010 6:34 am 
Beginner
Beginner

Joined: Thu Jun 17, 2010 7:36 am
Posts: 26
somebody must be able to say anything to this topic???!


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.