-->
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.  [ 4 posts ] 
Author Message
 Post subject: no java files output from hbm2java
PostPosted: Fri Mar 02, 2007 7:08 pm 
Newbie

Joined: Fri Mar 02, 2007 5:59 pm
Posts: 3
Location: Denver, CO
I've got the configuration below. I'm running ant and I'm seeing the following console output, but no java files are created:
Buildfile: build.xml

hbm2java:
[hibernatetool] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
[hibernatetool] 1. task: hbm2java (Generates a set of .java files)
[hibernatetool] Mar 2, 2007 4:03:48 PM org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: Hibernate 3.2.2
[hibernatetool] Mar 2, 2007 4:03:48 PM org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: hibernate.properties not found
[hibernatetool] Mar 2, 2007 4:03:48 PM org.hibernate.cfg.Environment buildBytecodeProvider
[hibernatetool] INFO: Bytecode provider name : cglib
[hibernatetool] Mar 2, 2007 4:03:48 PM org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] Mar 2, 2007 4:03:48 PM org.hibernate.cfg.Configuration configure
[hibernatetool] INFO: configuring from file: hibernate.cfg.xml
[hibernatetool] Mar 2, 2007 4:03:48 PM org.hibernate.cfg.Configuration doConfigure
[hibernatetool] INFO: Configured SessionFactory: mySqlSessionFactory
[hibernatetool] Mar 2, 2007 4:03:48 PM org.hibernate.cfg.reveng.OverrideRepository addFile
[hibernatetool] INFO: Override file: C:\Work\eclipse\workspace32\SpringHibernateTest\hibernate.reveng.xml
[hibernatetool] Mar 2, 2007 4:03:48 PM org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernatetool] INFO: Using Hibernate built-in connection pool (not for production use!)
[hibernatetool] Mar 2, 2007 4:03:48 PM org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernatetool] INFO: Hibernate connection pool size: 20
[hibernatetool] Mar 2, 2007 4:03:48 PM org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernatetool] INFO: autocommit mode: false
[hibernatetool] Mar 2, 2007 4:03:48 PM org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernatetool] INFO: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/springHibernateTest
[hibernatetool] Mar 2, 2007 4:03:48 PM org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernatetool] INFO: connection properties: {user=springHibernate, password=****}
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: RDBMS: MySQL, version: 5.0.21-community
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.4 ( $Date: 2006-10-19 17:47:48 +0200 (Thu, 19 Oct 2006) $, $Revision: 5908 $ )
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.dialect.Dialect <init>
[hibernatetool] INFO: Using dialect: org.hibernate.dialect.MySQLDialect
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
[hibernatetool] INFO: Using default transaction strategy (direct JDBC transactions)
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
[hibernatetool] INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Automatic flush during beforeCompletion(): disabled
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Automatic session close at end of transaction: disabled
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: JDBC batch size: 15
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: JDBC batch updates for versioned data: disabled
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Scrollable result sets: enabled
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: JDBC3 getGeneratedKeys(): enabled
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Connection release mode: auto
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Maximum outer join fetch depth: 2
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Default batch fetch size: 1
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Generate SQL with comments: disabled
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Order SQL updates by primary key: disabled
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
[hibernatetool] INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
[hibernatetool] INFO: Using ASTQueryTranslatorFactory
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Query language substitutions: {}
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: JPA-QL strict compliance: disabled
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Second-level cache: enabled
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Query cache: disabled
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory createCacheProvider
[hibernatetool] INFO: Cache provider: org.hibernate.cache.NoCacheProvider
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Optimize cache for minimal puts: disabled
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Structured second-level cache entries: disabled
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Statistics: disabled
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Deleted entity synthetic identifier rollback: disabled
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Default entity-mode: pojo
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Named query checking : enabled
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.connection.DriverManagerConnectionProvider close
[hibernatetool] INFO: cleaning up connection pool: jdbc:mysql://localhost/springHibernateTest
[hibernatetool] Mar 2, 2007 4:03:49 PM org.hibernate.tool.Version <clinit>
[hibernatetool] INFO: Hibernate Tools 3.2.0.b9

BUILD SUCCESSFUL
Total time: 1 second


Any ideas what I'm missing?

Thanks,
Joshua

Hibernate version:
3.2.2

Mapping documents:
build.xml
------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<project name="SpringHibernateTest" basedir="." default="hbm2java">

<path id="toolslib">
<path location="lib/hibernate-tools.jar" />
<path location="lib/hibernate3.jar" />
<path location="lib/freemarker-2.3.8.jar" />
<path location="lib/commons-logging-1.1.jar" />
<path location="lib/dom4j-1.6.1.jar" />
<path location="lib/mysql-connector-java-5.0.4-bin.jar" />
<path location="lib/cglib-2.1.3.jar" />
<path location="lib/asm.jar" />
<path location="lib/commons-collections-2.1.1.jar" />

</path>

<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="toolslib"/>

<target name="hbm2java">
<hibernatetool destdir="./generated">
<jdbcconfiguration configurationfile="hibernate.cfg.xml" revengfile="hibernate.reveng.xml"/>
<hbm2java jdk5="true"/>
</hibernatetool>
</target>

</project>

------------------------------------------------------------------------------

hibernate.cfg.xml:
------------------------------------------------------------------------------
<?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 name="mySqlSessionFactory">
<property name="hibernate.bytecode.use_reflection_optimizer">false</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.password">springHibernate</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/springHibernateTest</property>
<property name="hibernate.connection.username">springHibernate</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
</session-factory>
</hibernate-configuration>
------------------------------------------------------------------------------

hibernate-reveng.xml
------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >

<hibernate-reverse-engineering>
<table-filter match-schema="springHibernateTest" match-name=".*" />
</hibernate-reverse-engineering>
------------------------------------------------------------------------------

Name and version of the database you are using:
MySql 5.0.21, mysql-connector-java-5.0.4


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 1:57 pm 
Newbie

Joined: Sat Feb 03, 2007 2:58 pm
Posts: 7
Hi Joshua,
I think that the problem is that you use hibernate.cfg.xml file
to configurate the connection with the database instead of using
hibernate.properties file. see
http://www.hibernate.org/hib_docs/tools ... e/#d0e1064
http://www.hibernate.org/hib_docs/v3/re ... figuration

If you use the <hbm2cfgxml/> exporter (http://www.hibernate.org/hib_docs/tools/reference/en/html_single/#d0e1255)
you can generate the hibernate.cfg.xml configuration file that you need.

Best regards,
emmie.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 2:36 pm 
Newbie

Joined: Fri Mar 02, 2007 5:59 pm
Posts: 3
Location: Denver, CO
emmie wrote:
Hi Joshua,
I think that the problem is that you use hibernate.cfg.xml file
to configurate the connection with the database instead of using
hibernate.properties file. see
http://www.hibernate.org/hib_docs/tools ... e/#d0e1064
http://www.hibernate.org/hib_docs/v3/re ... figuration

If you use the <hbm2cfgxml/> exporter (http://www.hibernate.org/hib_docs/tools/reference/en/html_single/#d0e1255)
you can generate the hibernate.cfg.xml configuration file that you need.

Best regards,
emmie.


Emmie,
I created a hibernate.properties file, but the output was the same and still no POJOs :-(. Note that jdbcconfiguration can read it's a data from either hibernate.cfg.xml or hibernate.properties by specfying either a configurationfile or a propertyfile attribute (http://www.hibernate.org/hib_docs/tools/reference/en/html_single/#d0e1122). I did use hbm2cfgxml to generate the hibernate.cfg.xml. That's how I generated the hibernate.cfg.xml in my original post.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 21, 2007 7:24 pm 
Newbie

Joined: Mon Apr 02, 2007 12:09 pm
Posts: 4
hibernate-reveng.xml

Check your reverse enginerring xml.

If you change this
<table-filter match-schema="springHibernateTest" match-name=".*" />
to
<table-filter match-schema="springHibernateTest" match-name="*" />
it should work.

Thanks
Deepak

_________________
Deepak Pydimarry


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.