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!
|