db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: IDBroker problems
Date Fri, 03 Jun 2005 07:04:44 GMT




Hi,

As Erik already said, it seems also to me that the idbroker is not
initialized correctly. Usually, this should be done automatically, but in
your case, it fails.

One option you have is to find out why the idbroker does not get
initialized properly. Maybe it helps to invoke maven with the --debug
option.
As you wrote, the line "File '_recipe-schema.sql' in sqldbmap does not
exist" looks strange. Can you find that file manually somewhere in the
generated files ? If not, can you find a file called 'recipe-schema.sql'
instead ? If yes, does it work to execute that file manually (via a mysql
console)?
You can also try to get the tutorial running, and revert things one after
another to get your current status. By doing this, you should be able to
pinpoint exactly what causes the error to happen.
If you find out what is going on, please post your findings to the list.

Another option is to use the idMethod=native instead of idBroker. This
should usually work well in the case of mysql.

Still another option you have is to try to do initialize the idbroker
manually.

   Thomas

"C. Jason Harrelson" <cjharrelson@sbcglobal.net> schrieb am 03.06.2005
02:59:26:

> Here is the output when I create the db, om, and init.  Any ideas?
>
> The line:
>
> [torque-sql-exec] File '_recipe-schema.sql' in sqldbmap does not exist,
so
> skipp
> ing it.
>
> From the init-sql section loks strange to me.
>
>
> D:\CodingProjects\Eclipse\Recipe\WEB-INF>d:
>
> D:\CodingProjects\Eclipse\Recipe\WEB-INF>cd
> \CodingProjects\Eclipse\Recipe\WEB-I
> NF
>
> D:\CodingProjects\Eclipse\Recipe\WEB-INF>call 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] |                                          |
>      [echo] +------------------------------------------+
>
> sql-classpath:
>      [echo] loading templates from classpath
> [torque-sql] Using contextProperties file:
> D:\CodingProjects\Eclipse\Recipe\WEB-
> INF\build.properties
> [torque-sql] Using classpath
> [torque-sql] Generating to file
> D:\CodingProjects\Eclipse\Recipe\WEB-INF\src\sql
> \report.recipe.sql.generation
> [torque-sql] 2005-06-02 19:16:27,224 [main] INFO
> org.apache.torque.engine.datab
> ase.transform.XmlToAppData - Parsing file: 'id-table-schema.xml'
> [torque-sql] 2005-06-02 19:16:27,264 [main] INFO
> org.apache.torque.engine.datab
> ase.transform.DTDResolver - Resolver: used database.dtd from
> 'org.apache.torque.
> engine.database.transform' package
> [torque-sql] 2005-06-02 19:16:27,314 [main] INFO
> org.apache.torque.engine.datab
> ase.transform.XmlToAppData - Parsing file: 'recipe-schema.xml'
>
> sql-template:
>
> check-use-classpath:
>
> check-run-only-on-schema-change:
>
> om-check:
>
> om:
>      [echo] +------------------------------------------+
>      [echo] |                                          |
>      [echo] | Generating Peer-based Object Model for   |
>      [echo] | YOUR Torque project!                     |
>      [echo] |                                          |
>      [echo] +------------------------------------------+
>
> om-classpath:
> [torque-data-model] Using contextProperties file:
> D:\CodingProjects\Eclipse\Reci
> pe\WEB-INF\build.properties
> [torque-data-model] Using classpath
> [torque-data-model] Generating to file
> D:\CodingProjects\Eclipse\Recipe\WEB-INF\
> src\java\report.recipe.om.generation
> [torque-data-model] 2005-06-02 19:16:30,739 [main] INFO
> org.apache.torque.engin
> e.database.transform.XmlToAppData - Parsing file: 'recipe-schema.xml'
>
> om-template:
>
> BUILD SUCCESSFUL
> Total time: 9 seconds
> Buildfile: build-torque.xml
>
> create-db-check:
>
> create-db:
> [torque-data-model] templates
> [torque-data-model] Using classpath
> [torque-data-model] Generating to file
> D:\CodingProjects\Eclipse\Recipe\WEB-INF\
> src\sql\create-db.sql
> [torque-data-model] 2005-06-02 19:16:35,335 [main] INFO
> org.apache.torque.engin
> e.database.transform.XmlToAppData - Parsing file: 'id-table-schema.xml'
> [torque-data-model] 2005-06-02 19:16:35,355 [main] INFO
> org.apache.torque.engin
> e.database.transform.DTDResolver - Resolver: used database.dtd from
> 'org.apache.
> torque.engine.database.transform' package
> [torque-data-model] 2005-06-02 19:16:35,425 [main] INFO
> org.apache.torque.engin
> e.database.transform.XmlToAppData - Parsing file: 'recipe-schema.xml'
>      [echo]
>      [echo]       Executing the create-db.sql script ...
>      [echo]
>       [sql] Executing file:
> D:\CodingProjects\Eclipse\Recipe\WEB-INF\src\sql\cre
> ate-db.sql
>       [sql] 2 of 2 SQL statements executed successfully
>
> BUILD SUCCESSFUL
> Total time: 2 seconds
> Buildfile: build-torque.xml
>
> id-table-init-sql:
>      [echo] +------------------------------------------+
>      [echo] |                                          |
>      [echo] | Generating initialization SQL            |
>      [echo] | for ID Broker system!                    |
>      [echo] |                                          |
>      [echo] +------------------------------------------+
> [torque-sql] Using contextProperties file:
> D:\CodingProjects\Eclipse\Recipe\WEB-
> INF\build.properties
> [torque-sql] templates
> [torque-sql] Using classpath
> [torque-sql] Generating to file
> D:\CodingProjects\Eclipse\Recipe\WEB-INF\src\sql
> \report.idtable-init.sql.generation
> [torque-sql] 2005-06-02 19:16:38,540 [main] INFO
> org.apache.torque.engine.datab
> ase.transform.XmlToAppData - Parsing file: 'recipe-schema.xml'
>
> BUILD SUCCESSFUL
> Total time: 2 seconds
> Buildfile: build-torque.xml
>
> insert-sql:
> [torque-sql-exec] File '_recipe-schema.sql' in sqldbmap does not exist,
so
> skipp
> ing it.
> [torque-sql-exec] Our new url -> jdbc:mysql://127.0.0.1/recipe
> [torque-sql-exec] Executing file:
> D:\CodingProjects\Eclipse\Recipe\WEB-INF\src\s
> ql\id-table-schema.sql
> [torque-sql-exec] Executing file:
> D:\CodingProjects\Eclipse\Recipe\WEB-INF\src\s
> ql\recipe-schema.sql
> [torque-sql-exec] Executing file:
> D:\CodingProjects\Eclipse\Recipe\WEB-INF\src\s
> ql\recipe-schema-idtable-init.sql
> [torque-sql-exec] 23 of 23 SQL statements executed successfully
>
> BUILD SUCCESSFUL
> Total time: 3 seconds
> Press any key to continue . . .
>
>
> Here is my build.properties file:
>
> # -------------------------------------------------------------------
> #
> # 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.project = recipe
>
>
> # -------------------------------------------------------------------
> #
> #  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 Torque 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.
> #
> # 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.lf.recipe.model
>
> torque.addGetByNameMethod = true
> torque.addIntakeRetrievable = false
> torque.addSaveMethod = true
> torque.addTimeStamp = true
> torque.basePrefix = Base
> torque.complexObjectModel = true
> torque.useClasspath = true
> torque.useManagers = false
>
> # -------------------------------------------------------------------
> #
> #  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
> # Torque 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/recipe
> torque.database.url = jdbc:mysql://127.0.0.1/recipe
> torque.database.driver = com.mysql.jdbc.Driver
>
> torque.database.user = root
> torque.database.password = marley
> torque.database.host = 127.0.0.1
> torque.sameJavaName = false
>
>
>
>
> C. Jason Harrelson
> cjharrelson@sbcglobal.net
>
> -----Original Message-----
> From: Dressler,Erik(externe MA) [mailto:Erik.Dressler@Dresdner-Bank.lu]
> Sent: Thursday, June 02, 2005 2:24 AM
> To: 'Apache Torque Users List'
> Subject: RE: IDBroker problems
>
>
> hi!
>
> that was no try! that was definitely an error!
>
> the id-table needs an init-value itself. something like this:
>
> insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
> (1100, 'ID_TABLE', 1000, 10)
>
> greetz, erik
>
> > -----Original Message-----
> > From:   Jason Harrelson [SMTP:charrelson@houston.rr.com]
> > Sent:   02 June 2005 04:41
> > To:   'Apache Torque Users List'
> > Subject:   RE: IDBroker problems
> >
> > I tried this to no avail.  Once again the record is added to the table
> > with a primary key of 0.  Of course the next record still fails as it
> > tries to insert another primary key of 0.
> >
> > Thanks for the try.  Any other ideas out there?
> >
> > -----Original Message-----
> > From: Dressler,Erik(externe MA)
> > [mailto:Erik.Dressler@Dresdner-Bank.lu]
> > Sent: Friday, May 27, 2005 5:48 AM
> > To: 'Apache Torque Users List'
> > Subject: RE: IDBroker problems
> >
> >
> > i think i can help you!
> >
> > look at this row: defaultIdMethod="idBroker">
> >
> > xml is case sensitive. you have to write: defaultIdMethod="idbroker">
> >
> > good luck, drezze
> >
> >
> > > -----Original Message-----
> > > From:   Jason Harrelson [SMTP:charrelson@houston.rr.com]
> > > Sent:   27 May 2005 04:33
> > > To:   torque-user@db.apache.org
> > > Subject:   IDBroker problems
> > >
> > > I am new to Torque.  I have been successful at creating my DB and
> > classes.
> > > Everything works correctly, excluding the primary key incrementing,
> > > or populating at all.  When I add a record to my account table, I
> > > get a 0 in the primary key column.  A second record added also
> > > yields a 0, thus it fails.
> > >
> > > Here is an excerpt from my schema file for the account table:
> > >
> > > <database
> > >
> > > name="recipe"
> > >
> > > defaultIdMethod="idBroker">
> > >
> > > <table name="account" description="">
> > >
> > > <column
> > >
> > > name="account_id"
> > >
> > > required="true"
> > >
> > > primaryKey="true"
> > >
> > > type="INTEGER"
> > >
> > > description="Key of the account record"/>
> > >
> > > <column
> > >
> > > name="account_type"
> > >
> > > required="true"
> > >
> > > primaryKey="false"
> > >
> > > type="INTEGER"
> > >
> > > description=""/>
> > >
> > > <column
> > >
> > > name="name_first"
> > >
> > > required="true"
> > >
> > > primaryKey="false"
> > >
> > > type="VARCHAR"
> > >
> > > size="25"
> > >
> > > description="User's first name"/>
> > >
> > > <column
> > >
> > > name="name_last"
> > >
> > > required="true"
> > >
> > > primaryKey="false"
> > >
> > > type="VARCHAR"
> > >
> > > size="25"
> > >
> > > description="User's last name"/>
> > >
> > > <column
> > >
> > > name="street_address"
> > >
> > > required="true"
> > >
> > > primaryKey="false"
> > >
> > > type="VARCHAR"
> > >
> > > size="35"
> > >
> > > description=""/>
> > >
> > > <column
> > >
> > > name="city"
> > >
> > > required="true"
> > >
> > > primaryKey="false"
> > >
> > > type="VARCHAR"
> > >
> > > size="25"
> > >
> > > description=""/>
> > >
> > > <column
> > >
> > > name="state"
> > >
> > > required="true"
> > >
> > > primaryKey="false"
> > >
> > > type="VARCHAR"
> > >
> > > size="2"
> > >
> > > description=""/>
> > >
> > > <column
> > >
> > > name="zip"
> > >
> > > required="true"
> > >
> > > primaryKey="false"
> > >
> > > type="VARCHAR"
> > >
> > > size="9"
> > >
> > > description=""/>
> > >
> > > <column
> > >
> > > name="email"
> > >
> > > required="false"
> > >
> > > primaryKey="false"
> > >
> > > type="VARCHAR"
> > >
> > > size="50"
> > >
> > > description=""/>
> > >
> > > <column
> > >
> > > name="password"
> > >
> > > required="true"
> > >
> > > primaryKey="false"
> > >
> > > type="VARCHAR"
> > >
> > > size="10"
> > >
> > > description=""/>
> > >
> > > <column
> > >
> > > name="nickname"
> > >
> > > required="true"
> > >
> > > primaryKey="false"
> > >
> > > type="VARCHAR"
> > >
> > > size="25"
> > >
> > > description=""/>
> > >
> > > </table>
> > >
> > >
> > >
> > > The id_table has an entry for account with next_id = 1000 and
> > > quantity = 10.
> > >
> > >
> > >
> > > I am not sure what else to post to help with the putting anyone on
> > > the correct trail.  Everything else seems to be working correctly.
> > > I have combed the archives and found nothing similar to this
> > > problem.  If you need any other info, please let me know and I will
> provide it.
> > >
> > > Thank you in advance for you help.
> > >
> >
> > *  *  *  *  *  *  D I S C L A I M E R  *  *  *  *  *  *  *
> >
> > This message is confidential and intended for the named addressee(s)
only.
> > If you are not the intended recipient, please contact the sender by
> > E-Mail return and then delete this message from your system. You
> > should not copy or use it or disclose its contents to any other
> > person.
> >
> > If any part of this message is illegible or if you suspect that the
> > message may have been intercepted or amended, please contact the
> > sender.
> > Dresdner Bank Luxembourg S.A. cannot accept any responsibility for the
> > accuracy or completeness of this message without further investigation.
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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
>
> *  *  *  *  *  *  D I S C L A I M E R  *  *  *  *  *  *  *
>
> This message is confidential and intended for the named addressee(s)
only.
> If you are not the intended recipient, please contact the sender by
E-Mail
> return and then delete this message from your system. You should not copy
or
> use it or disclose its contents to any other person.
>
> If any part of this message is illegible or if you suspect that the
message
> may have been intercepted or amended, please contact the sender.
> Dresdner Bank Luxembourg S.A. cannot accept any responsibility for the
> accuracy or completeness of this message without further investigation.
>
>
>
> ---------------------------------------------------------------------
> 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