db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <tfisc...@apache.org>
Subject Re: AW: Torque and OJB, Error creating database
Date Sun, 07 Aug 2005 11:11:48 GMT
Hi Stephan,

I do not think this is the cause for the error. Velocity complains about 
not being able to find the file, not about its contents. Did you check 
that the exact path given in the log files is correct ?
Also, in Torque 3.1, there is a property torque.useClasspath, which 
controls whether Torque looks for the templates in the classpath or in an 
external directory. Perhaps this property is also there in 3.0.2, if yes, 
make sure it is set to true and that the torque jar is in the classpath of 
the ant build.
Sorry I cannot be more specific, but as I said, I have no experience with 
pre 3.1-versions of Torque

     Thomas


On Thu, 4 Aug 2005, [iso-8859-1] Stephan Brüssermann wrote:

> Hello Thomas,
>
> Now I found the files. They are in the .jar-File of Torque (even in 3.0.2). I found that
the creatdb.vm contains only the text "ECHO Not implemented". Could this cause the error I
got? And do you now where I get such a file?
> Otherwise I have to explore the documentation and edit the file by myself.
>
> Stephan
>
> _________________________________________________
> Dr. Brüssermann Entwicklungs-GmbH & Co. KG
> Dr. Stephan Brüssermann
>
> Harthauser Strasse 17
> 89081 Ulm
>
> Tel.  +49(731)37 935 953
> Fax  +49(731)37 935 954
> Mobil +49(171)81 55 894
> stephan.bruessermann@db-e.de
> ___________________________________________
>
>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Thomas Fischer [mailto:fischer@seitenbau.net]
>>> Gesendet: Donnerstag, 4. August 2005 17:44
>>> An: Apache Torque Users List
>>> Betreff: AW: Torque and OJB, Error creating database
>>>
>>>
>>>
>>>
>>>
>>> Hi,
>>>
>>> The file should come with Torque. Its is strange that it is not packaged,
>>> but I have no experience with pre-3.1-versions.
>>> You can get a recent distribution of the torque generator and get the file
>>> from there. For example, you can download torque-gen-templates-3.2-rc1.jar
>>> and unpack it, you should find the file at the path which the error log
>>> says.
>>>
>>>    Thomas
>>>
>>> Stephan Brüssermann <stephan.bruessermann@db-e.de> schrieb am 04.08.2005
>>> 17:28:58:
>>>
>>>> Hello,
>>>>
>>>> I was on a business trip for two days so I can answer just now.
>>>> I use Torque 3.0.2. I didn't change any template. I use the eclipse
>>>> ant plug-in to execute the torque build file of ojb.
>>>> I searched for the sql/db-init/mssql/createdb.vm file, but I didn't
>>>> found it on my local PC. The SQL-Server runs on a server named
>>>> //srv001. How the .vm file is created? By the application or comes
>>>> it with the distribution of Torque?
>>>>
>>>> Stephan
>>>>
>>>> The error occurred at the <torque-data-model> statement list below.
>>>> <!-- ================================================================
--
>>>>
>>>>   <!-- C R E A T E  T A R G E T  D A T A B A S E
>>> -->
>>>>   <!-- ================================================================
>>> -->
>>>>   <!-- Create the target database by executing a generated script
>>> -->
>>>>   <!-- that is capable of performing the task.
>>> -->
>>>>   <!-- ================================================================
>>> -->
>>>>
>>>>   <target name="create-db-check">
>>>>     <condition property="torque.internal.manualCreation">
>>>>       <equals arg1="${torque.database.manualCreation}" arg2="true"/>
>>>>     </condition>
>>>>   </target>
>>>>
>>>>   <target
>>>>     name="create-db"
>>>>     unless="torque.internal.manualCreation"
>>>>     depends="create-db-check"
>>>>     description="==> generates the target database">
>>>>
>>>>     <torque-data-model
>>>>       controlTemplate="${torque.template.sqlDbInit}"
>>>>       outputDirectory="${torque.sql.dir}"
>>>>       outputFile="create-db.sql"
>>>>       targetDatabase="${torque.database}"
>>>>       templatePath="${torque.templatePath}"
>>>>       useClasspath="${torque.useClasspath}">
>>>>       <fileset dir="${torque.schema.dir}"
>>>>         includes="${torque.schema.create-db.includes}"
>>>>         excludes="${torque.schema.create-db.excludes}"
>>>>       />
>>>>     </torque-data-model>
>>>>
>>>> _________________________________________________
>>>> Dr. Brüssermann Entwicklungs-GmbH & Co. KG
>>>> Dr. Stephan Brüssermann
>>>>
>>>> Harthauser Strasse 17
>>>> 89081 Ulm
>>>>
>>>> Tel.  +49(731)37 935 953
>>>> Fax  +49(731)37 935 954
>>>> Mobil +49(171)81 55 894
>>>> stephan.bruessermann@db-e.de
>>>> ___________________________________________
>>>>
>>>>>> -----Ursprüngliche Nachricht-----
>>>>>> Von: Thomas Fischer [mailto:fischer@seitenbau.net]
>>>>>> Gesendet: Dienstag, 2. August 2005 10:03
>>>>>> An: Apache Torque Users List
>>>>>> Betreff: RE: Torque and OJB, Error creating database
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> It looks like one of the templates is not found (
>>>>>> sql/db-init/mssql/createdb.vm). This is strange as this template
is
>>> there
>>>>>> since Torque 3.0.1 according to CVS and the other templates (e.g.
the
>>>>>> different Control.vm) can be found. Which Torque version are you
>>> using,
>>>>>> and
>>>>>> did you modify the templates yourself, and if no, how do you access
>>> the
>>>>>> templates ? Via the classpath or in an extra directory ?
>>>>>>
>>>>>>        Thomas
>>>>>>
>>>>>> Stephan Brüssermann <stephan.bruessermann@db-e.de> schrieb
am
>>> 01.08.2005
>>>>>> 17:43:41:
>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I had installed the ojb-blank project for testing the O/R-Bridge.
>>>>>>> I'm thinking of using OJB in a development project.
>>>>>>>
>>>>>>> I established the connection to an MSSql-Server 2000. Now I try
to
>>>>>>> create the database of the ojb-blank-project using Torque. I
get the
>>>>>>> error described next.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Buildfile: C:\SvnWorkspace\inJobs\ojb-blank\build.xml
>>>>>>>
>>>>>>> compile:
>>>>>>>
>>>>>>> xdoclet:
>>>>>>>
>>>>>>> [ojbdoclet] (XDocletMain.start                   47  ) Running
>>>>>>> <ojbrepository/>
>>>>>>>
>>>>>>> [ojbdoclet] (XDocletMain.start                   47  ) Running
>>>>>> <torqueschema/>
>>>>>>>
>>>>>>> setup-db:
>>>>>>>
>>>>>>> check-use-classpath:
>>>>>>>
>>>>>>> check-run-only-on-schema-change:
>>>>>>>
>>>>>>> sql-check:
>>>>>>>
>>>>>>> sql:
>>>>>>>
>>>>>>>      [echo] +------------------------------------------+
>>>>>>>
>>>>>>>      [echo] |                                          |
>>>>>>>
>>>>>>>      [echo] | Generating SQL for YOUR Torque project!  |
>>>>>>>
>>>>>>>      [echo] | Woo hoo!                                 |
>>>>>>>
>>>>>>>      [echo] |                                          |
>>>>>>>
>>>>>>>      [echo] +------------------------------------------+
>>>>>>>
>>>>>>> sql-classpath:
>>>>>>>
>>>>>>> [torque-sql] Using contextProperties file: C:
>>>>>>> \SvnWorkspace\inJobs\ojb-blank\build.properties
>>>>>>>
>>>>>>> [torque-sql] Using classpath
>>>>>>>
>>>>>>> [torque-sql] Generating to file C:\SvnWorkspace\InJobs\ojb-
>>>>>>> blank\build\database\report.ojb_blank.sql.generation
>>>>>>>
>>>>>>> [torque-sql] Parsing file: 'ojbcore-schema.xml'
>>>>>>>
>>>>>>> [torque-sql] (transform.DTDResolver               128 ) Resolver:
>>>>>>> used database.dtd from org.apache.torque.engine.database.transform
>>>>>> package
>>>>>>>
>>>>>>> [torque-sql] Parsing file: 'project-schema.xml'
>>>>>>>
>>>>>>> [torque-sql] (transform.DTDResolver               128 ) Resolver:
>>>>>>> used database.dtd from org.apache.torque.engine.database.transform
>>>>>> package
>>>>>>>
>>>>>>> sql-template:
>>>>>>>
>>>>>>> create-db-check:
>>>>>>>
>>>>>>> create-db:
>>>>>>>
>>>>>>> [torque-data-model] Using classpath
>>>>>>>
>>>>>>> [torque-data-model] Generating to file C:\SvnWorkspace\InJobs\ojb-
>>>>>>> blank\build\database\create-db.sql
>>>>>>>
>>>>>>> [torque-data-model] Parsing file: 'ojbcore-schema.xml'
>>>>>>>
>>>>>>> [torque-data-model] (transform.DTDResolver               128
)
>>>>>>> Resolver: used database.dtd from org.apache.torque.engine.database.
>>>>>>> transform package
>>>>>>>
>>>>>>> [torque-data-model] Parsing file: 'project-schema.xml'
>>>>>>>
>>>>>>> [torque-data-model] (transform.DTDResolver               128
)
>>>>>>> Resolver: used database.dtd from org.apache.torque.engine.database.
>>>>>>> transform package
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> BUILD FAILED
>>>>>>>
>>>>>>> C:\SvnWorkspace\inJobs\ojb-blank\build.xml:180: The following
error
>>>>>>> occurred while executing this line:
>>>>>>>
>>>>>>> C:\SvnWorkspace\inJobs\ojb-blank\src\schema\build-torque.xml:300:
>>>>>>> Exception thrown by 'generator.parse'. For more information consult
>>>>>>> the velocity log, or invoke ant with the -debug flag.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Total time: 18 seconds
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> The velocity log for this error is:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> .........
>>>>>>>
>>>>>>> .........
>>>>>>>
>>>>>>> 2005-08-01 16:56:00,328 - ResourceManager : found
>>>>>>> sql/base/mssql/unique.vm with loader org.apache.velocity.runtime.
>>>>>>> resource.loader.ClasspathResourceLoader
>>>>>>>
>>>>>>> 2005-08-01 16:56:00,338 - ResourceManager : found
>>>>>>> sql/base/mssql/index.vm with loader org.apache.velocity.runtime.
>>>>>>> resource.loader.ClasspathResourceLoader
>>>>>>>
>>>>>>> 2005-08-01 16:56:00,348 - ResourceManager : found
>>>>>>> sql/base/mssql/tablefk.vm with loader org.apache.velocity.runtime.
>>>>>>> resource.loader.ClasspathResourceLoader
>>>>>>>
>>>>>>> 2005-08-01 16:56:00,358 - ResourceManager : found
>>>>>>> sql/base/mssql/foreignkey.vm with loader org.apache.velocity.
>>>>>>> runtime.resource.loader.ClasspathResourceLoader
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,873 - SimpleLog4JLogSystem initialized using
>>>>>>> logfile 'velocity.log'
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,873 -
>>>>>>> **************************************************************
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,873 - Starting Jakarta Velocity v1.3.1
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,873 - RuntimeInstance initializing.
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,873 - Default Properties File:
>>>>>>> org\apache\velocity\runtime\defaults\velocity.properties
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,873 - Trying to use logger class org.apache.
>>>>>>> velocity.runtime.log.AvalonLogSystem
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,873 - Couldn't find class org.apache.velocity.
>>>>>>> runtime.log.AvalonLogSystem or necessary supporting classes in
>>>>>>> classpath. Exception : java.lang.NoClassDefFoundError:
>>>>>>> org/apache/log/format/Formatter
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,873 - Trying to use logger class org.apache.
>>>>>>> velocity.runtime.log.SimpleLog4JLogSystem
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,873 - Using logger class org.apache.velocity.
>>>>>>> runtime.log.SimpleLog4JLogSystem
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,893 - Default ResourceManager initializing.
>>>>>>> (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,913 - Resource Loader Instantiated: org.apache.
>>>>>>> velocity.runtime.resource.loader.ClasspathResourceLoader
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,913 - ClasspathResourceLoader : initialization
>>>>>> starting.
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,913 - ClasspathResourceLoader : initialization
>>>>>> complete.
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,933 - ResourceCache : initialized. (class
org.
>>>>>>> apache.velocity.runtime.resource.ResourceCacheImpl)
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,933 - Default ResourceManager initialization
>>>>>> complete.
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,943 - Loaded System Directive: org.apache.
>>>>>>> velocity.runtime.directive.Literal
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,953 - Loaded System Directive: org.apache.
>>>>>>> velocity.runtime.directive.Macro
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,963 - Loaded System Directive: org.apache.
>>>>>>> velocity.runtime.directive.Parse
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,973 - Loaded System Directive: org.apache.
>>>>>>> velocity.runtime.directive.Include
>>>>>>>
>>>>>>> 2005-08-01 16:56:03,983 - Loaded System Directive: org.apache.
>>>>>>> velocity.runtime.directive.Foreach
>>>>>>>
>>>>>>> 2005-08-01 16:56:04,253 - Created: 20 parsers.
>>>>>>>
>>>>>>> 2005-08-01 16:56:04,253 - Velocimacro : initialization starting.
>>>>>>>
>>>>>>> 2005-08-01 16:56:04,253 - Velocimacro : adding VMs from VM library
>>>>>>> template : VM_global_library.vm
>>>>>>>
>>>>>>> 2005-08-01 16:56:04,263 - ResourceManager : unable to find resource
>>>>>>> 'VM_global_library.vm' in any resource loader.
>>>>>>>
>>>>>>> 2005-08-01 16:56:04,263 - Velocimacro : error using  VM library
>>>>>>> template VM_global_library.vm : org.apache.velocity.exception.
>>>>>>> ResourceNotFoundException: Unable to find resource
>>>>>> 'VM_global_library.vm'
>>>>>>>
>>>>>>> 2005-08-01 16:56:04,263 - Velocimacro :  VM library template
macro
>>>>>>> registration complete.
>>>>>>>
>>>>>>> 2005-08-01 16:56:04,263 - Velocimacro : allowInline = true :
VMs can
>>>>>>> be defined inline in templates
>>>>>>>
>>>>>>> 2005-08-01 16:56:04,263 - Velocimacro : allowInlineToOverride
=
>>>>>>> false : VMs defined inline may NOT replace previous VM definitions
>>>>>>>
>>>>>>> 2005-08-01 16:56:04,263 - Velocimacro : allowInlineLocal = false
:
>>>>>>> VMs defined inline will be  global in scope if allowed.
>>>>>>>
>>>>>>> 2005-08-01 16:56:04,263 - Velocimacro : messages on  : VM system
>>>>>>> will output logging messages
>>>>>>>
>>>>>>> 2005-08-01 16:56:04,263 - Velocimacro : autoload off  : VM system
>>>>>>> will not automatically reload global library macros
>>>>>>>
>>>>>>> 2005-08-01 16:56:04,263 - Velocimacro : initialization complete.
>>>>>>>
>>>>>>> 2005-08-01 16:56:04,263 - Velocity successfully started.
>>>>>>>
>>>>>>> 2005-08-01 16:56:05,044 - ResourceManager : found sql/db-
>>>>>>> init/Control.vm with loader org.apache.velocity.runtime.resource.
>>>>>>> loader.ClasspathResourceLoader
>>>>>>>
>>>>>>> 2005-08-01 16:56:05,085 - ResourceManager : unable to find resource
>>>>>>> 'sql/db-init/mssql/createdb.vm' in any resource loader.
>>>>>>>
>>>>>>> 2005-08-01 16:56:05,085 - Method parse threw exception for reference
>>>>>>> $generator in template sql/db-init/Control.vm at  [2,1]
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I use Eclipse 3.1.0, JDK 1.5.0 04 and ANT 1.6.5. I tried for
hours
>>>>>>> to find the error, but I failed.
>>>>>>>
>>>>>>> Can someone help me? Thanks for your help in advance.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Stephan Brüssermann
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> _________________________________________________
>>>>>>>
>>>>>>> Dr. Brüssermann Entwicklungs-GmbH & Co. KG
>>>>>>>
>>>>>>> Dr. Stephan Brüssermann
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Harthauser Strasse 17
>>>>>>>
>>>>>>> 89081 Ulm
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Tel.  +49(731)37 935 953
>>>>>>>
>>>>>>> Fax  +49(731)37 935 954
>>>>>>>
>>>>>>> Mobil +49(171)81 55 894
>>>>>>>
>>>>>>> stephan.bruessermann@db-e.de
>>>>>>>
>>>>>>> ___________________________________________
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> 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
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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