Hi,
I am trying to run a hibernatetool Ant task with an HQL query. Getting this exception:
Code:
[hibernatetool] An exception occurred while running exporter #2:query (Executes queries)
[hibernatetool] To get the full stack trace run ant with -verbose
[hibernatetool] java.lang.NullPointerException
BUILD FAILED
C:\work\hib_tools\build.xml:9: java.lang.NullPointerException
at org.hibernate.tool.ant.HibernateToolTask.reportException(HibernateToolTask.java:194)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:163)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.lang.NullPointerException
at org.hibernate.tool.hbm2x.QueryExporter.doStart(QueryExporter.java:66)
at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:93)
at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40)
at org.hibernate.tool.ant.QueryExporterTask.execute(QueryExporterTask.java:89)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:160)
... 12 more
--- Nested Exception ---
java.lang.NullPointerException
at org.hibernate.tool.hbm2x.QueryExporter.doStart(QueryExporter.java:66)
at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:93)
at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40)
at org.hibernate.tool.ant.QueryExporterTask.execute(QueryExporterTask.java:89)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:160)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
I am using Hibernate 3.0, HibernateTools 3.1 beta.
I have a pretty basic configuration file:
Code:
<?xml version="1.0" ?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.username">[uid]</property>
<property name="connection.password">[pwd]</property>
<property name="connection.url">jdbc:oracle:thin:@[host]:[port]:[instance]</property>
<property name="connection.driver_class">oracle.jdbc.OracleDriver</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<mapping resource="[Class].hbm.xml"/>, etc.
</session-factory>
</hibernate-configuration>
When I look at the Ant trace, I see this line:
Code:
[hibernatetool] May 22, 2006 4:09:20 PM org.hibernate.cfg.Configuration doConfigure
[hibernatetool] INFO: Configured SessionFactory: null
Does it mean it cannot configure the session?
Any help would be appreciated.
Thanks.