You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Rolf Kulemann <ro...@apache.org> on 2004/06/14 20:15:48 UTC

CNE using maven-plugin from cvs

Hello,

I try to use the maven-plugin goal torque:jdbc and get a
ClassNotFoundException concerning my jdbc driver class.

I thought it should be enough to have the driver specified as a
dependency in my project.xml. How can I tell the plugin to add my driver
lib to its classpath? I had a look to the plugins plugin.jelly file and
it uses the maven.dependency.classpath correctly. I have no idea whats
wrong on my site.

Any ideas?

-- 
Rolf Kulemann


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


Re: CNE using maven-plugin from cvs

Posted by Rolf Kulemann <ro...@apache.org>.
On Mon, 2004-06-14 at 20:15, Rolf Kulemann wrote:
> Hello,
> 
> I try to use the maven-plugin goal torque:jdbc and get a
> ClassNotFoundException concerning my jdbc driver class.
> 
> I thought it should be enough to have the driver specified as a
> dependency in my project.xml. How can I tell the plugin to add my driver
> lib to its classpath? I had a look to the plugins plugin.jelly file and
> it uses the maven.dependency.classpath correctly. I have no idea whats
> wrong on my site.
> 
> Any ideas?

I forgot some error messages:



torque:jdbc:
    [torque-jdbc-transform] Torque - JDBCToXMLSchema starting
    [torque-jdbc-transform] Your DB settings are:
    [torque-jdbc-transform] driver : org.postgresql.Driver
    [torque-jdbc-transform] URL : jdbc:postgresql://localhost:5432/olr
    [torque-jdbc-transform] user : olr
    [torque-jdbc-transform] schema :
 
BUILD FAILED
File......
/home/roku/.maven/plugins/maven-torque-plugin-3.2-dev/plugin.jelly
Element... torque-jdbc-transform
Line...... 427
Column.... 7
java.lang.ClassNotFoundException: org.postgresql.Driver
Total time: 11 seconds
Finished at: Mon Jun 14 20:19:44 CEST 2004

-- 
Rolf Kulemann


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


RE: CNE using maven-plugin from cvs

Posted by Rolf Kulemann <ro...@apache.org>.
On Mon, 2004-06-14 at 21:34, Brent Atkins wrote:
> So you tried making the change to plug-in.jelly that I mentioned here
> http://nagoya.apache.org/eyebrowse/ReadMsg?listName=torque-user@db.apache.org&msgNo=3443

No, not exactly that, but in the file plugin.jelly. See my snippet. I
simply added a pathelement to the definition of the torque-classpath
property.

-- 
Rolf Kulemann


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


RE: CNE using maven-plugin from cvs

Posted by Brent Atkins <Br...@Pro-Sys.biz>.
So you tried making the change to plug-in.jelly that I mentioned here
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=torque-user@db.apache.org&msgNo=3443

and it didn't work?

What error message did you get?

-----Original Message-----
From: Rolf Kulemann [mailto:roku@apache.org]
Sent: Monday, June 14, 2004 3:05 PM
To: Apache Torque Users List
Subject: RE: CNE using maven-plugin from cvs


On Mon, 2004-06-14 at 20:40, Brent Atkins wrote:
> I posted a similar question a few months ago...
> http://nagoya.apache.org/eyebrowse/ReadMsg?listName=torque-user@db.apache.org&msgNo=3425
> 
> and found a solution that I posted here...
> http://nagoya.apache.org/eyebrowse/ReadMsg?listName=torque-user@db.apache.org&msgNo=3443
> 
> It may be a long shot, but hopefully the problem is similar.

Ok, that leads into a direction I already tried.

The following snippets of plugin.jelly seem relevent to me. The funny
thing is, even if I add my driver lib direct to the torque-classpath I
get the error.

 <path id="torque-classpath">
      <pathelement
path="${plugin.getDependencyPath('commons-collections')}"/>
      <pathelement path="${plugin.getDependencyPath('commons-lang')}"/>
      <pathelement path="${plugin.getDependencyPath('log4j')}"/>
      <pathelement path="${plugin.getDependencyPath('velocity')}"/>
      <pathelement path="${plugin.getDependencyPath('village')}"/>
      <pathelement path="${plugin.getDependencyPath('xercesImpl')}"/>
      <pathelement path="${plugin.getDependencyPath('xml-apis')}"/>
      <pathelement
path="${plugin.getDependencyPath('torque:torque-gen')}"/>
      <pathelement path="${pom.getDependencyClasspath()}"/>
      <path refid="maven.dependency.classpath"/>
    </path>


<taskdef
      name="torque-jdbc-transform"
      classpathref="torque-classpath"
      classname="org.apache.torque.task.TorqueJDBCTransformTask"/>


 <goal
    name="torque:jdbc"
    description="jdbc to xml"
    prereqs="torque:init">
                                                                                
    <torque-jdbc-transform
      dbDriver="${torque.database.driver}"
      dbPassword="${torque.database.password}"
      dbSchema="${torque.database.schema}"
      dbUrl="${torque.database.url}"
      dbUser="${torque.database.user}"
      outputFile="${torque.schema.dir}/schema.xml"
      sameJavaName="${torque.sameJavaName}"
    />
  </goal>


-- 
Rolf Kulemann


---------------------------------------------------------------------
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


RE: CNE using maven-plugin from cvs

Posted by Rolf Kulemann <ro...@apache.org>.
On Mon, 2004-06-14 at 20:40, Brent Atkins wrote:
> I posted a similar question a few months ago...
> http://nagoya.apache.org/eyebrowse/ReadMsg?listName=torque-user@db.apache.org&msgNo=3425
> 
> and found a solution that I posted here...
> http://nagoya.apache.org/eyebrowse/ReadMsg?listName=torque-user@db.apache.org&msgNo=3443
> 
> It may be a long shot, but hopefully the problem is similar.

Ok, that leads into a direction I already tried.

The following snippets of plugin.jelly seem relevent to me. The funny
thing is, even if I add my driver lib direct to the torque-classpath I
get the error.

 <path id="torque-classpath">
      <pathelement
path="${plugin.getDependencyPath('commons-collections')}"/>
      <pathelement path="${plugin.getDependencyPath('commons-lang')}"/>
      <pathelement path="${plugin.getDependencyPath('log4j')}"/>
      <pathelement path="${plugin.getDependencyPath('velocity')}"/>
      <pathelement path="${plugin.getDependencyPath('village')}"/>
      <pathelement path="${plugin.getDependencyPath('xercesImpl')}"/>
      <pathelement path="${plugin.getDependencyPath('xml-apis')}"/>
      <pathelement
path="${plugin.getDependencyPath('torque:torque-gen')}"/>
      <pathelement path="${pom.getDependencyClasspath()}"/>
      <path refid="maven.dependency.classpath"/>
    </path>


<taskdef
      name="torque-jdbc-transform"
      classpathref="torque-classpath"
      classname="org.apache.torque.task.TorqueJDBCTransformTask"/>


 <goal
    name="torque:jdbc"
    description="jdbc to xml"
    prereqs="torque:init">
                                                                                
    <torque-jdbc-transform
      dbDriver="${torque.database.driver}"
      dbPassword="${torque.database.password}"
      dbSchema="${torque.database.schema}"
      dbUrl="${torque.database.url}"
      dbUser="${torque.database.user}"
      outputFile="${torque.schema.dir}/schema.xml"
      sameJavaName="${torque.sameJavaName}"
    />
  </goal>


-- 
Rolf Kulemann


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


RE: CNE using maven-plugin from cvs

Posted by Rolf Kulemann <ro...@apache.org>.
On Mon, 2004-06-14 at 20:40, Brent Atkins wrote:
> I posted a similar question a few months ago...
> http://nagoya.apache.org/eyebrowse/ReadMsg?listName=torque-user@db.apache.org&msgNo=3425
> 
> and found a solution that I posted here...
> http://nagoya.apache.org/eyebrowse/ReadMsg?listName=torque-user@db.apache.org&msgNo=3443
> 
> It may be a long shot, but hopefully the problem is similar.

BTW: I use maven version 1.0rc3. And you?

-- 
Rolf Kulemann


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


RE: CNE using maven-plugin from cvs

Posted by Brent Atkins <Br...@Pro-Sys.biz>.
I posted a similar question a few months ago...
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=torque-user@db.apache.org&msgNo=3425

and found a solution that I posted here...
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=torque-user@db.apache.org&msgNo=3443

It may be a long shot, but hopefully the problem is similar.

-----Original Message-----
From: Rolf Kulemann [mailto:roku@apache.org]
Sent: Monday, June 14, 2004 2:34 PM
To: Apache Torque Users List
Subject: RE: CNE using maven-plugin from cvs


On Mon, 2004-06-14 at 20:21, Brent Atkins wrote:
> The project.xml file only downloads the proper driver.  Have you set your properties correctly in
> your project.properties file?

I had done that, thanks, so my problem persists.
More ideas?

-- 
Rolf Kulemann


---------------------------------------------------------------------
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


RE: CNE using maven-plugin from cvs

Posted by Rolf Kulemann <ro...@apache.org>.
On Mon, 2004-06-14 at 20:21, Brent Atkins wrote:
> The project.xml file only downloads the proper driver.  Have you set your properties correctly in
> your project.properties file?

I had done that, thanks, so my problem persists.
More ideas?

-- 
Rolf Kulemann


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


RE: CNE using maven-plugin from cvs

Posted by Brent Atkins <Br...@Pro-Sys.biz>.
The project.xml file only downloads the proper driver.  Have you set your properties correctly in
your project.properties file?

My project looks a bit like this...

#-------------------------------------------------
#  Torque Plugin Properties
#-------------------------------------------------

# Database access settings, set according to
# your environnment

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


# Project specific settings, should not be
# changed for this project

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


# You shouldn't need to change these settgings
# unless you are using a differnt database, have the
# db set to listen to a non-standard port, or you are
# using a different driver (driver is listed as a
# dependency in project.xml, if you change value here
# you must also add that dependency to project.xml)

torque.database = mysql
torque.database.createUrl = jdbc:mysql://localhost:3306/btp
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


# Needed for Maven development, or you will go mad.
# Comment out for normal use

#torque.runOnlyOnSchemaChange = false

Obviously you will need to change btp to your own project name.

For more info on what these properties actually do, check out
http://db.apache.org/torque/generator/properties-reference.html

-----Original Message-----
From: Rolf Kulemann [mailto:roku@apache.org]
Sent: Monday, June 14, 2004 2:16 PM
To: torque-user@db.apache.org
Subject: CNE using maven-plugin from cvs


Hello,

I try to use the maven-plugin goal torque:jdbc and get a
ClassNotFoundException concerning my jdbc driver class.

I thought it should be enough to have the driver specified as a
dependency in my project.xml. How can I tell the plugin to add my driver
lib to its classpath? I had a look to the plugins plugin.jelly file and
it uses the maven.dependency.classpath correctly. I have no idea whats
wrong on my site.

Any ideas?

--
Rolf Kulemann


---------------------------------------------------------------------
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