-->
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: [hbm2ddl] ant: Schema text failed
PostPosted: Wed Dec 15, 2004 5:03 am 
Newbie

Joined: Tue Nov 30, 2004 5:07 am
Posts: 14
Hallo,

I can't get ant to generate a *.sql-file for me. Generating the mapping-files from XDoclet works, but the next step fails with a "Schema text failed: Resource: com/myPackage/Test.hbm.xml not found"-Message. More information attached.

Any ideas where to start searching to get it working?

smo


Ant-Output:
Code:
Buildfile: D:\da\workspace\OOD\build.xml
clean:
   [delete] Deleting directory D:\da\workspace\OOD\dest_hibernate
prepareHibernate:
     [echo] Creating required directories...
    [mkdir] Created dir: D:\da\workspace\OOD\dest_hibernate
compileXDoclet:
    [javac] Compiling 1 source files to D:\da\workspace\OOD\dest_hibernate
XDoclet2hbm:
[hibernatedoclet] (XDocletMain.start                   47  ) Running <hibernate/>
[hibernatedoclet] Generating mapping file for com.myPackage.Test.
[hibernatedoclet] com.myPackage.Test
hbm2ddl:
     [copy] Copying 1 files to D:\da\workspace\OOD\dest_hibernate
[schemaexport] 15.12.2004 09:40:55 net.sf.hibernate.cfg.Environment <clinit>
[schemaexport] INFO: Hibernate 2.1.7
[schemaexport] 15.12.2004 09:40:55 net.sf.hibernate.cfg.Environment <clinit>
[schemaexport] INFO: hibernate.properties not found
[schemaexport] 15.12.2004 09:40:55 net.sf.hibernate.cfg.Environment <clinit>
[schemaexport] INFO: using CGLIB reflection optimizer
[schemaexport] 15.12.2004 09:40:55 net.sf.hibernate.cfg.Environment <clinit>
[schemaexport] INFO: using JDK 1.4 java.sql.Timestamp handling
[schemaexport] 15.12.2004 09:40:55 net.sf.hibernate.cfg.Configuration configure
[schemaexport] INFO: configuring from file: hibernate.cfg.xml
[schemaexport] 15.12.2004 09:40:56 net.sf.hibernate.cfg.Configuration addResource
[schemaexport] INFO: Mapping resource: com/myPackage/Test.hbm.xml
BUILD FAILED: D:\da\workspace\OOD\build.xml:136: Schema text failed: Resource: com/myPackage/Test.hbm.xml not found



My build.xml:
Code:
[...]
<property name="origin.src.dir" location="WEB-INF/src"/>
<property name="origin.lib.dir" location="WEB-INF/lib"/>
<property name="dest_hibernate.root.dir" location="dest_hibernate"/>
[...]
   <target name="hbm2ddl" depends="XDoclet2hbm" description="Generates schema with hbm.xml and classfiles">
       <taskdef name="schemaexport" classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask">
         <classpath>
            <fileset dir="${dest_hibernate.root.dir}">
               <include name="**/*.class"/>
               <include name="**/*.hbm.xml"/>
            </fileset>
            <fileset dir="${origin.lib.dir}">
               <include name="hibernate2.jar"/>
               <include name="dom4j-1.4.jar"/>
               <include name="commons-logging.jar"/>
               <include name="commons-collections.jar"/>
               <include name="ojdbc14.jar"/>
            </fileset>
         </classpath>         
      </taskdef>

      <!-- Copy hbm-files to hibernate-dir -->
      <copy todir="${dest_hibernate.root.dir}">
          <fileset dir="${origin.src.dir}">
             <include name="**/*.hbm.xml"/>
          </fileset>
      </copy>
   
      <!-- Execute the schemaexport task -->
      <schemaexport
         config="${origin.src.dir}/hibernate.cfg.xml"
          quiet="no"
          text="yes"
          drop="yes"
          delimiter=";"
          output="${dest_hibernate.root.dir}/schema-export.sql">
       </schemaexport>
   </target>


My hibernate.cfg.xml:
Code:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>
    <session-factory>

      <property name="connection.url">jdbc:oracle:thin:@localhost:1521:TEST1</property>
        <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
        <property name="connection.username">TEST</property>
        <property name="connection.password">TEST</property>
      <property name="show_sql">true"</property>
      <property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>

        <!-- Mapping files -->
        <mapping resource="com/myPackage/Test.hbm.xml"/>
    </session-factory>
</hibernate-configuration>


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 19, 2004 8:50 am 
Newbie

Joined: Tue Nov 30, 2004 5:07 am
Posts: 14
I'm still got stuck with this problem. Switching back to Java 1.4 didn't change anything. I copied my *.hbm.xml to every directory in my project and it didn't help.
Still the same message:

BUILD FAILED: D:\DA\workspace\OOD\build.xml:136: Schema text failed: Resource: com/myPackage/Test.hbm.xml not found

Ideas what went wrong? Any help is appreciated.

smo


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.