-->
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.  [ 11 posts ] 
Author Message
 Post subject: HibernateToolTask, Eclipse, Ant
PostPosted: Mon Apr 04, 2011 4:13 pm 
Newbie

Joined: Mon Apr 04, 2011 3:41 pm
Posts: 12
Hi folks,

This is my first post here so wish me luck. :)

I'm a bit of a Hibernate and Ant noob and I'm having a problem running the HibernateToolTask via Ant in Eclipse when the ant build is configured to "Run in the same JRE as the workspace". By contrast, the same ant build works fine when run from the command line and even works in Eclipse when the ant build is set to run in a "separate JRE".

When running it in the "same JRE as the workspace" the build completes (BUILD SUCCESSFUL) but two things are evident. (1) The Log4J messages are not written to the console and (2) the <hbm2ddl /> does not create the database table.

I'm sure Log4J is configured properly because the logging level (debug) is successfully written for this exact same ant build when run from the command line or run through Eclipse with the ant build set to run in a "separate JRE". Same thing goes for the <hbm2ddl /> which runs successfully from the command line, etc.

I'm using code that I modified from the examples in the Harnessing Hibernate book.

I'm using the following versions:
Eclipse Java EE IDE for Web Developers Helios SR 2 (v. 3.6.2)
Ant v1.8.2
Java JDK 1.6.0_24
HibernateTools-3.2.4.GA-R200905070146-H18
hibernate-distribution-3.6.2.Final
HSQL Database Engine 2.1.0
Windows XP

I'm happy to add any other info that might be helpful such as the build.xml, hibernate.cfg.xml, , Track.hbm.xml, log4j.properties. For now I'll just add a couple of snippets that I think are relevant.

Code:
   <!-- Generate the schemas for all mapping files in our class tree -->
   <target name="schema" depends="prepare, refresh.local"
         description="Generate DB schema from the O/R mapping files">
         <hibernatetool destdir="${source.dir}">
            <configuration configurationfile="${props.dir}/hibernate.cfg.xml" />
            <hbm2ddl drop="yes" />
         </hibernatetool>
   </target>

   <target name="print.classpath">
      <!-- Write the classpath to the console. Helpful for debugging -->
      <!-- Create one line per classpath element-->
      <pathconvert pathsep="${line.separator}" property="echo.classpath" refid="project.classpath" />
      <!-- Write the result to the console -->
      <echo message="The classpath is set to the following: " />
      <echo message="${echo.classpath}" />
   </target>


Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
        <property name="hibernate.connection.url">jdbc:hsqldb:data/music;</property>
        <property name="hibernate.connection.username">sa</property>
        <property name="hibernate.connection.password"></property>
        <property name="hibernate.connection.shutdown">true</property>
        <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
        <property name="hibernate.connection.pool_size">1</property>
        <property name="hibernate.current_session_context_class">thread</property>
        <property name="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
        <property name="hibernate.jdbc.batch_size">0</property>
        <property name="hibernate.show_sql">true</property>
       
        <mapping resource="com/oreilly/hh/data/Track.hbm.xml" />
    </session-factory>
</hibernate-configuration>


Code:
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

log4j.rootLogger=warn, stdout
log4j.logger.com.oreilly.hh.data=debug
log4j.logger.org.hibernate=debug
log4j.logger.org.hibernate.type=debug
log4j.logger.org.hibernate.tool.hbm2ddl=debug


Below is the classpath that Ant is using when running the build.xml
Code:
print.classpath:
        [echo] The classpath is set to the following:
        [echo] C:\dev\source_code\HarnessingHibernate\examples\ch02\src
        [echo] C:\dev\source_code\HarnessingHibernate\examples\ch02\classes
        [echo] C:\dev\source_code\HarnessingHibernate\examples\ch02\properties
        [echo] C:\dev\source_code\HarnessingHibernate\examples\ch02\lib\hsqldb.jar
        [echo] C:\dev\source_code\HarnessingHibernate\examples\ch02\lib\slf4j-simple-1.6.1.jar
        [echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\hibernate-testing.jar
        [echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\hibernate3.jar
        [echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\bytecode\cglib\cglib-2.2.jar
        [echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\bytecode\javassist\javassist-3.12.0.GA.jar
        [echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\jpa\hibernate-jpa-2.0-api-1.0.0.Final.jar
        [echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\optional\c3p0\c3p0-0.9.1.jar
        [echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\optional\ehcache\ehcache-1.5.0.jar
        [echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\optional\infinispan\infinispan-core-4.2.1.CR1.jar
        [echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\optional\jbosscache\jbosscache-core-3.2.1.GA.jar
        [echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\optional\oscache\oscache-2.1.jar
        [echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\optional\proxool\proxool-0.8.3.jar
        [echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\optional\swarmcache\swarmcache-1.0RC2.jar
        [echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\required\antlr-2.7.6.jar
        [echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\required\commons-collections-3.1.jar
        [echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\required\dom4j-1.6.1.jar
        [echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\required\javassist-3.12.0.GA.jar
        [echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\required\jta-1.1.jar
        [echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\required\slf4j-api-1.6.1.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse.console_3.2.4.GA-R200905070146-H18\org.hibernate.eclipse.console.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse.help_3.2.4.GA-R200905070146-H18\help.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse.jdt.apt.ui_3.2.4.GA-R200905070146-H18.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse.jdt.ui_3.2.4.GA-R200905070146-H18.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse.mapper_3.2.4.GA-R200905070146-H18\org.hibernate.eclipse.mapper.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\annotations\ejb3-persistence.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\annotations\hibernate-annotations.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\annotations\hibernate-commons-annotations.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\annotations\hibernate-entitymanager.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\annotations\hibernate-search.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\annotations\hibernate-validator.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\annotations\lucene-core-2.2.0.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\bsh-core-2.0b4.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\antlr-2.7.6.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\asm-attrs.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\asm.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\c3p0-0.9.1.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\cglib-2.1.3.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\commons-collections-2.1.1.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\commons-logging-1.0.4.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\concurrent-1.3.2.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\connector.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\dom4j-1.6.1.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\ehcache-1.2.3.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\hibernate3.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jaas.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\javassist.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jboss-cache.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jboss-common.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jboss-jmx.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jboss-system.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jdbc2_0-stdext.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jgroups-2.2.8.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jta.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\log4j-1.2.15.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\oscache-2.1.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\proxool-0.8.3.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\swarmcache-1.0rc2.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\tools\bsh-2.0b1.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\tools\freemarker.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\tools\hibernate-tools.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\tools\jtidy-r8-20060801.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\org.hibernate.eclipse.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.jboss.tools.hibernate.jpt.core_3.2.4.GA-R200905070146-H18.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.jboss.tools.hibernate.jpt.ui_3.2.4.GA-R200905070146-H18.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.jboss.tools.hibernate.ui.veditor_3.2.4.GA-R200905070146-H18\orm2-veditor.jar
        [echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.jboss.tools.hibernate.ui.view_3.2.4.GA-R200905070146-H18\view.jar
BUILD SUCCESSFUL


Top
 Profile  
 
 Post subject: Re: HibernateToolTask, Eclipse, Ant
PostPosted: Thu Apr 07, 2011 8:36 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Your classpath is waaay to crowded ;)

I'll assume there are some log4j setup in one of those that conflicts.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: HibernateToolTask, Eclipse, Ant
PostPosted: Thu Apr 07, 2011 9:31 am 
Newbie

Joined: Mon Apr 04, 2011 3:41 pm
Posts: 12
Hello and thank you for your reply. It is appreciated.

max wrote:
Your classpath is waaay to crowded ;)

I'll assume there are some log4j setup in one of those that conflicts.


I agree the classpath is crowded and I have since reduced the number of jars in the classpath. See bottom of this post for the current list.

However, I think it is worth noting this exact same Ant build and the HibernateToolTask run successfully as-is (with the crowded classpath) when run from the command line or even run from Eclipse with the Ant build set to run in a "separate JRE". It is only when run from Eclipse with "Run in the same JRE as the workspace" checked that it fails to create the db schema table (though Ant reports BUILD SUCCESSFUL) and fails to write the logging to the console.

Also, I created a simple HelloWorld class in this same Eclipse project to test Log4J logging levels (Debug, Info, etc) and confirmed these are successfully written to the Eclipse console in all cases. It seems it is only the HibernateToolTask that is not logging to the console in Eclipse when "Run in the same JRE as the workspace"

As mentioned, I have reduced the jars in the classpath and below is the current list. Is this still too many? What can be removed?

Many thanks for any advice or suggestions you may provide

Quote:
print.classpath:
[echo] The classpath is set to the following:
[echo] C:\dev\source_code\HarnessingHibernate\examples\ch02\src
[echo] C:\dev\source_code\HarnessingHibernate\examples\ch02\classes
[echo] C:\dev\source_code\HarnessingHibernate\examples\ch02\lib\hsqldb.jar
[echo] C:\dev\source_code\HarnessingHibernate\examples\ch02\lib\junit.jar
[echo] C:\dev\source_code\HarnessingHibernate\examples\ch02\lib\log4j-1.2.15.jar
[echo] C:\dev\source_code\HarnessingHibernate\examples\ch02\lib\org.hamcrest.core_1.1.0.v20090501071000.jar
[echo] C:\dev\source_code\HarnessingHibernate\examples\ch02\lib\slf4j-simple-1.6.1.jar
[echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\required\antlr-2.7.6.jar
[echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\required\commons-collections-3.1.jar
[echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\required\dom4j-1.6.1.jar
[echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\required\javassist-3.12.0.GA.jar
[echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\required\jta-1.1.jar
[echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\required\slf4j-api-1.6.1.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\annotations\ejb3-persistence.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\annotations\hibernate-annotations.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\annotations\hibernate-commons-annotations.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\annotations\hibernate-entitymanager.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\annotations\hibernate-validator.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\annotations\lucene-core-2.2.0.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\bsh-core-2.0b4.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\antlr-2.7.6.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\asm-attrs.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\asm.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\c3p0-0.9.1.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\cglib-2.1.3.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\commons-collections-2.1.1.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\commons-logging-1.0.4.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\concurrent-1.3.2.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\connector.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\dom4j-1.6.1.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\ehcache-1.2.3.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\hibernate3.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jaas.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\javassist.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jboss-cache.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jboss-common.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jboss-jmx.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jboss-system.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jdbc2_0-stdext.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jgroups-2.2.8.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jta.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\log4j-1.2.15.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\oscache-2.1.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\proxool-0.8.3.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\swarmcache-1.0rc2.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\tools\bsh-2.0b1.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\tools\freemarker.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\tools\hibernate-tools.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\tools\jtidy-r8-20060801.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\org.hibernate.eclipse.jar
BUILD SUCCESSFUL


Top
 Profile  
 
 Post subject: Re: HibernateToolTask, Eclipse, Ant
PostPosted: Thu Apr 07, 2011 9:35 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
org.hibernate.eclipse.jar....

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: HibernateToolTask, Eclipse, Ant
PostPosted: Thu Apr 07, 2011 9:49 am 
Newbie

Joined: Mon Apr 04, 2011 3:41 pm
Posts: 12
max wrote:
org.hibernate.eclipse.jar....


can you please elaborate? i'm not sure which question you are answering? :)


Top
 Profile  
 
 Post subject: Re: HibernateToolTask, Eclipse, Ant
PostPosted: Thu Apr 07, 2011 9:55 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
org.hibernate.eclipse.jar is definitely not required.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: HibernateToolTask, Eclipse, Ant
PostPosted: Thu Apr 07, 2011 10:31 am 
Newbie

Joined: Mon Apr 04, 2011 3:41 pm
Posts: 12
max wrote:
org.hibernate.eclipse.jar is definitely not required.


Ok, I've modified my Ant build.xml to exclude org.hibernate.eclipse.jar.

Unfortunately, the result is the same:
1. Logging statements are missing from the console and <hbm2ddl drop="yes" /> fails to create table in schema when ant build.xml is run from Eclipse with "Run in the same JRE as the workspace" option.

2. Logging statements appear as expected and <hbm2ddl drop="yes" /> successfully creates table in schema when ant build.xml is run from Eclipse with run in a "separate JRE" option.

3. Logging statements appear as expected and <hbm2ddl drop="yes" /> successfully creates table in schema when ant build.xml is run from the command line.

I appreciate your help and suggestions.

Here's the current classpath used by Ant.
Quote:
print.classpath:
[echo] The classpath is set to the following:
[echo] C:\dev\source_code\HarnessingHibernate\examples\ch02\src
[echo] C:\dev\source_code\HarnessingHibernate\examples\ch02\classes
[echo] C:\dev\source_code\HarnessingHibernate\examples\ch02\lib\hsqldb.jar
[echo] C:\dev\source_code\HarnessingHibernate\examples\ch02\lib\junit.jar
[echo] C:\dev\source_code\HarnessingHibernate\examples\ch02\lib\log4j-1.2.15.jar
[echo] C:\dev\source_code\HarnessingHibernate\examples\ch02\lib\org.hamcrest.core_1.1.0.v20090501071000.jar
[echo] C:\dev\source_code\HarnessingHibernate\examples\ch02\lib\slf4j-simple-1.6.1.jar
[echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\required\antlr-2.7.6.jar
[echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\required\commons-collections-3.1.jar
[echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\required\dom4j-1.6.1.jar
[echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\required\javassist-3.12.0.GA.jar
[echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\required\jta-1.1.jar
[echo] C:\dev\plugins\hibernate-distribution-3.6.2.Final\lib\required\slf4j-api-1.6.1.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\annotations\ejb3-persistence.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\annotations\hibernate-annotations.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\annotations\hibernate-commons-annotations.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\annotations\hibernate-entitymanager.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\annotations\hibernate-validator.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\annotations\lucene-core-2.2.0.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\bsh-core-2.0b4.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\antlr-2.7.6.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\asm-attrs.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\asm.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\c3p0-0.9.1.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\cglib-2.1.3.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\commons-collections-2.1.1.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\commons-logging-1.0.4.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\concurrent-1.3.2.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\connector.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\dom4j-1.6.1.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\ehcache-1.2.3.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\hibernate3.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jaas.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\javassist.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jboss-cache.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jboss-common.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jboss-jmx.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jboss-system.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jdbc2_0-stdext.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jgroups-2.2.8.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\jta.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\log4j-1.2.15.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\oscache-2.1.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\proxool-0.8.3.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\hibernate\swarmcache-1.0rc2.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\tools\bsh-2.0b1.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\tools\freemarker.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\tools\hibernate-tools.jar
[echo] C:\dev\plugins\HibernateTools-3.2.4.GA-R200905070146-H18\plugins\org.hibernate.eclipse_3.2.4.GA-R200905070146-H18\lib\tools\jtidy-r8-20060801.jar
BUILD SUCCESSFUL


Top
 Profile  
 
 Post subject: Re: HibernateToolTask, Eclipse, Ant
PostPosted: Thu Apr 07, 2011 10:48 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
I can't reproduce it right now - but any specific reasons why you want to run it this way?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: HibernateToolTask, Eclipse, Ant
PostPosted: Thu Apr 07, 2011 11:03 am 
Newbie

Joined: Mon Apr 04, 2011 3:41 pm
Posts: 12
max wrote:
any specific reasons why you want to run it this way?


Do you mean why run Ant in the same JRE as the workspace vs in a separate JRE?

I was previously running in the same JRE because a different task (javadoc) was only working when running in the same JRE as the workspace. Now I've run into this issue and it only works outside the workspace.

I'm assuming, this HibernateToolTask is supposed to work either way. Is the standard to run it in a separate JRE?

Since I'm a Hibernate noob I figured I'd participate in the community and post here and see if I'm doing something obviously wrong. :)

For the time being I'm fine to run it from a separate JRE.


Top
 Profile  
 
 Post subject: Re: HibernateToolTask, Eclipse, Ant
PostPosted: Thu Apr 07, 2011 11:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Running in the same JRE (in same VM as eclipse) you'll eventually run out of memory because of classloader leaks I would reckon so I would recommend running outside of VM if not a problem.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: HibernateToolTask, Eclipse, Ant
PostPosted: Fri Apr 08, 2011 6:18 am 
Newbie

Joined: Fri Apr 08, 2011 6:15 am
Posts: 2
tha t is my problem and do not REMEDY

_________________
free online Aircraft games


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 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.