Re: Info about Torque

2010-09-17 Thread Frank Nguyen
I have been running Torque 3.1 (Tomcat 4.x, MySQL, Linux) on production system 
since 2006 and it worked perfectly fine.
 Frank Nguyen




From: Anas Mughal anas.mug...@bluenog.com
To: Apache Torque Users List torque-user@db.apache.org
Sent: Fri, September 17, 2010 11:42:37 AM
Subject: RE: Info about Torque

Thomas,

The Torque project is pretty solid and worked very well for us on a medium size 
project (59 tables with many joins).

Good luck.



-Original Message-
From: Thomas Fischer [mailto:fisc...@seitenbau.net] 
Sent: Friday, September 17, 2010 2:25 AM
To: Apache Torque Users List
Subject: Re: Info about Torque

 I want to use Torque, but I want to hnow: the project still alive?

The project is still alive. The current production version is 3.3. There is
a tutorial available on the web site (
http://db.apache.org/torque/releases/torque-3.3/tutorial/index.html), this
might help you to get started.

 In this case, when version 4.0 will be released?

There is no definite plan, and as always this depends on available time,
but I very much doubt 4.0 will happen this year.

Thomas


-
To unsubscribe, e-mail: torque-user-unsubscr...@db.apache.org
For additional commands, e-mail: torque-user-h...@db.apache.org


-
To unsubscribe, e-mail: torque-user-unsubscr...@db.apache.org
For additional commands, e-mail: torque-user-h...@db.apache.org

Torque/MySQL connection hung after a week

2008-10-31 Thread Frank Nguyen
I use Tomcat 4.x + Torque 3.1.1 + MySQL (5.x). The # of frequent users is 10 
but heavy; i.e. continuous 8hrs. My problem is that after a week or so, the db 
connection b/w Tomcat (Torque) and MySQL hung (Tomcat is still working fine w/ 
other transaction) and have to reboot. I experienced a lot w/ Torque.properties 
configuration; especially db-common section, but nothing helped. Attached is my 
Torque.properties file. Any help/pointers is greatly appreciated.


Frank Nguyen-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: how can i Insert data into multiple table at a time

2008-08-22 Thread Frank Nguyen
There is no difference b/w inserting into 1 table or multiple tables from a 
single form transaction. Read the tutorial at:

http://db.apache.org/torque/releases/torque-3.1.1/user-guide.html

If the second adding/inserting needs a ref index from previous inserted row, do 
something like:

r1.save();
r2.setRefIndexId(r1.getIndex());

r2.save();

Hope this helps,





Sasikumar Natarajan [EMAIL PROTECTED] wrote: Hi All,
   i am new to apache torque. How can i insert data in to multiple table at 
one time hit. Actually i have a form to get the user's input and need to insert 
data in multiple table . Please help me..
Thanks in Advance
Sasi


  


Criteria.addSelectColumn problem

2008-08-22 Thread Frank Nguyen
I have 3 tables,  t1, t2 and t3.  t3 table is just a join-ref table of t1 and 
t2 in such a way that t3.c2 is ref index to t1.c1 and t3.c3 is a ref index to 
t2.c1 (t3.c1 is index for t3 table). Thus, table t3 has many records w/ same 
value in column 2 and 3. What I want is to select only rows from table 3 with 
unique c3 values. The statement:

select * distinct from t3 where t3.c2 = 

gives me 27 rows where many of them have the same c2= and c3=same number, 
obviously. (i.e.    4532,  4532,  4533,  4534, etc.) which is 
not what I wanted.

All I want is to have distinctive rows with c3 unique. So, the following 
statement gives me exactly what I want:

select c3 distinct from t3 where t3.c2=

gives me 7 row with c3 distinctive (i.e.  4532,  4533,  4534, etc.)

However, when I do it in Torque:

crit.add (c2, )
crit.addSelectColumn (c3)
crit.setDistinct();
Iterator results = t3Peer.doSelect(crit).iterator() 

would throw Exception at doSelect() because during the populateObject(), it 
found only 1 column instead of all columns as default to populate the data into 
it. 

So, to make it short, is there a way to select records from a table with a 
specified, distinctive column(s) in Torque?

Thanks in advance,


  

Frank Nguyen
(408) 836-6235 (Cell)

Re: No DataSourceFactory configured

2008-02-06 Thread Frank Nguyen
Were you able to connect to any other database than recoverable database? 
what driver did you use ? were you able to connect to recoverable database 
itself using JDBC test with the same username and password? Lastly, try using 
different different dsfactory to see if it works for you. Here is my sample 
setup with my youcaddy database. 

## Using commons-dbcp
torque.dsfactory.youcaddy.factory=org.apache.torque.dsfactory.SharedPoolDataSourceFactory
#torque.dsfactory.youcaddy.factory=org.apache.torque.dsfactory.PerUserPoolDataSourceFactor
y
torque.dsfactory.youcaddy.pool.defaultMaxActive=10
torque.dsfactory.youcaddy.pool.testOnBorrow=true
torque.dsfactory.youcaddy.pool.validationQuery=SELECT 1
torque.dsfactory.youcaddy.connection.driver = org.gjt.mm.mysql.Driver
torque.dsfactory.youcaddy.connection.url = jdbc:mysql://localhost/youcaddy
torque.dsfactory.youcaddy.connection.user = bla
torque.dsfactory.youcaddy.connection.password = bla

Good luck !

Owen B. Mehegan [EMAIL PROTECTED] wrote: Hi, I've seen this question asked 
many times in the mailing list 
archives, but so far I can't figure out a solution to the problem in my 
case. I have a unit test that is using Easymock to create mock database 
objects to test against. When I run the test, it always fails with this 
error:

java.lang.NullPointerException: There was no DataSourceFactory 
configured for the connection recoverable

But my Torque.properties _does_ include a datasource called 'recoverable:'

torque.dsfactory.recoverable.factory=com.friend.db.RecoverableDataSourceFactory
torque.dsfactory.recoverable.pool.maxActive=1
torque.dsfactory.recoverable.pool.maxIdle=1
torque.dsfactory.recoverable.pool.maxWait=1000
torque.dsfactory.recoverable.pool.testOnBorrow=false
torque.dsfactory.recoverable.pool.validationQuery=SELECT 1
torque.dsfactory.recoverable.connection.driver=com.mockrunner.mock.jdbc.MockDriver
torque.dsfactory.recoverable.connection.url = java://foo
torque.dsfactory.recoverable.connection.user = user
torque.dsfactory.recoverable.connection.password = foo

This entry is similar to others in the torque.properties, so I don't 
think the syntax is incorrect. What else could I be doing wrong?

-- 
Owen B. Mehegan
Database Framework QA Guy
He is a dangerous mixture of sophistication and recklessness which
makes one anxious about his influence on other boys.

[EMAIL PROTECTED]
YIM: omehegan
AIM: ottomaticjack
GTalk: [EMAIL PROTECTED]

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




Re: Torque connection problem - PROBLEM SOLVED.

2006-09-12 Thread Frank Nguyen
YES, the problem's SOLVED. Many thanks to Alvaro !. The problem was indeed 
duplication of torque jar files under WEB-INF/lib. I had torque-3.0-b2.jar,  
torque-3.1.jar, and torque-gen-3.1.jar (I lazily copied them from my dev env; 
torque-3.1/lib to my deploy area; torque-3.1/web/WEB-INF/lib and they built 
into jar file). After I removed all and keep only torque-3.1.jar, it worked 
like a champ
  

Alvaro Coronel [EMAIL PROTECTED] wrote:
  I once saw this kind of weird problem (nosuchmethod when you _know_ the class 
and method are there. It was due to a repeated .jar file in different folders. 
They were the same version, but the JVM got utterly confused. Removing the 
unnecessary one solved the problem. It wasn't anything related to Torque 
though...

Have you checked Tomcat's other lib folders?

Regards,
Álvaro Coronel.

Frank Nguyen wrote: Thanks, Tim. I am still debugging the problem :(
I am running Jarkata 3.1.1a, Torque 3.1 on Windows 2000. The irony of this 
problem is that I am running 2 webapps; mine and stocktrack (sample app from 
Struts book) Both are connecting to the same mysql, different databses, though. 
I also used the same setting for another old app using Struts. My old app and 
stocktrack worked, but not the new one (error attached). I tried to mimic as 
much as possible from the other 2 apps in term of config but no luck. The only 
major different b/w those 2 apps and new one is that old ones, I used Struts, 
but new one is just simple servlet. My %ant -f build-torque.xml 
sql/insert-sql/load-sql worked fine with MySQL. So, it must be the jarkata 
setting. Here is what I did. Please see if I've missed anything:

- webapps/myproject/WEB-INF/web.xml to include a Torque init servlet, reading 
Torque.properties (below) at boot time and init. I checked jarkata log file. It 
started. (attached)
- webapps/myproject/WEB-INF/classes/Torque.properties (attached) 
- webapps/myproject/WEB-INF/classes/com/myproject/core/TorqueInit.class (to 
start at boot time).

But when I run my POST servlet to run a simple insert, I got the error (error 
file attached): It appeared that the servlet executed but failed in Torque, 
getConnection. What does it mean NoSuchMethodError 
org.apache.torque.Torque.getConnection? I checked WEB-INF/lib and it has all 
the libs for Torque 3.1 there (I used the same set of libs in torque 3.1 gen I 
built for my app. What could be the problem ? Did I miss anything to set up the 
jarkata server ?

THanks,

Error: 500
Location: /myproject/servlet/com.myproject.core.AddClub
Internal Servlet Error:
java.lang.NoSuchMethodError: 
org.apache.torque.Torque.getConnection(Ljava/lang/String;)Ljava/sql/Connection;
at org.apache.torque.util.Transaction.beginOptional(Transaction.java:118)
at org.apache.torque.util.Transaction.begin(Transaction.java:100)
at com.myproject.torque.BaseClub.save(BaseClub.java:1319)
at com.myproject.torque.BaseClub.save(BaseClub.java:1300)
at com.myproject.core.AddClub.doPost(AddClub.java:117)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.facade.ServletHandler.doSTMService(ServletHandler.java:513)
at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:567)
at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
at org.apache.tomcat.core.Handler.service(Handler.java:235)
at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
at 
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
at 
org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
at java.lang.Thread.run(Thread.java:536)


Jim Caserta wrote:
Frank,

I have run into a similar situation. If you are sure
you have the correct jar files, and no older versions,
make sure your classLoader policy is Multiple in
your server configuration. If it is set to Single,
you can be holding onto older classes. 

When I changed muine to Multipe, it corrected the
issue.

Jim

--- Frank Nguyen wrote:

 Hi,
 
 I have a nasty connection prob b/w my app and
 MySQL and couldn'f figure out after 2 days. It
 worked with a diff app before but not the latest
 one. I have a simple servlet app trying to insert a
 row into a table. I did have a Torque init servlet
 and set it in WEB-INF/web.xml to start at boot time
 (from the tom cat log file, it appeared that it
 never started !!) but it wasn't sure if that is the
 problem. I did have WEB-INF/classes/Torque.xml setup
 correctly (cloned from a working stocktrack app from
 Struts) w/ right user name and password. 
 
 Based on the following error, what else could it be
 the problem that I need to check ? 
 
 Thanks in advance

Re: Torque connection problem

2006-09-11 Thread Frank Nguyen
Thanks, Tim. I am still debugging the problem :(  I am running Jarkata 3.1.1a, Torque 3.1 on Windows 2000. The irony of this problem is that I am running 2 webapps; mine and stocktrack (sample app from Struts book) Both are connecting to the same mysql, different databses, though. I also used the same setting for another old app using Struts. My old app and stocktrack worked, but not the new one (error attached). I tried to mimic as much as possible from the other 2 apps in term of config but no luck. The only major different b/w those 2 apps and new one is that old ones, I used Struts, but new one is just simple servlet. My %ant -f build-torque.xml sql/insert-sql/load-sql worked fine with MySQL. So, it must be the jarkata setting.Here is what I did. Please see if I've missed anything:- webapps/myproject/WEB-INF/web.xml to include a Torque init servlet, reading Torque.properties (below) at boot time and init. I checked
 jarkata log file. It started. (attached)  - webapps/myproject/WEB-INF/classes/Torque.properties (attached)   - webapps/myproject/WEB-INF/classes/com/myproject/core/TorqueInit.class (to start at boot time).But when I run my POST servlet to run a simple insert, I got the error (error file attached): It appeared that the servlet executed but failed in Torque, getConnection. What doesit mean NoSuchMethodError org.apache.torque.Torque.getConnection? I checked WEB-INF/lib andit has all the libs for Torque 3.1 there (Iused the same set of libsin torque 3.1gen I built for my app.What could be the problem ? Did I miss anything to set up the jarkata server ?THanks,Error: 500Location: /myproject/servlet/com.myproject.core.AddClubInternal Servlet Error:  java.lang.NoSuchMethodError:
 org.apache.torque.Torque.getConnection(Ljava/lang/String;)Ljava/sql/Connection;at org.apache.torque.util.Transaction.beginOptional(Transaction.java:118)at org.apache.torque.util.Transaction.begin(Transaction.java:100)at com.myproject.torque.BaseClub.save(BaseClub.java:1319)at com.myproject.torque.BaseClub.save(BaseClub.java:1300)at com.myproject.core.AddClub.doPost(AddClub.java:117)at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)at org.apache.tomcat.facade.ServletHandler.doSTMService(ServletHandler.java:513)at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:567)at org.apache.tomcat.core.Handler.invoke(Handler.java:322)at org.apache.tomcat.core.Handler.service(Handler.java:235)at
 org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)at java.lang.Thread.run(Thread.java:536)Jim Caserta [EMAIL PROTECTED] wrote:  Frank,I have run into a similar situation. If you are sureyou have the correct jar files, and no older versions,make sure your classLoader policy is "Multiple" inyour server
 configuration. If it is set to "Single",you can be holding onto older classes. When I changed muine to Multipe, it corrected theissue.Jim--- Frank Nguyen <[EMAIL PROTECTED]>wrote: Hi,  I have a nasty connection prob b/w my app and MySQL and couldn'f figure out after 2 days. It worked with a diff app before but not the latest one. I have a simple servlet app trying to insert a row into a table. I did have a Torque init servlet and set it in WEB-INF/web.xml to start at boot time (from the tom cat log file, it appeared that it never started !!) but it wasn't sure if that is the problem. I did have WEB-INF/classes/Torque.xml setup correctly (cloned from a working stocktrack app from Struts) w/ right user name and password.   Based on the following error, what else could it be the problem that I need to
 check ?   Thanks in advance,  java.lang.NoSuchMethodError: org.apache.torque.Torque.getConnection(Ljava/lang/String;)Ljava/sql/Connection; at org.apache.torque.util.Transaction.beginOptional(Transaction.java:118) at org.apache.torque.util.Transaction.begin(Transaction.java:100) at com.youcaddy.torque.BaseClub.save(BaseClub.java:1319) at com.youcaddy.torque.BaseClub.save(BaseClub.java:1300) at com.youcaddy.core.AddClub.doPost(AddClub.java:102)   atjavax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.facade.ServletHandler.doSTMService(ServletHandler.java:513)  at
 org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:567) atorg.apache.tomcat.core.Handler.invoke(Handler.java:322)  atorg.apache.tomcat.core.Handler.service(Handler.java:235) at org.apache.tomcat.fac

Torque connection problem

2006-09-08 Thread Frank Nguyen
Hi,
   
  I have a nasty connection prob b/w my app and MySQL and couldn'f figure out 
after 2 days. It worked with a diff app before but not the latest one. I have a 
simple servlet app trying to insert a row into a table. I did have a Torque 
init servlet and set it in WEB-INF/web.xml to start at boot time (from the tom 
cat log file, it appeared that it never started !!) but it wasn't sure if that 
is the problem. I did have WEB-INF/classes/Torque.xml setup correctly (cloned 
from a working stocktrack app from Struts) w/ right user name and password. 

Based on the following error, what else could it be the problem that I need to 
check ? 
  
Thanks in advance,





java.lang.NoSuchMethodError: 
org.apache.torque.Torque.getConnection(Ljava/lang/String;)Ljava/sql/Connection; 
  at 
org.apache.torque.util.Transaction.beginOptional(Transaction.java:118)   at 
org.apache.torque.util.Transaction.begin(Transaction.java:100)   at 
com.youcaddy.torque.BaseClub.save(BaseClub.java:1319)   at 
com.youcaddy.torque.BaseClub.save(BaseClub.java:1300)   at 
com.youcaddy.core.AddClub.doPost(AddClub.java:102)   
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)   at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)   at 
org.apache.tomcat.facade.ServletHandler.doSTMService(ServletHandler.java:513)   
at 
org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:567)   at 
org.apache.tomcat.core.Handler.invoke(Handler.java:322)   
at org.apache.tomcat.core.Handler.service(Handler.java:235)   at 
org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)   at

org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)  
 at 
org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)   at 
org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
   at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)   at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
   
at java.lang.Thread.run(Thread.java:536)  




Frank Nguyen
(408) 836-6235 (Cell)

problem with basePrefix

2004-04-21 Thread Frank Nguyen
For some reasons, my rerun of 'ant -f build-torque.xml' generated all the
base java files with format ${basePrefix}XXX.java and
$basePrefixXXXPeer.java instead of BaseXXX.java and BaseXXXPeer.java. It
also screw up the base class name as $basePrefixXXXPeer class as well. Do
you know why ? Attached are my build.properties and build-torque.xml.

Thanks in advance,

-Frank
project name=Torque default=main basedir=.
  !--
Note - You should not have to edit this file.

Instead, if calling build-torque.xml directly, edit the build.properties
that is in the same directory. If calling build-torque.xml via another
build file, you can also use the build.properties in the same directory,
or set the property torque.contextProperties to the file
to use in place of build.properties (e.g. project.properties).
  --

  !--
For us to load the default.properties from the classpath, we need to bootstrap.
To know the right lib.dir for the torque-classpath, we need to manually
figure out torque.lib.dir, but to do that, we need to manually figure
out torque.contextProperties and load that so that any old configurations
still work propertly. Then we can go on and do the rest of the mappings via
old.properties.
   --
  property name=build.properties value=build.properties/
  property name=torque.contextProperties value=${build.properties}/
  property file=${torque.contextProperties}/
  property name=lib.dir value=lib/
  property name=torque.lib.dir value=${lib.dir}/
  property name=torque.jar value=torque-gen-3.1.jar/

  !--
Build the classpath. Specifically point to each file we're including to avoid
version conflicts in the case of the torque.lib.dir being something like lib.repo.
However, we still need to pull in the user's database driver and since we don't
know which jar that will be, after we've got all of our specific, version-safe jars,
do a general inclusion of the torque.lib.dir to catch any drivers.
  --
  path id=torque-classpath
fileset dir=${torque.lib.dir}
  include name=**/commons-collections-2.1.jar/
  include name=**/commons-lang-1.0.1.jar/
  include name=**/log4j-1.2.8.jar/
  include name=**/${torque.jar}/
  include name=**/velocity-1.3.1.jar/
  include name=**/village-2.0-dev-20030825.jar/
  include name=**/xercesImpl-2.0.2.jar/
  include name=**/xmlParserAPIs-2.0.2.jar/
  include name=**/*.jar/
/fileset
  /path

  !--
The default.properties file will map old properties to the new ones along
with setting the correct defaults.
  --
  property resource=org/apache/torque/default.properties
classpath
  path refid=torque-classpath/
/classpath
  /property

  !--
Do forward declarations of all of our tasks to
centralize them and clean up the targets.
  --
  taskdef
name=torque-data-model
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueDataModelTask/
  taskdef
name=torque-data-dump
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueDataDumpTask/
  taskdef
name=torque-data-sql
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueDataSQLTask/
  taskdef
name=torque-doc
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueDocumentationTask/
  taskdef
name=torque-jdbc-transform
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueJDBCTransformTask/
  taskdef
name=torque-package-to-path
classpathref=torque-classpath
classname=org.apache.torque.task.PackageAsPathTask/
  taskdef
name=torque-sql
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueSQLTask/
  taskdef
name=torque-sql-exec
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueSQLExec/
  taskdef
name=torque-sql-transform
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueSQLTransformTask/

  !--  --
  !-- M A I N  T A R G E T --
  !--  --
  !-- This default target will run all the targets that generate   --
  !-- source. You will probably only run this target once then --
  !-- call individual targets as necessary to update your sources  --
  !-- when you change your XML schema. --
  !--  --

  target
name=main
description=== generates sql + om classes

antcall target=sql/
antcall target=om/
  /target

  !--  --
  !-- C H E C K  U S E C L A S S P A T H   --
  !--  --
  !-- Temporary hack around the propertiesUtil bug. Should --
 

FW: java.sql.SQLException: Unable to connect to any hosts due to exception: Connection rejected

2004-03-03 Thread Frank Nguyen

Hi,

I kept getting the JDBC connection problem with mysql when running 'ant -f
build-torque.xml create-db'. I tried both localhost and remote. I was able
to connect using 'mysql -h 'localhost|remotename' -u root'. There must be
something wrong, either with the jdbc driver, or the config files
(attached). I have mysql-connector-java-3.0.9-stable-bin.jar installed under
/torque/lib and j2sdkx.x.x/jre/lib/ext. Did I miss something else ?

Thanks,

Frank Nguyen


BUILD FAILED
file:D:/torque-gen-3.1/build-torque.xml:292: java.sql.SQLException: Unable
to
nnect to any hosts due to exception: java.net.ConnectException: Connection
re
ed: connect
at
org.apache.tools.ant.taskdefs.JDBCTask.getConnection(JDBCTask.java
2)
at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:358)
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)
project name=Torque default=main basedir=.
  !--
Note - You should not have to edit this file.

Instead, if calling build-torque.xml directly, edit the build.properties
that is in the same directory. If calling build-torque.xml via another
build file, you can also use the build.properties in the same directory,
or set the property torque.contextProperties to the file
to use in place of build.properties (e.g. project.properties).
  --

  !--
For us to load the default.properties from the classpath, we need to bootstrap.
To know the right lib.dir for the torque-classpath, we need to manually
figure out torque.lib.dir, but to do that, we need to manually figure
out torque.contextProperties and load that so that any old configurations
still work propertly. Then we can go on and do the rest of the mappings via
old.properties.
   --
  property name=build.properties value=build.properties/
  property name=torque.contextProperties value=${build.properties}/
  property file=${torque.contextProperties}/
  property name=lib.dir value=lib/
  property name=torque.lib.dir value=${lib.dir}/
  property name=torque.jar value=torque-gen-3.1.jar/

  !--
Build the classpath. Specifically point to each file we're including to avoid
version conflicts in the case of the torque.lib.dir being something like lib.repo.
However, we still need to pull in the user's database driver and since we don't
know which jar that will be, after we've got all of our specific, version-safe jars,
do a general inclusion of the torque.lib.dir to catch any drivers.
  --
  path id=torque-classpath
fileset dir=${torque.lib.dir}
  include name=**/commons-collections-2.1.jar/
  include name=**/commons-lang-1.0.1.jar/
  include name=**/log4j-1.2.8.jar/
  include name=**/${torque.jar}/
  include name=**/velocity-1.3.1.jar/
  include name=**/village-2.0-dev-20030825.jar/
  include name=**/xercesImpl-2.0.2.jar/
  include name=**/xmlParserAPIs-2.0.2.jar/
  include name=**/*.jar/
/fileset
  /path

  !--
The default.properties file will map old properties to the new ones along
with setting the correct defaults.
  --
  property resource=org/apache/torque/default.properties
classpath
  path refid=torque-classpath/
/classpath
  /property

  !--
Do forward declarations of all of our tasks to
centralize them and clean up the targets.
  --
  taskdef
name=torque-data-model
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueDataModelTask/
  taskdef
name=torque-data-dump
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueDataDumpTask/
  taskdef
name=torque-data-sql
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueDataSQLTask/
  taskdef
name=torque-doc
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueDocumentationTask/
  taskdef
name=torque-jdbc-transform
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueJDBCTransformTask/
  taskdef
name=torque-package-to-path
classpathref=torque-classpath
classname=org.apache.torque.task.PackageAsPathTask/
  taskdef
name=torque-sql
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueSQLTask/
  taskdef
name=torque-sql-exec
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueSQLExec/
  taskdef
name=torque-sql-transform
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueSQLTransformTask

TorqueDataModelTask not found error

2004-02-05 Thread Frank Nguyen

Hi,

I kept getting this error message while building:

D:\torque-3.0-b4ant -f build-torque.xml
Buildfile: build-torque.xml

BUILD FAILED
file:D:/torque-3.0-b4/build-torque.xml:77: taskdef class
org.apache.torque.task.TorqueDataModelTask cannot be found

Total time: 15 seconds

I downloaded and installed it straight for the CD. There is
torque-3.0-b4.jar under torque-3.0-b4 dir and I also copied it into my java
home j2sdk1.4.1_05/jre/lib/ext. The jar tvf command does show
org.apache.torque.task.TorqueDataModelTask class is in the jar file. So,
what eles could be wrong ?

Thanks in advance,

-Frank

project name=Torque default=main basedir=.
  !--
Note - You should not have to edit this file.

Instead, if calling build-torque.xml directly, edit the build.properties
that is in the same directory. If calling build-torque.xml via another
build file, you can also use the build.properties in the same directory,
or set the property torque.contextProperties to the file
to use in place of build.properties (e.g. project.properties).
  --

  !--
For us to load the default.properties from the classpath, we need to bootstrap.
To know the right lib.dir for the torque-classpath, we need to manually
figure out torque.lib.dir, but to do that, we need to manually figure
out torque.contextProperties and load that so that any old configurations
still work propertly. Then we can go on and do the rest of the mappings via
old.properties.
   --
  property name=build.properties value=build.properties/
  property name=torque.contextProperties value=${build.properties}/
  property file=${torque.contextProperties}/
  property name=lib.dir value=lib/
  property name=torque.lib.dir value=${lib.dir}/
  property name=torque.jar value=torque-3.0-b4.jar/

  !--
Build the classpath. Specifically point to each file we're including to avoid
version conflicts in the case of the torque.lib.dir being something like lib.repo.
However, we still need to pull in the user's database driver and since we don't
know which jar that will be, after we've got all of our specific, version-safe jars,
do a general inclusion of the torque.lib.dir to catch any drivers.
  --
  path id=torque-classpath
pathelement location=torque.jar.fullpath/
fileset dir=${torque.lib.dir}
  include name=**/commons-beanutils-1.4.jar/
  include name=**/commons-collections-2.0.jar/
  include name=**/commons-configuration-1.0-dev.jar/
  include name=**/commons-dbcp-1.0-dev-20020806.jar/
  include name=**/commons-lang-1.0-b1.jar/
  include name=**/commons-logging-1.0.jar/
  include name=**/commons-pool-1.0.jar/
  include name=**/jcs-1.0-dev.jar/
  include name=**/jdbc-2.0.jar/
  include name=**/jndi-1.2.1.jar/
  include name=**/log4j-1.2.6.jar/
  include name=**/stratum-1.0-b3.jar/
  include name=**/tomcat-naming-common.jar/
  include name=**/${torque.jar}/
  include name=**/velocity-1.3.jar/
  include name=**/village-1.5.3.jar/
  include name=**/xercesImpl-2.0.2.jar/
  include name=**/xmlParserAPIs-2.0.2.jar/
  include name=**/*.jar/
/fileset
  /path

  !--
The default.properties file will map old properties to the new ones along
with setting the corret defaults.
  --
  property resource=org/apache/torque/default.properties
classpath
  path refid=torque-classpath/
/classpath
  /property

  !--
Do forward declarations of all of our tasks to
centralize them and clean up the targets.
  --

  taskdef
name=torque-data-model
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueDataModelTask/
  taskdef
name=torque-data-dump
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueDataDumpTask/
  taskdef
name=torque-data-sql
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueDataSQLTask/
  taskdef
name=torque-doc
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueDocumentationTask/
  taskdef
name=torque-jdbc-transform
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueJDBCTransformTask/
  taskdef
name=torque-package-to-path
classpathref=torque-classpath
classname=org.apache.torque.task.PackageAsPathTask/
  taskdef
name=torque-sql
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueSQLTask/
  taskdef
name=torque-sql-exec
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueSQLExec/
  taskdef
name=torque-sql-transform
classpathref=torque-classpath
classname=org.apache.torque.task.TorqueSQLTransformTask/

  !--  --
  !-- M A I N  T A R G E T --
  !--  --
  !-- This default target will run all the targets that generate