Hi.

env
linux2.4
mysql


I can build a bookstore app with torque-b3   but not with torque-b4.

I'm unhappy with torque-b3 because it doesn't speak correctly and
reliably for me to mutliple databases, which appears to be the problem
of commons-jdbc2pool-1.0-dev.jar when jdbc connection is booked

eg. FooPeer.doSelect(new Criteria("myfirstdb")

produces SqlException because
org.apache.torque.dsfactory.TorqueDataSourceFactory.getDataSource()

booked jdbc connections  for "myseconddb"  !!



torque-b4 doesn't have this jar in its lib  and i was able to read data
from multiple databases in a spike code in a newapp  from the fresh 
tdk-2.2-b3 . 

my interest in getting a standalone Torque working is driven 
to test my om related methods before moving them to a webapp.

so in torque-b4

ant -f build-torque.xml om  works fine

ant -f build-torque.xml sql

gives exception

as can be seen  below a path for templates/sql/basemysql/db.props is not
parsed correctly

I've also  included  my build.properties  file


If somebody managed to build bookstore app with torque-b4, can he/she
post a working build.properties  file? 

regards.

Slava


############################
[torque-sql] java.lang.NullPointerException
[torque-sql]    at java.io.Reader.<init>(Reader.java:61)
[torque-sql]    at
java.io.InputStreamReader.<init>(InputStreamReader.java:80)
[torque-sql]    at java.util.Properties.load(Properties.java:189)
[torque-sql]    at
org.apache.torque.engine.database.model.AppData.getIdiosyncrasies(AppData.java:163)
[torque-sql]    at
org.apache.torque.engine.database.model.Database.getProperty(Database.java:357)
[torque-sql]    at
org.apache.torque.engine.database.model.ConstraintNameGenerator.generateName(ConstraintNameGenerator.java:99)
[torque-sql]    at
org.apache.torque.engine.database.model.NameFactory.generateName(NameFactory.java:149)
[torque-sql]    at
org.apache.torque.engine.database.model.Table.acquireConstraintName(Table.java:311)
[torque-sql]    at
org.apache.torque.engine.database.model.Table.doNaming(Table.java:268)
[torque-sql]    at
org.apache.torque.engine.database.model.Table.loadedFromXML(Table.java:203)
[torque-sql]    at
org.apache.torque.engine.database.transform.XmlToAppData.endElement(XmlToAppData.java:396)
[torque-sql]    at
org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1536)
[torque-sql]    at
org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
[torque-sql]    at
org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
[torque-sql]    at
org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
[torque-sql]    at
org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
[torque-sql]    at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
[torque-sql]    at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
[torque-sql]    at
org.apache.torque.engine.database.transform.XmlToAppData.parseFile(XmlToAppData.java:164)
[torque-sql]    at
org.apache.torque.task.TorqueDataModelTask.initControlContext(TorqueDataModelTask.java:335)
[torque-sql]    at
org.apache.torque.task.TorqueSQLTask.initControlContext(TorqueSQLTask.java:204)
[torque-sql]    at
org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:480)
[torque-sql]    at org.apache.tools.ant.Task.perform(Task.java:217)
[torque-sql]    at org.apache.tools.ant.Target.execute(Target.java:184)
[torque-sql]    at
org.apache.tools.ant.Target.performTasks(Target.java:202)
[torque-sql]    at
org.apache.tools.ant.Project.executeTarget(Project.java:601)
[torque-sql]    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:266)
[torque-sql]    at
org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:120)
[torque-sql]    at org.apache.tools.ant.Task.perform(Task.java:217)
[torque-sql]    at org.apache.tools.ant.Target.execute(Target.java:184)
[torque-sql]    at
org.apache.tools.ant.Target.performTasks(Target.java:202)
[torque-sql]    at
org.apache.tools.ant.Project.executeTarget(Project.java:601)
[torque-sql]    at
org.apache.tools.ant.Project.executeTargets(Project.java:560)
[torque-sql]    at org.apache.tools.ant.Main.runBuild(Main.java:454)
[torque-sql]    at org.apache.tools.ant.Main.start(Main.java:153)
[torque-sql]    at org.apache.tools.ant.Main.main(Main.java:176)
[torque-sql] Database-specific properties file does not exist:
/data/soft/migrate/newbookstore-b4/templates/sql/base/mysql /db.props
[torque-sql] java.lang.NullPointerException





# -------------------------------------------------------------------
#
# T O R Q U E  C O N F I G U R A T I O N  F I L E
#
# -------------------------------------------------------------------
# This file contains the most commonly used properties. For a
# a complete list of build properties, please refer to:
#   http://jakarta.apache.org/turbine/torque/properties-reference.xml
# -------------------------------------------------------------------


# -------------------------------------------------------------------
#
#  P R O J E C T
#
# -------------------------------------------------------------------
# This is the name of your Torque project. Your non-Java generated 
# files will be named using the project name selected below. If your
# project=killerapp then you will have a generated:
#
#   killerapp-schema.sql
#
# The custom is then to also rename your project XML schema from
# project-schema.xml to killerapp-schema.xml. This is required 
# for a few targets such as datasql, datadump, and datadtd.
# -------------------------------------------------------------------
torque.home=/data/soft/migrate/newbookstore-b4
torque.project = bookstore


# -------------------------------------------------------------------
#
#  T A R G E T  D A T A B A S E
#
# -------------------------------------------------------------------
# This is the target database, only considered when generating
# the SQL for your Turbine project. Your possible choices are:
#
#   axion, cloudscape, db2, db2400, hypersonic, interbase, mssql,
#   mysql, oracle, postgresql, sapdb, sybase
# -------------------------------------------------------------------

torque.database=mysql 


# -------------------------------------------------------------------
#
#  O B J E C T  M O D E L  I N F O R M A T I O N
#
# -------------------------------------------------------------------
# These settings will allow you to customize the way your
# Peer-based object model is created.
# -------------------------------------------------------------------
# addGetByNameMethod
#   If true, Torque adds methods to get database fields by name/position.
#
# addIntakeRetrievable
#   If true, the data objects will implement Intake's Retrievable 
#   interface
#
# addSaveMethod
#   If true, Torque adds tracking code to determine how to save objects.
#
# addTimeStamp
#   If true, Torque true puts time stamps in generated om files.
#
# basePrefix
#   A string to pre-pend to the file names of base data and peer objects.
#
# complexObjectModel
#   If true, Torque generates data objects with collection support and 
#   methods to easily retreive foreign key relationships.
#
# overloadKeySetters
#   If false, this prevents overloading of the setter method for
#   primary/foreign keys.  This is useful when working with broken
#   JavaBean implementations.
#
# targetPackage
#   Sets the Java package the om files will generated to, e.g. 
#   "com.company.project.om".
#
# useClasspath
#   If true, Torque will not look in the <code>templatePath</code> directory,
#   for templates, but instead load them from the classpath, allowing you to 
#   use Torque without extracted it from the jar.
#
# useManagers
#   If true, Torque will generate Manager classes that use JCS for caching.
#   Still considered experimental.
# -------------------------------------------------------------------

torque.targetPackage = com.slava.bookstore.om

torque.addGetByNameMethod = true
torque.addIntakeRetrievable = false
torque.addSaveMethod = true
torque.addTimeStamp = true
torque.basePrefix = Base
torque.complexObjectModel = true
torque.overloadKeySetters = true
torque.useManagers = false
torque.useClasspath = false
#torque.useClasspath = true


# -------------------------------------------------------------------
#
#  D A T A B A S E  S E T T I N G S
#
# -------------------------------------------------------------------
# JDBC connection settings. This is used by the JDBCToXML task that
# will create an XML database schema from JDBC metadata. These
# settings are also used by the SQL Ant task to initialize your
# Turbine system with the generated SQL.
#
# sameJavaName
#   If true, the JDBC task will set the javaName attribute for the tables 
#   and columns to be the same as SQL name.
# -------------------------------------------------------------------

torque.database.createUrl = jdbc:mysql://127.0.0.1/mysql
torque.database.buildUrl = jdbc:mysql://127.0.0.1/bookstore
torque.database.url = jdbc:mysql://127.0.0.1/bookstore
torque.database.driver = org.gjt.mm.mysql.Driver

torque.database.user = root
torque.database.password = db4jinr
torque.database.host = 127.0.0.1

torque.sameJavaName = false


#-----cchanged as in b3

# -------------------------------------------------------------------
# You should NOT have to edit anything below here.
# -------------------------------------------------------------------

# -------------------------------------------------------------------------
# The values for the ID_TABLE_ID column in the ID_TABLE start
# at 101 for tables used in projects.
# -------------------------------------------------------------------------
initialID = 101

# -------------------------------------------------------------------
#
#  T E M P L A T E  P A T H
#
# -------------------------------------------------------------------

torque.templatePath=templates

# -------------------------------------------------------------------
#
#  C O N T R O L  T E M P L A T E S
#
# -------------------------------------------------------------------

SQLControlTemplate = sql/base/Control.vm
OMControlTemplate = om/Control.vm
idTableControlTemplate = sql/id-table/Control.vm
DataDTDControlTemplate = data/Control.vm
DataDumpControlTemplate = data/dump/Control.vm
DataSQLControlTemplate = sql/load/Control.vm
DocControlTemplate = doc/Control.vm

# -------------------------------------------------------------------
#
#  O U T P U T  D I R E C T O R Y
#
# -------------------------------------------------------------------

torque.outputDirectory=src

# -------------------------------------------------------------------
#
#  S C H E M A  D I R E C T O R Y
#
# -------------------------------------------------------------------

torque.schemaDirectory=schema

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to