db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Göschl,Siegfried" <Siegfried.Goes...@drei.com>
Subject RE: trouble with Maven, MySQL & jbdc
Date Mon, 16 Feb 2004 20:17:14 GMT
Hi Brent,

this might not encourage you but I never got the Torque plugin working. The reason of your
problem is probably the maven class loader used by the Torque plugin which usually does not
pull in application dependencies during plugin execution. You should have a look at the plugin.jelly
of the Torque plugin and might add your JDBC driver to 'torque-classpath' - in this case don't
forget it to add your JDBC thingies to the project.xml of the Torque plugin.

Don't know if this solves the problem ... please post a success story if it works .... :-)


Siegfried Goeschl

-----Original Message-----
From: Brent Atkins [mailto:Brent.Atkins@Pro-Sys.biz]
Sent: Monday, February 16, 2004 8:38 PM
To: torque-user@db.apache.org
Subject: trouble with Maven, MySQL & jbdc

Hi all,

I hate to pollute the mailing list with a stupid configuration problem, but I'm at my wits
end.  I
recently made the switch from building my Torque classes with ant to building them with Maven.
application is a webapp (using Struts in case you care), and currently builds just fine. 
when I try to run the Maven goal [maven torque:create-db] I get the following error.


$: maven torque:create-db
 __  __
|  \/  |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
|_|  |_\__,_|\_/\___|_||_|  v. 1.0-rc1-SNAPSHOT


    [torque-data-model] Using classpath
log4j:ERROR Could not find value for key
log4j:ERROR Could not instantiate appender named "org.apache.torque.engine".
    [torque-data-model] Generating to file
2004-02-15 16:15:18,703 [main] INFO
org.apache.torque.engine.database.transform.XmlToAppData - Parsing file:
2004-02-15 16:15:18,715 [main] INFO
org.apache.torque.engine.database.transform.DTDResolver - Resolver: used
database.dtd from 'org.apache.torque.engine.database.transform' package
          Executing the create-db.sql script ...

File...... file:/home/brent/.maven/plugins/maven-torque-plugin-3.2/
Element... sql
Line...... 374
Column.... 44
java.sql.SQLException: No suitable Driver for jdbc:mysql//localhost:3306
Total time: 4 seconds
Finished at: Sun Feb 15 16:15:18 EST 2004


It would seem that the Torque plugin is looking for my jdbc driver.  So the first thing I
was to make sure my project.xml had the dependency that I needed.


project.xml (just the good stuff)



Well, it is included as a dependency (and it when deployed it runs just fine) so my next guess
to check my project.properties file.


project.properties (just the Torque stuff)

db.user = root
db.password =

torque.database.user = ${db.user}
torque.database.password = ${db.password}
torque.database.host = localhost

torque.project = btp
torque.targetPackage = btp.torque

torque.database = mysql
torque.database.createUrl = jdbc:mysql//localhost:3306
torque.database.buildUrl = jdbc:mysql//localhost:3306/btp
torque.database.url = jdbc:mysql//localhost:3306/btp
torque.database.driver = com.mysql.jdbc.Driver

# Settings to generate torque docs in xdoc format
# and place in xdoc directory for inclusion in
# Maven site:generate goal

torque.doc.format = anakia
torque.doc.dir = xdocs/database

# Added to fix odd Torque plugin problem
# I'd like to eventually remove these

torque.basePrefix = Base
torque.addSaveMethod = true
torque.saveException = Exception


Based on what I know, this setup should allow me to run the create-db goal without any trouble.
especially stumped because this worked fine with ant.  Obviously I'm just missing some
property...but I haven't found anything in the archives yet (day three!).  Has anyone else
experienced this?

As always, the maddest of props go out to whomever has the solution.

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

View raw message