File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes Problem in schema export - Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Problem in schema export - Hibernate" Watch "Problem in schema export - Hibernate" New topic

Problem in schema export - Hibernate

kapil patel
Ranch Hand

Joined: Sep 30, 2005
Posts: 33
Hello friends,
I am not able to understand where is the problem?? I run the program without exporting schema/Ant script it is working fine... However, when I try to use ant script for exporting schema. following error occurs:

NullPointerException. I know it is presummed that there is some null value. But error is from Ant script directly so I am not able to debug.. Can anyone help me please??

<?xml version="1.0"?>
<project name="build4.xml" default="build">
<property name="" value="src/java" />
<property name="build.classes.dir" value="build/classes" />
<property name="hibernate.version" value="3.1" />
<property name="mysql.jdbc.version" value="3.1.12" />
<property name="applications.dir" location="/applications" />
<property name="hibernate.lib.dir"
value="${applications.dir}/hibernate-${hibernate.version}" />
<property name="jdbc.driver.jar"
value="${applications.dir}/mysql-connector-java-${mysql.jdbc.version}/mysql-connector-java-${mysql.jdbc.version}-bin.jar" />
<import file="hibernate-build.xml" />
<path id="project.classpath">
<pathelement location="${build.classes.dir}" />
<path id="runtime.classpath">
<path refid="project.classpath" />
<path refid="hibernate.lib.path" />
<pathelement location="${jdbc.driver.jar}" />
<pathelement location="${}" />
<target name="clean">
<delete dir="${build.classes.dir}" />
<target name="init">
<mkdir dir="${build.classes.dir}" />
<target name="compile" depends="init">
<javac srcdir="${}"
<classpath refid="hibernate.lib.path" />
<echo>If you see this, it works!!! compile done</echo>
<target name="build" depends="compile">
<java classname="com.manning.hq.ch04.EventLoader">
<classpath refid="runtime.classpath" />
<target name="schema-export" depends="compile">
<taskdef name="schemaexport"
<classpath refid="runtime.classpath" />
<schemaexport config="${}/hibernate.cfg.xml" />
<echo>If you see this, it works!!! schema done</echo>


Thanks in advance
pascal betz
Ranch Hand

Joined: Jun 19, 2001
Posts: 547
how about showing the excepttion that you get ?
kapil patel
Ranch Hand

Joined: Sep 30, 2005
Posts: 33
Hi pascal,

I have found following exception only;

BUILD FAILED: C:\d\software\eclipse\workspace\NewCalendarProject\build4.xml:44: java.lang.NullPointerException


I figured out there is problme because of Schemaexport.. It is expecting some parameter not to be null... But I dont know what??

If you know, please do let me know
I agree. Here's the link:
subject: Problem in schema export - Hibernate
It's not a secret anymore!