db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Monroe <Greg.Mon...@dukece.com>
Subject RE: [Torque] Using Torque again
Date Tue, 10 Nov 2009 14:40:07 GMT
OK, it looks like your build.properties is probably the problem.
The load statement is failing because the file it's trying to load, "sql/base/$targetDatabase/db.props"
can't be found.

The $targetDatabase variable is defined by the torque.database property
which should be defined in the build.properties.  This should be set
to one of the torque supported db types.  The common ones are:

mysql, postgresql, mssql, oracle, hypersonic

Make sure they are spelled correctly and all in lowercase.  See the
docs or the comments in the build.properties file that comes with
the distro.

One question. You've been talking about ant, and I've assumed you're
using straight ant calls. But I think you ask some Maven questions
recently. Are these ant errors coming out of the Maven2 plugin?  If so,
the "build.properties" for the Maven2 plugin are set in the
configuration tags in the plug-in section of your pom.xml.  See:

http://db.apache.org/torque/releases/torque-3.3/maven2-plugin/usage.html

For details.


> -----Original Message-----
> From: Angela Day [mailto:akcday@yahoo.com]
> Sent: Monday, November 09, 2009 6:39 PM
> To: Apache Torque Users List
> Subject: Re: [Torque] Using Torque again
>
> The velocity log says:
>
> Method load threw exception for reference $properties in template
> om/Control.vm at  [4,19]
>
> Sounds like my templates are not compatible??
>
>
> src/templates/om/Control.vm ---------------------------------------------
> --------------------
>
>
> #set ($basePath = $generator.OutputPath)
>
> #if ($targetDatabase)
>    #set ( $dbprops =
> $properties.load("sql/base/$targetDatabase/db.props") )
> #end
> #foreach ($dataModel in $dataModels)
> #foreach ($database in $dataModel.Databases)
>
>   #if ($database.Package)
>     #set ($package = $database.Package)
>   #else
>     #set ($package = $targetPackage)
>   #end
>
>   #set ( $pkbase = "${package}" )
>   #set ( $pkpeer = "${package}" )
>   #set ( $pkmap = "${package}.map" )
>
>   #set ( $extensionPath = "tdhca.om" )
>
>   $pkbase
>   $pkpeer
>   $pkmap
>
>   #set ( $path = $strings.getPackageAsPath($pkpeer) )
>   $files.mkdir("$outputDirectory/$path")
>
>   #set ( $path = $strings.getPackageAsPath($pkmap) )
>   $files.mkdir("$outputDirectory/$path")
>
>   #set ( $path = $strings.getPackageAsPath($pkbase) )
>   $files.mkdir("$outputDirectory/$path")
>
>   #set ( $path = $strings.getPackageAsPath($extensionPath) )
>   $files.mkdir("$outputDirectory/$path")
>
>
>   #foreach ($tbl in $database.Tables)
>    #if (!$tbl.isForReferenceOnly())
>     $tbl.Name
>     #set ( $firstcap=$tbl.JavaName )
>
>     #set ( $fname = "$basePrefix${firstcap}Peer.java" )
>     #set ( $path = "${strings.getPackageAsPath($pkbase)}$fname" )
>     $generator.parse("om/Peer.vm",$path,"table",$tbl)
>
>     #if (!$tbl.isAlias())
>       #set ( $fname = "${firstcap}MapBuilder.java" )
>       #set ( $path = "${strings.getPackageAsPath($pkmap)}$fname" )
>       $generator.parse("om/MapBuilder.vm",$path,"table",$tbl)
>     #end
>
> #if ($useManagers && $tbl.PrimaryKeys.size() > 0)
>
>     #set ($interfaceName = $table.JavaName)
>     #if ($table.Interface)
>         #set ($interfaceName = $table.Interface)
>     #end
>
>     #set ( $fname = "${basePrefix}${interfaceName}Manager.java" )
>     #set ( $path = "${strings.getPackageAsPath($pkbase)}$fname" )
>     $generator.parse("om/BaseManager.vm",$path,"table",$tbl)
>
>     #set ( $fname = "${interfaceName}Manager.java" )
>     #set ( $path = "${strings.getPackageAsPath($package)}$fname" )
>     #if (!$files.file($basePath,$path).exists())
>       $generator.parse("om/ExtensionManager.vm",$path,"table",$tbl)
>     #end
>
> #end
> #if ($useManagers)
>
>     #set ( $fname = "${basePrefix}${firstcap}.java" )
>     #set ( $path = "${strings.getPackageAsPath($pkbase)}$fname" )
>     $generator.parse("om/ObjectWithManager.vm",$path,"table",$tbl)
>
> #else
>
>     #set ( $fname = "${basePrefix}${firstcap}.java" )
>     #set ( $path = "${strings.getPackageAsPath($pkbase)}$fname" )
>     $generator.parse("om/Object.vm",$path,"table",$tbl)
>
> #end
>
>     #set ( $fname = "${basePrefix}${firstcap}Form.java" )
>     #set ( $path = "${strings.getPackageAsPath($pkbase)}$fname" )
>     $generator.parse("om/BaseForm.vm",$path,"table",$tbl)
>
>     #set ( $fname = "${firstcap}.java" )
>     #set ( $path = "${strings.getPackageAsPath($extensionPath)}$fname" )
>     #if (!$files.file($basePath,$path).exists())
>       $generator.parse("om/ExtensionObject.vm",$path,"table",$tbl)
>     #end
>
>     #set ( $fname = "${firstcap}Peer.java" )
>     #set ( $path = "${strings.getPackageAsPath($extensionPath)}$fname" )
>     #if (!$files.file($basePath,$path).exists())
>       $generator.parse("om/ExtensionPeer.vm",$path,"table",$tbl)
>     #end
>
>     #if ($tbl.Interface)
>
>         #set ( $fname = "${tbl.Interface}.java" )
>         #set ( $path = "${strings.getPackageAsPath($pkbase)}$fname" )
>         #if (!$files.file($basePath,$path).exists())
>             $generator.parse("om/Interface.vm",$path,"table",$tbl)
>         #end
>
>     #end
>
>     #if ($tbl.ChildrenColumn)
>       #set ($col = $tbl.ChildrenColumn)
>       #if ($col.isEnumeratedClasses())
>         #foreach ($child in $col.Children)
>         #set ( $fname = "${child.ClassName}.java" )
>         #set ( $path = "${strings.getPackageAsPath($package)}$fname" )
>         #if (!$files.file($basePath,$path).exists())
>
> $generator.parse("om/MultiExtendObject.vm",$path,"child",$child)
>         #end
>         #end
>       #end
>     #end
>    #end
>   #end
> #end
> #end
>
>
> Angela Day
> National Autism Association of Central Texas
>
> http://www.naacentraltexas.org
> formally FEAT Austin
>
>
> ________________________________
> From: Greg Monroe <Greg.Monroe@dukece.com>
> To: Apache Torque Users List <torque-user@db.apache.org>
> Sent: Mon, November 9, 2009 5:02:48 PM
> Subject: RE: [Torque] Using Torque again
>
> Read this after I sent all the other stuff...
>
> About templates:
>
> The default is for the templates to come from the torque-gen-
> templates.jar.
> As long as this is in the generator library (e.g. lib directory under
> build-torque.xml file) it should find it.
>
> About build.properties:
>
> This generally should not be empty.  At a minimum, you should copy the
> one from the distro to the same directory as the build-torque.xml file.
> Then go thru that and change basic stuff.  E.g. torque.project,
> torque.database, torque.targetPackage, and the torque.database.*
> properties.
>
> The other stuff you can look at the generator properties reference to
> understand, decide what to do with it.
>
> http://db.apache.org/torque/releases/torque-3.3/generator/properties-
> reference.html
>
> > -----Original Message-----
> > From: Angela Day [mailto:akcday@yahoo.com]
> > Sent: Monday, November 09, 2009 5:52 PM
> > To: Apache Torque Users List
> > Subject: Re: [Torque] Using Torque again
> >
> > Ok, I see how it works.  templatePath is defined as templates in the
> > default.properties file.  There is a directory called src/templates.  I
> > am assuming that it what it is pointing to.  Do I need to update
> > something in that directory maybe?
> >
> >
> > Angela Day
> > National Autism Association of Central Texas
> >
> > http://www.naacentraltexas.org
> > formally FEAT Austin
> >
> >
> >
> >
> >
> > ________________________________
> > From: Angela Day <akcday@yahoo.com>
> > To: Apache Torque Users List <torque-user@db.apache.org>
> > Sent: Mon, November 9, 2009 4:47:47 PM
> > Subject: Re: [Torque] Using Torque again
> >
> >
> > Sheldon,
> > In reviewing that section of code 'torque.templatePath' is not defined.
> > It is not defined in the template from the zip file, so I am not sure
> > what the value should be.  I think that is the line on which it is
> > failing.
> > Would you know?
> > Thanks,
> >
> >
> > Angela Day
> > National Autism Association of Central Texas
> >
> > http://www.naacentraltexas.org
> > formally FEAT Austin
> >
> >
> >
> >
> >
> > ________________________________
> > From: Sheldon Ross <sross@simmgene.com>
> > To: Apache Torque Users List <torque-user@db.apache.org>
> > Sent: Mon, November 9, 2009 4:28:24 PM
> > Subject: Re: [Torque] Using Torque again
> >
> > Ok, ant uses xml in order to define tasks. These tasks are called
> > targets. In my file the target around lines 500-530 are the targets for
> > building your OM objects, which I assume you're trying to do.
> >
> > In those targets are references to files and properties that the target
> > needs to execute.
> >
> > From my xml.
> >
> >    <torque-data-model
> >      contextProperties="${torque.contextProperties}"
> >      controlTemplate="${torque.template.dataDtd}"
> >      outputDirectory="${torque.output.dir}"
> >      outputFile="report.${torque.project}.datadtd.generation"
> >      templatePath="${torque.templatePath}"
> >      useClasspath="${torque.useClasspath}"
> >      xmlFile="${torque.schema.dir}/${torque.project}-schema.xml"
> >    />
> >
> > The "${torque.contextProperties}" file must be defined and exist (and
> > path be right) for this to execute properly If it doesn't you will get
> > errors such as you report.
> >
> > Ross
> >
> > Angela Day wrote:
> > > No, I just replaced the build-torque.xml file with the one from
> torque-
> > 3.3.zip and just made a few little adjustments on the jar files in the
> > classpath.  I updated all of my jar files to be at least as high as the
> > dependencies list from the torque website.  I updated my xxx-schema.xml
> > to point to the correct database_3_3.xml file.  Did I leave anything
> out?
> > >
> > > Thanks,
> > >
> > >  Angela Day
> > > National Autism Association of Central Texas
> > >
> > > http://www.naacentraltexas.org
> > > formally FEAT Austin
> > >
> > >
> > >
> > >
> > >
> > > ________________________________
> > > From: Sheldon Ross <sross@simmgene.com>
> > > To: Apache Torque Users List <torque-user@db.apache.org>
> > > Sent: Mon, November 9, 2009 3:51:30 PM
> > > Subject: Re: [Torque] Using Torque again
> > >
> > > >From what I understand, in newer versions of torque you should
> really
> > not be editing much in the build-torque.xml itself.
> > >
> > > At the top of your file, there should be something like this.
> > >
> > > <property name="build.properties" value="build.properties"/>
> > > <property name="torque.contextProperties"
> value="${build.properties}"/>
> > > <property file="${torque.contextProperties}"/>
> > >
> > > This specifies the properties file torque will use for configuration.
> > I'm guessing you either don't have these lines defined correctly, or
> the
> > (in this example) "build.properties" file doesn't exist.
> > >
> > >
> > > Ross
> > >
> > > Angela Day wrote:
> > >
> > >> Never mind.  I realized I was missing the torque-gen-templates-
> > 3.3.jar.  But I am still getting the original error:
> > >>
> > >> Exception thrown by 'properties.load'
> > >>
> > >> I have updated all of my jar files and specified them in the build-
> > torque.xml file.  I have updated my (project)-build.xml file.  I am not
> > getting any complaints about any of these files.  Any Help would be
> > appreciated.
> > >>
> > >> Thanks,
> > >>
> > >>  Angela Day
> > >> National Autism Association of Central Texas
> > >>
> > >> http://www.naacentraltexas.org
> > >> formally FEAT Austin
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> ________________________________
> > >> From: Angela Day <akcday@yahoo.com>
> > >> To: Apache Torque Users List <torque-user@db.apache.org>
> > >> Sent: Mon, November 9, 2009 3:18:29 PM
> > >> Subject: Re: [Torque] Using Torque again
> > >>
> > >> I have been updating the build-torque.xml file and am now getting:
> > >>
> > >> C:\workspace\contract\build-torque.xml:96: taskdef class
> > org.apache.torque.task.TorqueDataModelTask cannot be found
> > >> I have warning decoration next to all of the taskdefs.  In what jar
> > are these classes found?
> > >>
> > >>
> > >> Thanks,
> > >>
> > >> Angela Day
> > >> National Autism Association of Central Texas
> > >>
> > >> http://www.naacentraltexas.org
> > >> formally FEAT Austin
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> ________________________________
> > >> From: Sheldon Ross <sross@simmgene.com>
> > >> To: Apache Torque Users List <torque-user@db.apache.org>
> > >> Sent: Mon, November 9, 2009 3:00:29 PM
> > >> Subject: Re: [Torque] Using Torque again
> > >>
> > >> It would appear that there are significant differences in the
> > build.properties file (and/or build-torque.xml) from 1.0 to 3.3.
> > >>
> > >> My suggestion is to redo your old 1.0 build.properties file and make
> > sure it is of the proper form for 3.3 and use xml from 3.3
> > >>
> > >> Ross
> > >>
> > >> Angela Day wrote:
> > >>
> > >>> I am trying to upgrade from Torque 1.0 to 3.3.  I have replaced all
> > of the jar files and made sure my dependencies were covered.  It is an
> > existing application that
> > >>> was working until I converted, so I know it is finding the project-
> > schema.xml file
> > >>> correctly.  This question is posted on the
> > >>> internet multiple times, with no solution.  If you can help me out,
> I
> > >>> would really appreciate it.
> > >>>
> > >>>
> > >>> Thanks,
> > >>> Angela
> > >>>
> > >>>
> > >>> BUILD FAILED
> > >>> C:\workspace\contract\build.xml:157: Following error occured while
> > executing thi
> > >>> s line
> > >>> C:\workspace\contract\build-torque.xml:503: Following error occured
> > while execut
> > >>> ing this line
> > >>> C:\workspace\contract\build-torque.xml:531: Exception thrown by
> > 'properties.load
> > >>> '. For more information consult the velocity log, or invoke ant
> with
> > the -debug
> > >>> flag.
> > >>>         at
> > org.apache.tools.ant.ProjectHelper.addLocationToBuildException(Projec
> > >>> tHelper.java:537)
> > >>>         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:385)
> > >>>         at
> > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
> > >>>         at org.apache.tools.ant.Task.perform(Task.java:364)
> > >>>         at org.apache.tools.ant.Target.execute(Target.java:301)
> > >>>         at
> org.apache.tools.ant.Target.performTasks(Target.java:328)
> > >>>         at
> > org.apache.tools.ant.Project.executeTarget(Project.java:1215)
> > >>>         at
> > org.apache.tools.ant.Project.executeTargets(Project.java:1063)
> > >>>         at org.apache.tools.ant.Main.runBuild(Main.java:632)
> > >>>         at org.apache.tools.ant.Main.startAnt(Main.java:183)
> > >>>         at
> > org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
> > >>>         at
> > org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
> > >>> Caused by: C:\workspace\contract\build-torque.xml:503: Following
> > error occured w
> > >>> hile executing this line
> > >>> C:\workspace\contract\build-torque.xml:531: Exception thrown by
> > 'properties.load
> > >>> '. For more information consult the velocity log, or invoke ant
> with
> > the -debug
> > >>> flag.
> > >>>         at
> > org.apache.tools.ant.ProjectHelper.addLocationToBuildException(Projec
> > >>> tHelper.java:537)
> > >>>         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:385)
> > >>>         at
> > org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
> > >>>
> > >>>         at
> > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
> > >>>         at org.apache.tools.ant.Task.perform(Task.java:364)
> > >>>         at org.apache.tools.ant.Target.execute(Target.java:301)
> > >>>         at
> org.apache.tools.ant.Target.performTasks(Target.java:328)
> > >>>         at
> > org.apache.tools.ant.Project.executeTarget(Project.java:1215)
> > >>>         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:383)
> > >>>         ... 10 more
> > >>> Caused by: C:\workspace\contract\build-torque.xml:531: Exception
> > thrown by 'prop
> > >>> erties.load'. For more information consult the velocity log, or
> > invoke ant with
> > >>> the -debug flag.
> > >>>         at
> > org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:596)
> > >>>         at
> > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
> > >>>
> > >> -- Sheldon Ross
> > >> Software Development
> > >> American Simmental Association
> > >> sross@simmgene.com
> > >> (406)587-4531 ext 102
> > >> --------------------------------------------------------------------
> -
> > >> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> > >> For additional commands, e-mail: torque-user-help@db.apache.org
> > >>
> > >
> > >
> >
> > -- Sheldon Ross
> > Software Development
> > American Simmental Association
> > sross@simmgene.com
> > (406)587-4531 ext 102
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: torque-user-help@db.apache.org
> DukeCE Privacy Statement:
> Please be advised that this e-mail and any files transmitted with
> it are confidential communication or may otherwise be privileged or
> confidential and are intended solely for the individual or entity
> to whom they are addressed. If you are not the intended recipient
> you may not rely on the contents of this email or any attachments,
> and we ask that you please not read, copy or retransmit this
> communication, but reply to the sender and destroy the email, its
> contents, and all copies thereof immediately. Any unauthorized
> dissemination, distribution or copying of this communication is
> strictly prohibited.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org

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


Mime
View raw message