• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Problem in schema export - Hibernate

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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="src.java.dir" 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>
<path id="runtime.classpath">
<path refid="project.classpath" />
<path refid="hibernate.lib.path" />
<pathelement location="${jdbc.driver.jar}" />
<pathelement location="${src.java.dir}" />
</path>
<target name="clean">
<delete dir="${build.classes.dir}" />
</target>
<target name="init">
<mkdir dir="${build.classes.dir}" />
</target>
<target name="compile" depends="init">
<javac srcdir="${src.java.dir}"
destdir="${build.classes.dir}">
<classpath refid="hibernate.lib.path" />
</javac>
<echo>If you see this, it works!!! compile done</echo>
</target>
<target name="build" depends="compile">
<java classname="com.manning.hq.ch04.EventLoader">
<classpath refid="runtime.classpath" />
</java>
</target>
<target name="schema-export" depends="compile">
<taskdef name="schemaexport"
classname="org.hibernate.tool.hbm2ddl.SchemaExportTask">
<classpath refid="runtime.classpath" />
</taskdef>
<schemaexport config="${src.java.dir}/hibernate.cfg.xml" />
<echo>If you see this, it works!!! schema done</echo>
</target>
</project>

************************

Thanks in advance
 
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how about showing the excepttion that you get ?
 
kapil patel
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
He baked a muffin that stole my car! And this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!