Hi.

I am using SchemaExport tool, trying to load mapping files from a Jar file as well as 
build path to drop my database tables. I get the following error when executing 
drop.schema:

Buildfile: build.xml

init:

drop.schema:
     [echo] Path: C:\FIREWALL_DEMO\build\com\bluecatnetworks\proteus\data\Rule.hbm.xml
     [echo] Path: C:\FIREWALL_DEMO\lib\mappings.jar
     [java] 0 [main] INFO cfg.Environment  - Hibernate 2.0.1
     [java] 16 [main] INFO cfg.Environment  - hibernate.properties not found
     [java] 16 [main] INFO cfg.Environment  - using CGLIB reflection optimizer
     [java] 16 [main] INFO cfg.Environment  - JVM proxy support: true
     [java] 16 [main] INFO cfg.Configuration  - Searching for mapping documents in 
jar: C:\FIREWALL_DEMO\lib\mappings.jar
     [java] Error creating schema null
     [java] java.lang.NullPointerException
     [java]     at net.sf.hibernate.cfg.Configuration.addJar(Configuration.java:299)
     [java]     at 
net.sf.hibernate.tool.hbm2ddl.SchemaExport.main(SchemaExport.java:282)

BUILD SUCCESSFUL
Total time: 2 seconds

My build target for drop.schema is:

        <!-- Drop.schema target. Drop a database tables. -->
        <target name="drop.schema" depends="init">
        <pathconvert refid="hibernate.mapping.files" property="hibernate.mappings" 
pathsep=" "/>
        <pathconvert refid="jar.hibernate.mapping.files" 
property="jar.hibernate.mappings" pathsep=" "/>
        <echo message="Path: ${hibernate.mappings}" level="info"/>
        <echo message="Path: ${jar.hibernate.mappings}" level="info"/>
            <java classname="net.sf.hibernate.tool.hbm2ddl.SchemaExport" fork="true">
                <arg line="${jar.hibernate.mappings} --drop"/>
                        <arg line="${hibernate.mappings} --drop"/>
                        <jvmarg value="-Dhibernate.dialect=${hibernate.dialect}"/>
                        <jvmarg 
value="-Dhibernate.connection.driver_class=${hibernate.connection.driver_class}"/>
                        <jvmarg 
value="-Dhibernate.connection.url=${hibernate.connection.url}"/>
                        <jvmarg 
value="-Dhibernate.connection.username=${hibernate.connection.username}"/>
                        <jvmarg 
value="-Dhibernate.connection.password=${hibernate.connection.password}"/>
                <classpath refid="classpath.ref"/>
          </java>       
        </target>

Everything is fine if I don't use a Jar file. All paths and mapping files are present 
and correct inside the Jar file.

If anyone can help me with what the problem might be I would really appreciate it.

Rgds, Graeme.


-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to