-->
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: Groovy and Hibernate Tools
PostPosted: Wed Jul 29, 2009 4:26 pm 
Newbie

Joined: Thu May 21, 2009 12:20 pm
Posts: 5
I've been struggling with this issue and was wondering if anyone had any ideas:

The following code produces an NullPointerException, specifically in the HibernateToolTask.execute method on the following line:

AntClassLoader loader = getProject().createClassLoader(classPath);

I've added some debug statements to the HibernateToolTask src, and apparently the Ant project is null (i.e. getProject() returns null). Interestingly enough, the task's owningTarget (getOwningTarget()) is also null.

The groovy script that causes this error is:

webinf_classes_dir = c:\project\web\WEB-INF\classes

ant = new AntBuilder()

ant.sequential{
taskdef(
name: "hibernatetool",
classname: "org.hibernate.tool.ant.HibernateToolTask"
)
hibernatetool( destdir: "ddl" ){
jpaconfiguration()
classpath(){
path( location: "${webinf_classes_dir}" )
}
hbm2ddl(
export: "false",
update: "false",
outputfilename: "model_ddl.sql",
format: "true",
haltonerror: "false"
)
}
}
}

I have a feeling this is more in groovy's AntBuilder's task preparation but if anyone has any ideas, they would be appreciated!


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.