Estou tendo problemas com meu ANT para gerar o schema no banco de dados.
QUando roda o build, essa é a mensagem que recebo:
Buildfile: C:\java\eclipse3.02\workspace\ftu\build.xml
createtables:
[schemaexport] (cfg.Environment 483 ) Hibernate 2.1.8
[schemaexport] (cfg.Environment 517 ) loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=org.gjt.mm.mysql.Driver, hibernate.cglib.use_reflection_optimizer=true, hibernate.cache.provider_class=net.sf.hibernate.cache.EhCacheProvider, hibernate.cache.use_query_cache=true, hibernate.max_fetch_depth=1, hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.jdbc.batch_size=0, hibernate.query.substitutions=true 1, false 0, yes ‘Y’, no ‘N’, hibernate.proxool.pool_alias=pool1, hibernate.connection.username=root, hibernate.cache.region_prefix=hibernate.test, hibernate.connection.url=jdbc:mysql://localhost:3306/ftu, hibernate.connection.password=root, hibernate.jdbc.batch_versioned_data=true, hibernate.connection.pool_size=1}
[schemaexport] (cfg.Environment 542 ) using java.io streams to persist binary types
[schemaexport] (cfg.Environment 543 ) using CGLIB reflection optimizer
[schemaexport] (cfg.Environment 572 ) using JDK 1.4 java.sql.Timestamp handling
[schemaexport] (cfg.Configuration 170 ) Mapping file: C:\java\eclipse3.02\workspace\ftu\WEB-INF\classes\br\edu\ftu\models\Email.hbm.xml
[schemaexport] (cfg.Configuration 256 ) Could not compile the mapping document
[schemaexport] net.sf.hibernate.MappingException: persistent class [br.edu.ftu.models.Email] not found
[schemaexport] at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:84)
[schemaexport] at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:221)
[schemaexport] at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1256)
[schemaexport] at net.sf.hibernate.cfg.Configuration.add(Configuration.java:253)
[schemaexport] at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:175)
[schemaexport] at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.getConfiguration(SchemaExportTask.java:195)
[schemaexport] at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportTask.java:135)
[schemaexport] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[schemaexport] at org.apache.tools.ant.Task.perform(Task.java:364)
[schemaexport] at org.apache.tools.ant.Target.execute(Target.java:341)
[schemaexport] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[schemaexport] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[schemaexport] at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
[schemaexport] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:383)
[schemaexport] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:136)
[schemaexport] Caused by: java.lang.ClassNotFoundException: br.edu.ftu.models.Email
[schemaexport] at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1149)
[schemaexport] at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1090)
[schemaexport] at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:960)
[schemaexport] at java.lang.ClassLoader.loadClass(Unknown Source)
[schemaexport] at java.lang.ClassLoader.loadClassInternal(Unknown Source)
[schemaexport] at java.lang.Class.forName0(Native Method)
[schemaexport] at java.lang.Class.forName(Unknown Source)
[schemaexport] at net.sf.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:102)
[schemaexport] at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:81)
[schemaexport] … 14 more
[schemaexport] (cfg.Configuration 179 ) Could not configure datastore from file: C:\java\eclipse3.02\workspace\ftu\WEB-INF\classes\br\edu\ftu\models\Email.hbm.xml
[schemaexport] net.sf.hibernate.MappingException: persistent class [br.edu.ftu.models.Email] not found
[schemaexport] at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:84)
[schemaexport] at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:221)
[schemaexport] at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1256)
[schemaexport] at net.sf.hibernate.cfg.Configuration.add(Configuration.java:253)
[schemaexport] at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:175)
[schemaexport] at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.getConfiguration(SchemaExportTask.java:195)
[schemaexport] at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportTask.java:135)
[schemaexport] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[schemaexport] at org.apache.tools.ant.Task.perform(Task.java:364)
[schemaexport] at org.apache.tools.ant.Target.execute(Target.java:341)
[schemaexport] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[schemaexport] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[schemaexport] at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
[schemaexport] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:383)
[schemaexport] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:136)
[schemaexport] Caused by: java.lang.ClassNotFoundException: br.edu.ftu.models.Email
[schemaexport] at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1149)
[schemaexport] at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1090)
[schemaexport] at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:960)
[schemaexport] at java.lang.ClassLoader.loadClass(Unknown Source)
[schemaexport] at java.lang.ClassLoader.loadClassInternal(Unknown Source)
[schemaexport] at java.lang.Class.forName0(Native Method)
[schemaexport] at java.lang.Class.forName(Unknown Source)
[schemaexport] at net.sf.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:102)
[schemaexport] at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:81)
[schemaexport] … 14 more
BUILD FAILED: C:\java\eclipse3.02\workspace\ftu\build.xml:21: Schema text failed: net.sf.hibernate.MappingException: persistent class [br.edu.ftu.models.Email] not found
Total time: 2 seconds
Acontece que o Email.hbm.xml está no diretorio correto:
Este arquivo está assim:
<hibernate-mapping
<class
name="br.edu.ftu.models.Email"
table="email"
>
<id
name="id"
column="id"
type="long"
>
<generator class="sequence">
<param name="sequence">id_email</param>
<!--
To add non XDoclet generator parameters, create a file named
hibernate-generator-params-Email.xml
containing the additional parameters and place it in your merge dir.
-->
</generator>
</id>
<timestamp
name="timestamp"
column="TIMESTAMP"
/>
<property
name="ativo"
type="java.lang.Integer"
update="true"
insert="true"
column="ativo"
not-null="true"
/>
<property
name="principal"
type="java.lang.Integer"
update="true"
insert="true"
column="principal"
not-null="true"
/>
<property
name="provedor"
type="string"
update="true"
insert="true"
column="provedor"
length="50"
not-null="true"
/>
<property
name="conta"
type="string"
update="true"
insert="true"
column="conta"
length="50"
not-null="true"
/>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Email.xml
containing the additional properties and place it in your merge dir.
-->
</class>
O build está assim:
Quem puder, agradeço.
Ivan