You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by "Frank W. Nolden" <fr...@maxware.nl> on 2001/04/03 18:57:11 UTC

Problem using Torque 1.1a12

Hi,

I am trying to generate MySQL tables using the latest binary of Torque 1.1a12, but I am runnin ginot problem I have not seen with previous versions. I have read that the Peer and OM were going to be integrated, but I have a strange side effect:

In the OM directory I still have the Map directory with the <tablename>MapBuilder.java files.
In the OM directory itself I have <tablename>.java, <tablename>Peer.java and a weird file named $basePrefix<tablename>.java.

In the logging I can see lots of times that the $baseprefix is not a valid reference (see below). I can also see that Torque cannot find a resource 'VM_global_library.vm' (see below also).

----------------------------------------------------------------------------------------------------------

Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro : initialization starting.
Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro : adding VMs from VM library template : VM_global_library.vm
Tue Apr 03 18:42:42 GMT+02:00 2001  [error] ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader.
Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro : error using  VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'VM_global_library.vm'
Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro : allowInline = true : VMs can be defined inline in templates
Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro : allowInlineLocal = false : VMs defined inline will be  global in scope if allowed.
Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro : messages on  : VM system will output logging messages
Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro : initialization complete.
Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocity successfully started.
Tue Apr 03 18:42:44 GMT+02:00 2001   [info] ResourceManager : found om/Control.vm with loader org.apache.velocity.runtime.resource.loader.FileResourceLoader
Tue Apr 03 18:42:44 GMT+02:00 2001   [warn] org.apache.velocity.runtime.exception.ReferenceException: reference : template = om/Control.vm [line 1,column 1] : $basePrefix is not a valid reference.
Tue Apr 03 18:42:44 GMT+02:00 2001   [info] ResourceManager : found om/Peer.vm with loader org.apache.velocity.runtime.resource.loader.FileResourceLoader

----------------------------------------------------------------------------------------------------------

In the generated SQL code for MySQL I can see that a number of problems I had in the previous version (too much ) and ,) are solved. However, I can see that a new problem has been introduced as cen be seen below:

    CUS_Location_Code VARCHAR (50),
    CUS_Hash VARCHAR (32) NOT NULL,
    PRIMARY KEY(CUS_ID),
    FOREIGN KEY (CUS_BOF_ID) REFERENCES BOF (BOF_ID
);

Failing ) after the Foreign Key definition

    AUE_Hash VARCHAR (32) NOT NULL,
    PRIMARY KEY(AUE_ID
);

Also failing ) after the Primary Key definition

Where the following is OK:

    PRIMARY KEY(CPF_ID),
    INDEX CPF_Format (CPF_Format)
        ,INDEX CPF_Version (CPF_Version)
   
);

Since I am not very experienced in the source code I was wondering if anyone could help me out here?
Many many thanks in advance,

Frank Nolden


Re: Problem using Torque 1.1a12

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
> "Frank W. Nolden" wrote:

> 
> In the logging I can see lots of times that the $baseprefix is not a
> valid reference (see below). I can also see that Torque cannot find a
> resource 'VM_global_library.vm' (see below also).

That's the default Velocimacro library that Velocity will try to load at
startup.  There is no harm in it failing.  If the message really bothers
you, you can clear the appropriate property before init()-ing Velocity,
but I really wouldn't worry about it.

geir

-- 
Geir Magnusson Jr.                               geirm@optonline.net
Developing for the web?  See http://jakarta.apache.org/velocity/

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: Problem using Torque 1.1a12

Posted by kidong <Ki...@public.uni-hamburg.de>.
hello frank,

I don't understand your problem completely, but it might be helpful.

   check VM_global_library.vm file which should be located in directory TDK_HOME/webapps/templates.      
   In TurbineResource.properties, the property looks like following:
       services.TurbineVelocityService.velocimacro.library = VM_global_library.vm
   if you don't want to use it, comment it.

>In the logging I can see lots of times that the $baseprefix is not a valid reference (see below). I can also see that Torque cannot find a resource >'VM_global_library.vm' (see below also).


  sql file which is automatically generated by torque is not complete to create database table for mysql, 
  it should be appended to the end of sql like ")"       
   
create table CUS
(
    ...
    CUS_Location_Code VARCHAR (50),
    CUS_Hash VARCHAR (32) NOT NULL,
    PRIMARY KEY(CUS_ID),
    FOREIGN KEY (CUS_BOF_ID) REFERENCES BOF (BOF_ID)    // here 
);



Re: Problem using Torque 1.1a12

Posted by "Frank W. Nolden" <fr...@maxware.nl>.
Hi All,

thanks for your prompt reponses. I have come down to the following:

I was using the props file of the previous build, which did not contain the basePrefix setting. Using the newest props file solved this problem.
The error with 'VM_global_library.vm'  I can ignore, which I am doing at the moment.

Leaves me one problem that the SQL code is incorrectly generated. It has been improved over the previous version, but there are still a few ")" missing. This is according to the following list:

>     CUS_Location_Code VARCHAR (50),
>     CUS_Hash VARCHAR (32) NOT NULL,
>     PRIMARY KEY(CUS_ID),
>     FOREIGN KEY (CUS_BOF_ID) REFERENCES BOF (BOF_ID
> );
> Failing ) after the Foreign Key definition
> 
>     AUE_Hash VARCHAR (32) NOT NULL,
>     PRIMARY KEY(AUE_ID
> );
> Also failing ) after the Primary Key definition
> 
> Where the following is OK:
> 
>     PRIMARY KEY(CPF_ID),
>     INDEX CPF_Format (CPF_Format)
>         ,INDEX CPF_Version (CPF_Version)
> 
> );

The answer kidong has given me was the same I thought of, but it does not solve the cause. That should be somewhere in the generating code. Maybe something for a next release. If I have the time I can have a look where it goes wrong.
Regards and thanks sofar,

Frank
  ----- Original Message ----- 
  From: John McNally 
  To: turbine-dev@jakarta.apache.org 
  Sent: Tuesday, April 03, 2001 19:10
  Subject: Re: Problem using Torque 1.1a12


  There should be an entry in torque.props related to $basePrefix.

  > "Frank W. Nolden" wrote:
  > 
  > Hi,
  > 
  > I am trying to generate MySQL tables using the latest binary of Torque
  > 1.1a12, but I am runnin ginot problem I have not seen with previous
  > versions. I have read that the Peer and OM were going to be
  > integrated, but I have a strange side effect:
  > 
  > In the OM directory I still have the Map directory with the
  > <tablename>MapBuilder.java files.
  > In the OM directory itself I have <tablename>.java,
  > <tablename>Peer.java and a weird file named
  > $basePrefix<tablename>.java.
  > 
  > In the logging I can see lots of times that the $baseprefix is not a
  > valid reference (see below). I can also see that Torque cannot find a
  > resource 'VM_global_library.vm' (see below also).
  > 
  > ----------------------------------------------------------------------------------------------------------
  > 
  > Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro :
  > initialization starting.
  > Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro : adding VMs
  > from VM library template : VM_global_library.vm
  > Tue Apr 03 18:42:42 GMT+02:00 2001  [error] ResourceManager : unable
  > to find resource 'VM_global_library.vm' in any resource loader.
  > Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro : error using
  > VM library template VM_global_library.vm :
  > org.apache.velocity.exception.ResourceNotFoundException: Unable to
  > find resource 'VM_global_library.vm'
  > Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro : allowInline
  > = true : VMs can be defined inline in templates
  > Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro :
  > allowInlineToOverride = false : VMs defined inline may NOT replace
  > previous VM definitions
  > Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro :
  > allowInlineLocal = false : VMs defined inline will be  global in scope
  > if allowed.
  > Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro : messages on
  > : VM system will output logging messages
  > Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro :
  > initialization complete.
  > Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocity successfully
  > started.
  > Tue Apr 03 18:42:44 GMT+02:00 2001   [info] ResourceManager : found
  > om/Control.vm with loader
  > org.apache.velocity.runtime.resource.loader.FileResourceLoader
  > Tue Apr 03 18:42:44 GMT+02:00 2001   [warn]
  > org.apache.velocity.runtime.exception.ReferenceException: reference :
  > template = om/Control.vm [line 1,column 1] : $basePrefix is not a
  > valid reference.
  > Tue Apr 03 18:42:44 GMT+02:00 2001   [info] ResourceManager : found
  > om/Peer.vm with loader
  > org.apache.velocity.runtime.resource.loader.FileResourceLoader
  > ----------------------------------------------------------------------------------------------------------
  > 
  > In the generated SQL code for MySQL I can see that a number of
  > problems I had in the previous version (too much ) and ,) are solved.
  > However, I can see that a new problem has been introduced as cen be
  > seen below:
  > 
  >     CUS_Location_Code VARCHAR (50),
  >     CUS_Hash VARCHAR (32) NOT NULL,
  >     PRIMARY KEY(CUS_ID),
  >     FOREIGN KEY (CUS_BOF_ID) REFERENCES BOF (BOF_ID
  > );
  > Failing ) after the Foreign Key definition
  > 
  >     AUE_Hash VARCHAR (32) NOT NULL,
  >     PRIMARY KEY(AUE_ID
  > );
  > Also failing ) after the Primary Key definition
  > 
  > Where the following is OK:
  > 
  >     PRIMARY KEY(CPF_ID),
  >     INDEX CPF_Format (CPF_Format)
  >         ,INDEX CPF_Version (CPF_Version)
  > 
  > );
  > Since I am not very experienced in the source code I was wondering if
  > anyone could help me out here?
  > Many many thanks in advance,
  > 
  > Frank Nolden
  >

  ---------------------------------------------------------------------
  To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
  For additional commands, e-mail: turbine-dev-help@jakarta.apache.org



Re: Problem using Torque 1.1a12

Posted by Jason van Zyl <jv...@apache.org>.
John McNally wrote:
> 
> There should be an entry in torque.props related to $basePrefix.

In the TDK there is no torque.props. All the properties for your
project are located in your <project>.properties file. The basePrefix
property is in there and that's what torque uses in the TDK.
-- 
jvz.

Jason van Zyl
jvanzyl@apache.org

http://jakarta.apache.org/velocity
http://jakarta.apache.org/turbine
http://tambora.zenplex.org

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: Problem using Torque 1.1a12

Posted by John McNally <jm...@collab.net>.
There should be an entry in torque.props related to $basePrefix.

> "Frank W. Nolden" wrote:
> 
> Hi,
> 
> I am trying to generate MySQL tables using the latest binary of Torque
> 1.1a12, but I am runnin ginot problem I have not seen with previous
> versions. I have read that the Peer and OM were going to be
> integrated, but I have a strange side effect:
> 
> In the OM directory I still have the Map directory with the
> <tablename>MapBuilder.java files.
> In the OM directory itself I have <tablename>.java,
> <tablename>Peer.java and a weird file named
> $basePrefix<tablename>.java.
> 
> In the logging I can see lots of times that the $baseprefix is not a
> valid reference (see below). I can also see that Torque cannot find a
> resource 'VM_global_library.vm' (see below also).
> 
> ----------------------------------------------------------------------------------------------------------
> 
> Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro :
> initialization starting.
> Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro : adding VMs
> from VM library template : VM_global_library.vm
> Tue Apr 03 18:42:42 GMT+02:00 2001  [error] ResourceManager : unable
> to find resource 'VM_global_library.vm' in any resource loader.
> Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro : error using
> VM library template VM_global_library.vm :
> org.apache.velocity.exception.ResourceNotFoundException: Unable to
> find resource 'VM_global_library.vm'
> Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro : allowInline
> = true : VMs can be defined inline in templates
> Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro :
> allowInlineToOverride = false : VMs defined inline may NOT replace
> previous VM definitions
> Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro :
> allowInlineLocal = false : VMs defined inline will be  global in scope
> if allowed.
> Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro : messages on
> : VM system will output logging messages
> Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocimacro :
> initialization complete.
> Tue Apr 03 18:42:42 GMT+02:00 2001   [info] Velocity successfully
> started.
> Tue Apr 03 18:42:44 GMT+02:00 2001   [info] ResourceManager : found
> om/Control.vm with loader
> org.apache.velocity.runtime.resource.loader.FileResourceLoader
> Tue Apr 03 18:42:44 GMT+02:00 2001   [warn]
> org.apache.velocity.runtime.exception.ReferenceException: reference :
> template = om/Control.vm [line 1,column 1] : $basePrefix is not a
> valid reference.
> Tue Apr 03 18:42:44 GMT+02:00 2001   [info] ResourceManager : found
> om/Peer.vm with loader
> org.apache.velocity.runtime.resource.loader.FileResourceLoader
> ----------------------------------------------------------------------------------------------------------
> 
> In the generated SQL code for MySQL I can see that a number of
> problems I had in the previous version (too much ) and ,) are solved.
> However, I can see that a new problem has been introduced as cen be
> seen below:
> 
>     CUS_Location_Code VARCHAR (50),
>     CUS_Hash VARCHAR (32) NOT NULL,
>     PRIMARY KEY(CUS_ID),
>     FOREIGN KEY (CUS_BOF_ID) REFERENCES BOF (BOF_ID
> );
> Failing ) after the Foreign Key definition
> 
>     AUE_Hash VARCHAR (32) NOT NULL,
>     PRIMARY KEY(AUE_ID
> );
> Also failing ) after the Primary Key definition
> 
> Where the following is OK:
> 
>     PRIMARY KEY(CPF_ID),
>     INDEX CPF_Format (CPF_Format)
>         ,INDEX CPF_Version (CPF_Version)
> 
> );
> Since I am not very experienced in the source code I was wondering if
> anyone could help me out here?
> Many many thanks in advance,
> 
> Frank Nolden
>

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org