-->
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.  [ 1 post ] 
Author Message
 Post subject: hibernate.cfg.xml & migrating xdoclet/hibernate2.1->3
PostPosted: Tue Feb 07, 2006 9:28 pm 
Newbie

Joined: Tue Feb 07, 2006 7:15 pm
Posts: 2
Hi,

I have read the migration guide and applied all of the changes that were relevant to my project but I am having problems when trying to generate hibernate mapping xmls using xdoclet2. I followed the guide on http://www.hibernate.org/338.html#A5 to write my hibernatedoclet task and it appeared that I set it all up correctly, but when I attempt to run my xdoclet.hibernate.mapping target (shown below) I get a org.xml.sax.SAXNotRecognizedException.

Is there something obvious I have missed/forgotten/done-wrong?

Any help will be much appreciated.

Hibernate version:

Trying to go from 2.1 to 3.1

build.xml target that is failing (xdoclet.hibernate.mapping) and related targets:

<target name="init" description="Create necessary directories and sets up classpaths">
<path id="xdoclet.classpath">
<fileset dir="${lib.xdoclet.dir}" includes="*.jar"/>
<fileset dir="${lib.xdoclet.dir}/../plugins" includes="xdoclet-plugin-hibernate*.jar"/>
<fileset dir="${lib.struts.dir}" includes="*.jar"/>
<fileset dir="${env.JBOSS_HOME}/lib" includes="*.jar"/>
<fileset dir="${env.JBOSS_HOME}/client" includes="*.jar"/>
<fileset dir="${env.JBOSS_HOME}/server/default/lib" includes="javax.servlet.jar"/>
</path>
</target>

<target name="xdoclet.hibernate.mapping" depends="init">
<!-- <delete dir="${build.src.dir}" includes="**/*.hbm.xml"/>-->

<taskdef
name="hibernatedoclet"
classname="org.xdoclet.ant.XDocletTask"
classpathref="xdoclet.classpath"
/>

<hibernatedoclet>
<!-- defines the file handled by xdoclet2 -->
<fileset dir="${ejb.src.dir}">
<include name="**/model/**/*.java"/>
</fileset>
<!-- defines the processing of a plugin -->
<component
classname="org.xdoclet.plugin.hibernate.HibernateMappingPlugin"
destdir="${build.src.dir}"
version="3.0"
/>
</hibernatedoclet>
</target>

hibernate.cfg.xml:

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

<hibernate-configuration>

<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory name="java:comp/env/hibernate/SessionFactory">

<!-- properties -->
<property name="connection.datasource">java:/STOREDS</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">false</property>
<property name="use_outer_join">true</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<!-- <property name="jta.UserTransaction">java:comp/UserTransaction</property>-->
<property name="use_reflection_optimizer">false</property>
<property name="default-lazy">false</property>
<property name="transaction.manager_lookup_class">
org.hibernate.transaction.JBossTransactionManagerLookup
</property>

<!-- mapping files -->
<mapping resource="com/dodo/store/model/Dodo.hbm.xml"/>
</session-factory>

</hibernate-configuration>

Full stack trace of any exception that occurs:

[hibernatedoclet] * Generate mapping for 'Dodo' entity
[hibernatedoclet] ERROR [main] (XMLOutputValidator.java:65) - SAXException
[hibernatedoclet] org.xml.sax.SAXNotRecognizedException: Feature: http://apache.org/xml/features/validation/schema
[hibernatedoclet] at org.apache.crimson.parser.XMLReaderImpl.setFeature(XMLReaderImpl.java:219)
[hibernatedoclet] at org.dom4j.io.SAXReader.setFeature(SAXReader.java:218)
[hibernatedoclet] at org.generama.defaults.XMLOutputValidator.validate(XMLOutputValidator.java:59)
[hibernatedoclet] at org.generama.Plugin.start(Plugin.java:190)
[hibernatedoclet] at org.picocontainer.defaults.DefaultPicoContainer.start(DefaultPicoContainer.java:349)
[hibernatedoclet] at org.nanocontainer.integrationkit.LifecycleContainerBuilder.autoStart(LifecycleContainerBuilder.java:52)
[hibernatedoclet] at org.nanocontainer.integrationkit.LifecycleContainerBuilder.buildContainer(LifecycleContainerBuilder.java:45)
[hibernatedoclet] at org.nanocontainer.ant.PicoContainerTask.execute(PicoContainerTask.java:95)
[hibernatedoclet] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatedoclet] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatedoclet] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatedoclet] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatedoclet] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[hibernatedoclet] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30)
[hibernatedoclet] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatedoclet] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
[hibernatedoclet] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatedoclet] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatedoclet] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatedoclet] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatedoclet] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[hibernatedoclet] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30)
[hibernatedoclet] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatedoclet] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
[hibernatedoclet] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
[hibernatedoclet] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatedoclet] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatedoclet] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatedoclet] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatedoclet] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[hibernatedoclet] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30)
[hibernatedoclet] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatedoclet] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
[hibernatedoclet] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
[hibernatedoclet] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatedoclet] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatedoclet] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatedoclet] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatedoclet] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[hibernatedoclet] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[hibernatedoclet] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatedoclet] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)

Name and version of the database you are using:

Mysql 4.1.8


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.