-->
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.  [ 3 posts ] 
Author Message
 Post subject: SchemaExportTask java.lang.NullPointerException
PostPosted: Fri May 07, 2004 2:42 am 
Newbie

Joined: Fri May 07, 2004 2:18 am
Posts: 19
Hello

Using hibernate 2.1.3 I am having a problem when running SchemaExportTask on any java class file with the the following tag or similar
I have tried this with files I have created and with examples I have copied and pasted from the net
If I use the example from the hibernate docs involving the cat from this url
http://www.hibernate.org/hib_docs/refer ... es-xdoclet
and I leave this tag
/**
* @hibernate.set
* lazy="true"
* order-by="BIRTH_DATE"
* @hibernate.collection-key
* column="PARENT_ID"
* @hibernate.collection-one-to-many
*/
I get this error

Schema text failed: java.lang.NullPointerException
If I remove the tag it works perfectly
It seems to be only with the @hibernate.set tag

Here is the relevant portion from my ant build.xml
<target name="schematodatabase" >

<taskdef name="schemaexport"
classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask">
<classpath>
<pathelement path="${obj-dir}"/>
<pathelement path="${etc-dir}"/>
<fileset dir="${jar-dir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</taskdef>
<schemaexport
quiet="no"
text="yes"
drop="no"
delimiter=";"
output="${generated.home}/schema-export.sql">
<fileset dir="${generated.home}">
<include name="**/*.hbm.xml"/>
</fileset>
</schemaexport>
</target>

And here is my hibernate.properties

hibernate.connection.driver_class=org.postgresql.Driver
hibernate.connection.url=jdbc\:postgresql\://mzrsync/jubilee
hibernate.connection.username=postgres
hibernate.connection.password=
hibernate.connection.pool_size=10
hibernate.dialect=net.sf.hibernate.dialect.PostgreSQLDialect
hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N'
hibernate.c3p0.minPoolSize=5
hibernate.c3p0.maxPoolSize=20
hibernate.c3p0.timeout=1800
hibernate.c3p0.max_statement=50

I have tried redownloading hibernate and xdoclet and everything I can think of. I have no log files to show you

Marcus


Top
 Profile  
 
 Post subject: My Mistake
PostPosted: Sat May 08, 2004 3:56 pm 
Newbie

Joined: Fri May 07, 2004 2:18 am
Posts: 19
Please ignore this post. I worked through it and realized that I had forgotten this
<!-- Upgrade grammar from Hibernate1 to Hibernate2 -->
<replace dir="${generated.home}">
<include name="**/*.hbm.xml"/>
<replacefilter token="readonly=" value="inverse="/>
<replacefilter token="role=" value="name="/>
<replacefilter token="hibernate-mapping-1.1.dtd" value="hibernate-mapping-2.0.dtd"/>
<replacefilter token="DTD 1.1//EN" value="DTD 2.0//EN"/>
</replace>

in my ant build file. Basically Xdoclets doesnt do hibernate version 2 and you need to do the above substitutions for it to parse corrrectly.
Also is there any way to get debugging info out of xdoclet. The error messages are useless


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 08, 2004 3:59 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
<hibernate version="2.0"/>

http://www.hibernate.org/72.html

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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