You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Eric Dobbs <er...@dobbse.net> on 2002/03/08 01:16:11 UTC

[torque] *Manager.vm breaks the generation of our OM

Hi All.

Background:  I'm trying to move our T2.1 app to use Torque.  So I
updated from CVS this morning, 'ant dist', then expanded the .zip
and moved my 2.1 schema into torque/schema.  I make minor
adjustments to the schema files:  changed the DOCTYPE and removed
<app-data> tags.  That made them validate correctly against the
DTD.

But torque wouldn't build our OM.

Ant reported:
<ant-error>
~/torque % ant
<snip/>
BUILD FAILED

/Users/dobbs/torque/build.xml:431: Exception thrown by 
'generator.parse'. For more inform\
ation consult the velocity log, or invoke ant with the -debug flag.
</ant-error>

velocity.log ended with these errors:
<velocity.log>
2002-03-07 16:54:27,896 - ResourceManager : unable to find resource 
'om/ExtensionManager.vm' in any resource loader.
2002-03-07 16:54:27,900 - Method parse threw exception for reference 
$generator in template om/Control.vm at  [64,7]
</velocity.log>

I scoured our schema for a long time without discovering the
problem.  Finally I modified om/Control.vm and got our OM to
generate.

Here's the modifications I had to make to get Torque to build
our OM:
<unidiff>
--- Control-broken.vm   Thu Mar  7 09:48:31 2002
+++ Control-works.vm    Thu Mar  7 16:37:29 2002
@@ -48,20 +48,10 @@
      #set ( $path = "${strings.getPackageAsPath($pkbase)}$fname" )
      $generator.parse("om/Object.vm",$path,"table",$tbl)

-    #set ( $fname = "${basePrefix}${firstcap}Manager.java" )
-    #set ( $path = "${strings.getPackageAsPath($pkbase)}$fname" )
-    $generator.parse("om/BaseManager.vm",$path,"table",$tbl)
-
      #set ( $fname = "${firstcap}.java" )
      #set ( $path = "${strings.getPackageAsPath($package)}$fname" )
      #if (!$files.file($basePath,$path).exists())
        $generator.parse("om/ExtensionObject.vm",$path,"table",$tbl)
-    #end
-
-    #set ( $fname = "${firstcap}Manager.java" )
-    #set ( $path = "${strings.getPackageAsPath($package)}$fname" )
-    #if (!$files.file($basePath,$path).exists())
-      $generator.parse("om/ExtensionManager.vm",$path,"table",$tbl)
      #end

      #set ( $fname = "${firstcap}Peer.java" )
</unidiff>


The BaseXXXManager and XXXManager is new.  Looks like it's supposed
to be used in conjunction with JCS for caching OM objects.  Would
anyone mind if I make that stuff optional?  A property in
build.properties that I can override in my ~/build.properties?

-Eric

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [torque] *Manager.vm breaks the generation of our OM

Posted by Daniel Rall <dl...@finemaltcoding.com>.
John McNally <jm...@collab.net> writes:

> I am opposed to adding another configuration parameter to turn off
> the Managers.  It is not required that you use them in your code,
> but they will be used internally.

+1

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [torque] *Manager.vm breaks the generation of our OM

Posted by John McNally <jm...@collab.net>.
Not sure why you would be getting errors, the Manager classes have built
fine for others, so I don't think I missed anything.  I am opposed to
adding another configuration parameter to turn off the Managers.  It is
not required that you use them in your code, but they will be used
internally.  The flags that are in the templates already, such as
addSaveMethod and complexObjectModel already make the templates very
complex.  If you do not configure the cache, the Managers just wrap
calls to Peer.retrieveByPK.

john mcnally

Eric Dobbs wrote:
> 
> Hi All.
> 
> Background:  I'm trying to move our T2.1 app to use Torque.  So I
> updated from CVS this morning, 'ant dist', then expanded the .zip
> and moved my 2.1 schema into torque/schema.  I make minor
> adjustments to the schema files:  changed the DOCTYPE and removed
> <app-data> tags.  That made them validate correctly against the
> DTD.
> 
> But torque wouldn't build our OM.
> 
> Ant reported:
> <ant-error>
> ~/torque % ant
> <snip/>
> BUILD FAILED
> 
> /Users/dobbs/torque/build.xml:431: Exception thrown by
> 'generator.parse'. For more inform\
> ation consult the velocity log, or invoke ant with the -debug flag.
> </ant-error>
> 
> velocity.log ended with these errors:
> <velocity.log>
> 2002-03-07 16:54:27,896 - ResourceManager : unable to find resource
> 'om/ExtensionManager.vm' in any resource loader.
> 2002-03-07 16:54:27,900 - Method parse threw exception for reference
> $generator in template om/Control.vm at  [64,7]
> </velocity.log>
> 
> I scoured our schema for a long time without discovering the
> problem.  Finally I modified om/Control.vm and got our OM to
> generate.
> 
> Here's the modifications I had to make to get Torque to build
> our OM:
> <unidiff>
> --- Control-broken.vm   Thu Mar  7 09:48:31 2002
> +++ Control-works.vm    Thu Mar  7 16:37:29 2002
> @@ -48,20 +48,10 @@
>       #set ( $path = "${strings.getPackageAsPath($pkbase)}$fname" )
>       $generator.parse("om/Object.vm",$path,"table",$tbl)
> 
> -    #set ( $fname = "${basePrefix}${firstcap}Manager.java" )
> -    #set ( $path = "${strings.getPackageAsPath($pkbase)}$fname" )
> -    $generator.parse("om/BaseManager.vm",$path,"table",$tbl)
> -
>       #set ( $fname = "${firstcap}.java" )
>       #set ( $path = "${strings.getPackageAsPath($package)}$fname" )
>       #if (!$files.file($basePath,$path).exists())
>         $generator.parse("om/ExtensionObject.vm",$path,"table",$tbl)
> -    #end
> -
> -    #set ( $fname = "${firstcap}Manager.java" )
> -    #set ( $path = "${strings.getPackageAsPath($package)}$fname" )
> -    #if (!$files.file($basePath,$path).exists())
> -      $generator.parse("om/ExtensionManager.vm",$path,"table",$tbl)
>       #end
> 
>       #set ( $fname = "${firstcap}Peer.java" )
> </unidiff>
> 
> The BaseXXXManager and XXXManager is new.  Looks like it's supposed
> to be used in conjunction with JCS for caching OM objects.  Would
> anyone mind if I make that stuff optional?  A property in
> build.properties that I can override in my ~/build.properties?
> 
> -Eric
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [torque] *Manager.vm breaks the generation of our OM

Posted by Age Mooy <am...@home.nl>.
Which version (date of jar) of Velocity are you using ?
I get the same error message running my own subclass of TexenTask with all versions of the
velocity-0.3-dev.jar later than 15-02-2002. The 15-02-2002 version that you get with "ant update-jars" gives
me no problems with either Torque or other TexenTasks

Age

> -----Original Message-----
> From: Eric Dobbs [mailto:eric@dobbse.net]
> Sent: Friday, March 08, 2002 01:16
> To: turbine-dev@jakarta.apache.org
> Subject: [torque] *Manager.vm breaks the generation of our OM
>
>
> Hi All.
>
> Background:  I'm trying to move our T2.1 app to use Torque.  So I
> updated from CVS this morning, 'ant dist', then expanded the .zip
> and moved my 2.1 schema into torque/schema.  I make minor
> adjustments to the schema files:  changed the DOCTYPE and removed
> <app-data> tags.  That made them validate correctly against the
> DTD.
>
> But torque wouldn't build our OM.
>
> Ant reported:
> <ant-error>
> ~/torque % ant
> <snip/>
> BUILD FAILED
>
> /Users/dobbs/torque/build.xml:431: Exception thrown by
> 'generator.parse'. For more inform\
> ation consult the velocity log, or invoke ant with the -debug flag.
> </ant-error>
>
> velocity.log ended with these errors:
> <velocity.log>
> 2002-03-07 16:54:27,896 - ResourceManager : unable to find resource
> 'om/ExtensionManager.vm' in any resource loader.
> 2002-03-07 16:54:27,900 - Method parse threw exception for reference
> $generator in template om/Control.vm at  [64,7]
> </velocity.log>
>
> I scoured our schema for a long time without discovering the
> problem.  Finally I modified om/Control.vm and got our OM to
> generate.
>
> Here's the modifications I had to make to get Torque to build
> our OM:
> <unidiff>
> --- Control-broken.vm   Thu Mar  7 09:48:31 2002
> +++ Control-works.vm    Thu Mar  7 16:37:29 2002
> @@ -48,20 +48,10 @@
>       #set ( $path = "${strings.getPackageAsPath($pkbase)}$fname" )
>       $generator.parse("om/Object.vm",$path,"table",$tbl)
>
> -    #set ( $fname = "${basePrefix}${firstcap}Manager.java" )
> -    #set ( $path = "${strings.getPackageAsPath($pkbase)}$fname" )
> -    $generator.parse("om/BaseManager.vm",$path,"table",$tbl)
> -
>       #set ( $fname = "${firstcap}.java" )
>       #set ( $path = "${strings.getPackageAsPath($package)}$fname" )
>       #if (!$files.file($basePath,$path).exists())
>         $generator.parse("om/ExtensionObject.vm",$path,"table",$tbl)
> -    #end
> -
> -    #set ( $fname = "${firstcap}Manager.java" )
> -    #set ( $path = "${strings.getPackageAsPath($package)}$fname" )
> -    #if (!$files.file($basePath,$path).exists())
> -      $generator.parse("om/ExtensionManager.vm",$path,"table",$tbl)
>       #end
>
>       #set ( $fname = "${firstcap}Peer.java" )
> </unidiff>
>
>
> The BaseXXXManager and XXXManager is new.  Looks like it's supposed
> to be used in conjunction with JCS for caching OM objects.  Would
> anyone mind if I make that stuff optional?  A property in
> build.properties that I can override in my ~/build.properties?
>
> -Eric
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>