You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Neil Aggarwal <ne...@JAMMConsulting.com> on 2003/09/19 22:51:59 UTC

Velocity error trying to create schema for MySQL

Hello:

When I try to generate the MySQL schema for a simple test app,
I get this error in the Velocity log:
2003-09-19 15:45:34,174 - Method load threw exception for reference
$properties in template sql/base/Control.vm at  [2,19]

Here is the target I am using to do it:
  <target name="makeDbSchema" depends="enhancePersistentClasses">
    <ant dir="." antfile="${build-torque}"
target="project-sql-classpath">
      <property name="schemaDirectory" value="build"/>
      <property name="outputDirectory" value="build"/>
    </ant>
  </target>

Here is my complete buildfile:
<project name="OjbJdoTest" default="removeExtraneous"
basedir="c:/Dev/OjbJdoTest">

  <property file="properties/build.properties"/>
  <property file="properties/mysql.profile"/>

  <property name="javalibs" location="c:/JavaLibs" />
  <property name="ojbDir" location="${javalibs}/db-ojb" />
  <property name="build-torque" location="${ojbDir}/build-torque.xml" />
  <property name="xdocletDir" location="${javalibs}/xdoclet-1.2b3" />
  <property name="ojbDocletJar"
location="${javalibs}/db-ojb-1.0.rc4/lib/xdoclet-ojb-module-1.2b3-dev.ja
r" />
  <property name="jdoriDir" location="${javalibs}/jdori-1_0" />

  <path id="build-classpath">
    <fileset dir="${ojbDir}/lib">
      <include name="*.jar"/>
     </fileset> 
    <fileset dir="${xdocletDir}/lib">
      <include name="*.jar"/>
     </fileset> 
    <fileset dir="${jdoriDir}/src">
      <include name="*.jar"/>
     </fileset> 
     <pathelement location="${ojbDocletJar}" />
  </path> 

  <target name="clean">
    <delete dir="build"/>
  </target>

  <target name="prepare" depends="clean">
    <mkdir dir="lib"/>
    <copy todir="lib">
      <fileset dir="${ojbDir}/lib"/>
    </copy>
  </target>
  
  <target name="processOjbDoclets" depends="prepare">
    <taskdef name="ojbdoclet"
classname="xdoclet.modules.ojb.OjbDocletTask"
classpathref="build-classpath"/>
    <ojbdoclet destdir="build">
      <fileset dir="src">
        <include name="persistent/*.java"/>
       </fileset> 
      <ojbrepository destinationFile="repository_user.xml"/>
      <torqueschema databaseName="ojbJdoTest"
destinationFile="project_schema.xml"/>
    </ojbdoclet>
  </target> 

  <target name="processJdoDoclets" depends="processOjbDoclets">
    <taskdef name="jdodoclet"
classname="xdoclet.modules.jdo.JdoDocletTask"
classpathref="build-classpath"/>
    <jdodoclet destdir="build">
      <fileset dir="src">
        <include name="persistent/*.java"/>
      </fileset> 
      <jdometadata jdospec="1.0" generation="class"/>
    </jdodoclet>
  </target> 

  <target name="enhancePersistentClasses" depends="processJdoDoclets">

    <pathconvert property="enhancerFiles" pathsep=" ">
      <path id="enhancerFiles">
        <fileset dir="classes">
          <include name="persistent/*.class"/>
        </fileset> 
        <fileset dir="build">
          <include name="persistent/*.jdo"/>
        </fileset> 
      </path> 
    </pathconvert>
    <java fork="yes" failonerror="yes"
      classname="com.sun.jdori.enhancer.Main"
classpathref="build-classpath">
      <arg line="-v -f -d build/classes ${enhancerFiles}" />
    </java>
  </target> 

  <target name="makeDbSchema" depends="enhancePersistentClasses">
    <ant dir="." antfile="${build-torque}"
target="project-sql-classpath">
      <property name="schemaDirectory" value="build"/>
      <property name="outputDirectory" value="build"/>
    </ant>
  </target>

  <target name="makeRepository" depends="makeDbSchema">
    <ant dir="." antfile="${build-torque}"
target="project-ojb-repository-classpath">
      <property name="schemaDirectory" value="build"/>
      <property name="outputDirectory" value="build"/>
    </ant>
  </target>
  
  <target name="removeExtraneous" depends="makeRepository">
    <delete dir="lib"/>
  </target>

</project>

Any ideas?

Thanks,	
	Neil

--
Neil Aggarwal, JAMM Consulting, (972)612-6056, www.JAMMConsulting.com
FREE! Valuable info on how your business can reduce operating costs by 
17% or more in 6 months or less! => http://newsletter.JAMMConsulting.com


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


RE: Velocity error trying to create schema for MySQL

Posted by Neil Aggarwal <ne...@JAMMConsulting.com>.
Tom:

I just realized that I had moved the mysql.profile and that
was causing velocity to barf.  

I did not check it based on the error message I got.

Thanks,
	Neil


--
Neil Aggarwal, JAMM Consulting, (972)612-6056, www.JAMMConsulting.com
FREE! Valuable info on how your business can reduce operating costs by 
17% or more in 6 months or less! => http://newsletter.JAMMConsulting.com

> -----Original Message-----
> From: Thomas Dudziak [mailto:tomdz@first.gmd.de] 
> Sent: Saturday, September 20, 2003 3:23 AM
> To: OJB Users List
> Subject: Re: Velocity error trying to create schema for MySQL
> 
> 
> First, run ant with the -v option. This should give you more 
> detailed info
> on the build process. Also, it would be good if you could post your
> repository_user.xml and project_schema.xml files.
> 
> Tom
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Velocity error trying to create schema for MySQL

Posted by Thomas Dudziak <to...@first.gmd.de>.
First, run ant with the -v option. This should give you more detailed info
on the build process. Also, it would be good if you could post your
repository_user.xml and project_schema.xml files.

Tom




---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org