db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mirna Ajanovic" <m_ajano...@hotmail.com>
Subject Newbie troubles building the tutorial with SQL server
Date Tue, 04 Mar 2003 15:35:08 GMT
I apologize if this is posted more then once, I have been having some trouble with my email
program.

I have downloaded the version 3.0 of Torque and am trying to run the tutorial with SQL server.
 I'm using ant version 1.5 and jdk 1.4.0_01.

I have followed Step 1 and 2 and changed build.properties and Torque.properties according
to the instructions.

The changes that I have made to Torque.properties are as follows:
torque.database.bookstore.adapter=mssql

## Using torque's old pool
torque.dsfactory.bookstore.factory=org.apache.torque.dsfactory.TorqueDataSourceFactory
torque.dsfactory.bookstore.pool.defaultMaxConnections=10
torque.dsfactory.bookstore.pool.maxExpiryTime=3600
torque.dsfactory.bookstore.pool.connectionWaitTimeout=10
torque.dsfactory.bookstore.connection.driver = com.microsoft.jdbc.sqlserver.SQLServerDriver
torque.dsfactory.bookstore.connection.url = jdbc:microsoft:sqlserver://localhost:4393;DatabaseName=bookstore;SelectMethod=cursor
torque.dsfactory.bookstore.connection.user = sa
torque.dsfactory.bookstore.connection.password = welcome


I have made the following changes in build.properties file:
# -------------------------------------------------------------------
#
#  P R O J E C T
#
# -------------------------------------------------------------------
torque.project = bookstore


# -------------------------------------------------------------------
#
#  T A R G E T  D A T A B A S E
#
# -------------------------------------------------------------------
torque.database = mssql

# -------------------------------------------------------------------
#
#  O B J E C T  M O D E L  I N F O R M A T I O N
#
# -------------------------------------------------------------------
torque.targetPackage = com.kazmier.om

# -------------------------------------------------------------------
#
#  D A T A B A S E  S E T T I N G S
#
# -------------------------------------------------------------------
torque.database.createUrl = jdbc:microsoft:sqlserver://localhost:4393;DatabaseName=bookstore;SelectMethod=cursor;User=sa;Password=welcome
torque.database.buildUrl = jdbc:microsoft:sqlserver://localhost:4393;DatabaseName=bookstore;SelectMethod=cursor;User=sa;Password=welcome
torque.database.url = jdbc:microsoft:sqlserver://localhost:4393;DatabaseName=bookstore;SelectMethod=cursor;User=sa;Password=welcome
torque.database.createUrl = jdbc:microsoft:sqlserver://localhost:4393;DatabaseName=bookstore;SelectMethod=cursor
torque.database.buildUrl = jdbc:microsoft:sqlserver://localhost:4393;DatabaseName=bookstore;SelectMethod=cursor
torque.database.url = jdbc:microsoft:sqlserver://localhost:4393;DatabaseName=bookstore;SelectMethod=cursor
torque.database.driver = com.microsoft.jdbc.sqlserver.SQLServerDriver
torque.database.user = sa
torque.database.password = welcome
torque.database.host = localhost

torque.sameJavaName = false

My id-table-schema.xml file looks like this:

<database name="bookstore">
  <table name="ID_TABLE" idMethod="idbroker">
    <column name="ID_TABLE_ID" required="true" primaryKey="true" type="INTEGER"/>
    <column name="TABLE_NAME" required="true" size="255" type="VARCHAR"/>
    <column name="NEXT_ID" type="INTEGER"/>
    <column name="QUANTITY" type="INTEGER"/>
    
    <unique>
      <unique-column name="TABLE_NAME"/>
    </unique>        
    
  </table>
</database>  

I have also created bookstore-schema.xml according to tutorial instructions.  I tried building
the project with he following command: ant -f build-torque.xml
and I get the following error:
C:\Tools\torque\3.0>ant -f build-torque.xml
Buildfile: build-torque.xml

main:

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:

sql-template:
     [echo] mssql
[torque-sql] Using contextProperties file: C:\Tools\torque\3.0\build.properties
[torque-sql] Generating to file C:\Tools\torque\3.0\src\sql\report.bookstore.sql.generation
[torque-sql] Fatal Error [line 1, row 1]: Content is not allowed in prolog.
[torque-sql] org.xml.sax.SAXParseException: Content is not allowed in prolog.
[torque-sql]    at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:
[torque-sql]    at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
[torque-sql]    at org.apache.torque.engine.database.transform.XmlToAppData.parseFile(XmlToA
[torque-sql]    at org.apache.torque.task.TorqueDataModelTask.initControlContext(TorqueDataM
[torque-sql]    at org.apache.torque.task.TorqueSQLTask.initControlContext(TorqueSQLTask.jav
[torque-sql]    at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:480)
[torque-sql]    at org.apache.tools.ant.Task.perform(Task.java:317)
[torque-sql]    at org.apache.tools.ant.Target.execute(Target.java:309)
[torque-sql]    at org.apache.tools.ant.Target.performTasks(Target.java:334)
[torque-sql]    at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[torque-sql]    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:371)
[torque-sql]    at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:143)
[torque-sql]    at org.apache.tools.ant.Task.perform(Task.java:317)
[torque-sql]    at org.apache.tools.ant.Target.execute(Target.java:309)
[torque-sql]    at org.apache.tools.ant.Target.performTasks(Target.java:334)
[torque-sql]    at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[torque-sql]    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:371)
[torque-sql]    at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:143)
[torque-sql]    at org.apache.tools.ant.Task.perform(Task.java:317)
[torque-sql]    at org.apache.tools.ant.Target.execute(Target.java:309)
[torque-sql]    at org.apache.tools.ant.Target.performTasks(Target.java:334)
[torque-sql]    at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[torque-sql]    at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
[torque-sql]    at org.apache.tools.ant.Main.runBuild(Main.java:610)
[torque-sql]    at org.apache.tools.ant.Main.start(Main.java:196)
[torque-sql]    at org.apache.tools.ant.Main.main(Main.java:235)
[torque-sql] Resolver: used database.dtd from org.apache.torque.engine.database.transform
package
[torque-sql] Resolver: used database.dtd from org.apache.torque.engine.database.transform
package

BUILD FAILED
file:C:/Tools/torque/3.0/build-torque.xml:216: Generation failed. For more information consult
the velocity log, or invoke ant with the -debug flag.

I tried running the above command with the debug flag and this is what I get:
BUILD FAILED
file:C:/Tools/torque/3.0/build-torque.xml:216: Generation failed. For more information consult
the velocity log, or invoke ant with the -debug flag.
        at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:579)
        at org.apache.tools.ant.Task.perform(Task.java:317)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:371)
        at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:143)
        at org.apache.tools.ant.Task.perform(Task.java:317)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:371)
        at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:143)
        at org.apache.tools.ant.Task.perform(Task.java:317)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
        at org.apache.tools.ant.Main.runBuild(Main.java:610)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)
--- Nested Exception ---
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.RangeCheck(ArrayList.java:508)
        at java.util.ArrayList.get(ArrayList.java:320)
        at org.apache.torque.engine.database.model.AppData.getDatabase(AppData.java:222)
        at org.apache.torque.task.TorqueDataModelTask.initControlContext(TorqueDataModelTask.java:350)
        at org.apache.torque.task.TorqueSQLTask.initControlContext(TorqueSQLTask.java:220)
        at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:480)
        at org.apache.tools.ant.Task.perform(Task.java:317)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:371)
        at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:143)
        at org.apache.tools.ant.Task.perform(Task.java:317)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:371)
        at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:143)
        at org.apache.tools.ant.Task.perform(Task.java:317)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
        at org.apache.tools.ant.Main.runBuild(Main.java:610)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)

Has anyone ran into this problem before?  Is there something that I'm doing wrong?  If someone
has successfully ran the tutorial with sql server I would greatly appreciate your help.

Thanks,
Mirna

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message