You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by venkatRAM <ve...@gmail.com> on 2010/02/25 01:30:28 UTC
Ant , maven , antrun , ddlutils
Hello everyone
I have posted this on the ant forum. The reason for this post on maven forum
is that I am not sure where the problem is originating from. I am trying to
use ddlutils with maven. No ready ddlutils plugin available for maven. So I
am working with ant-run plugin. When I run the maven pom file, I get the
following output. You can notice here that the echo statement echoes the
driver value from the properties file first time and then after that it does
not. I am not sure why this is happening. Could somebody throw somelight on
this.
Thanks
Venkat
My config:
<property file="./resources/ddlutils/Database.properties" prefix="db" />
<echo>${db.driver}</echo>
<taskdef
classname="org.apache.ddlutils.task.DatabaseToDdlTask" name="databaseToDdl"
classpathref="maven.compile.classpath" />
<databaseToDdl
usedelimitedsqlidentifiers="true" modelname="lean" verbosity="DEBUG">
<database
driverclassname="org.postgresql.Driver" url="${db.url}"
username="${db.username}" password="${db.password}" />
<writeschematofile
outputfile="./resources/database/schema-lean.xml" />
</databaseToDdl>
Error Stack Trace:
venkat@ubuntu:~/leanpm/implementation$ sudo mvn -e install
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] LeanPM
[INFO] Applications
[INFO] LeanPM parent
[INFO] LeanPMJAR
[INFO] LeanPMWAR
[INFO] LeanPMEAR
[INFO] AllModules
[INFO] BuildTools
[INFO] Delivery
[INFO]
------------------------------------------------------------------------
[INFO] Building LeanPM
[INFO] task-segment: [install]
[INFO]
------------------------------------------------------------------------
[INFO] [antrun:run {execution: ddlutils-compile}]
[INFO] Executing tasks
[echo] org.postgresql.Driver
Borrowed connection org.apache.commons.dbcp.PoolableConnection@19abd2b from
data source
Returning connection org.apache.commons.dbcp.PoolableConnection@19abd2b to
data source.
Remaining connections: None
Written schema to
/home/venkat/leanpm/implementation/resources/database/schema-lean.xml
[INFO] Executed tasks
[INFO] [site:attach-descriptor]
[INFO] [install:install]
[INFO] Installing /home/venkat/leanpm/implementation/pom.xml to
/.m2/repository/com/oniryx/leanPM/LeanPM/0.1-SNAPSHOT/LeanPM-0.1-SNAPSHOT.pom
[INFO]
------------------------------------------------------------------------
[INFO] Building Applications
[INFO] task-segment: [install]
[INFO]
------------------------------------------------------------------------
[INFO] [antrun:run {execution: ddlutils-compile}]
[INFO] Executing tasks
[echo] ${db.driver}
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] An Ant BuildException has occured: Could not read the schema from the
specified database: Could not get a connection from the datasource
No suitable driver
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: An Ant
BuildException has occured: Could not read the schema from the specified
database: Could not get a connection from the datasource
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: An Ant
BuildException has occured: Could not read the schema from the specified
database: Could not get a connection from the datasource
at
org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:131)
at
org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:98)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
... 16 more
Caused by: Could not read the schema from the specified database: Could not
get a connection from the datasource
at
org.apache.ddlutils.task.DatabaseToDdlTask.readModel(DatabaseToDdlTask.java:188)
at
org.apache.ddlutils.task.DatabaseTaskBase.execute(DatabaseTaskBase.java:365)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at
org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:118)
... 19 more
Caused by: org.apache.ddlutils.DatabaseOperationException: Could not get a
connection from the datasource
at
org.apache.ddlutils.util.JdbcSupport.borrowConnection(JdbcSupport.java:151)
at
org.apache.ddlutils.platform.PlatformImplBase.readModelFromDatabase(PlatformImplBase.java:1900)
at
org.apache.ddlutils.task.DatabaseToDdlTask.readModel(DatabaseToDdlTask.java:181)
... 29 more
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC
driver of class 'org.postgresql.Driver' for connect URL '${db.url}'
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
at
org.apache.ddlutils.util.JdbcSupport.borrowConnection(JdbcSupport.java:134)
... 31 more
Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:264)
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773)
... 33 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 17 seconds
[INFO] Finished at: Wed Feb 24 14:43:26 MST 2010
[INFO] Final Memory: 18M/81M
[INFO]
------------------------------------------------------------------------
--
View this message in context: http://old.nabble.com/Ant-%2C-maven-%2C-antrun-%2C-ddlutils-tp27714325p27714325.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Ant , maven , antrun , ddlutils
Posted by Siegfried Goeschl <si...@it20one.at>.
Hi Venkatram,
I think we would need some more information
+) what would you like to do with DDLUtils?
+) why are you triggering DDLUtils in multiple M2 projects - I have my
DB stuff usually in one subproject
+) do you have a copy of "Database.properties" in all subprojects?
+) how are you invoking the Ant tasks - embedded in the pom.xml or a
seperate build.xml?
Thanks in advance
Siegfried Goeschl
On 25.02.10 07:29, Stephen Connolly wrote:
> please try with maven 3.0-alpha-6.
>
> maven 2's plugin classloader only loads a plugin once during a reactor
> build, so if you try to change the plugin's dependencies mid reactor,
> it will blow up in your face... which _could_ look similar to your
> issue... this would be the quickest way to confirm (maven 3 has fixed
> it IIRC)
>
> if your build works with 3.0-a-6 and fails with 2.2.1 then this is the
> problem and we can tell you how to fix it... otherwise it's a
> different problem, and we can ask you more questions
>
> Sent from my [rhymes with tryPod] ;-)
>
> On 25 Feb 2010, at 00:30, venkatRAM <ve...@gmail.com> wrote:
>
>>
>> Hello everyone
>>
>> I have posted this on the ant forum. The reason for this post on
>> maven forum
>> is that I am not sure where the problem is originating from. I am
>> trying to
>> use ddlutils with maven. No ready ddlutils plugin available for
>> maven. So I
>> am working with ant-run plugin. When I run the maven pom file, I get the
>> following output. You can notice here that the echo statement echoes the
>> driver value from the properties file first time and then after that
>> it does
>> not. I am not sure why this is happening. Could somebody throw
>> somelight on
>> this.
>>
>> Thanks
>> Venkat
>>
>> My config:
>>
>> <property file="./resources/ddlutils/Database.properties" prefix="db" />
>> <echo>${db.driver}</echo>
>> <taskdef
>> classname="org.apache.ddlutils.task.DatabaseToDdlTask"
>> name="databaseToDdl"
>>
>> classpathref="maven.compile.classpath" />
>> <databaseToDdl
>> usedelimitedsqlidentifiers="true" modelname="lean" verbosity="DEBUG">
>> <database
>> driverclassname="org.postgresql.Driver" url="${db.url}"
>> username="${db.username}" password="${db.password}" />
>> <writeschematofile
>> outputfile="./resources/database/schema-lean.xml" />
>> </databaseToDdl>
>>
>> Error Stack Trace:
>>
>> venkat@ubuntu:~/leanpm/implementation$ sudo mvn -e install
>> + Error stacktraces are turned on.
>> [INFO] Scanning for projects...
>> [INFO] Reactor build order:
>> [INFO] LeanPM
>> [INFO] Applications
>> [INFO] LeanPM parent
>> [INFO] LeanPMJAR
>> [INFO] LeanPMWAR
>> [INFO] LeanPMEAR
>> [INFO] AllModules
>> [INFO] BuildTools
>> [INFO] Delivery
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Building LeanPM
>> [INFO] task-segment: [install]
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] [antrun:run {execution: ddlutils-compile}]
>> [INFO] Executing tasks
>> [echo] org.postgresql.Driver
>> Borrowed connection
>> org.apache.commons.dbcp.PoolableConnection@19abd2b from
>> data source
>> Returning connection
>> org.apache.commons.dbcp.PoolableConnection@19abd2b to
>> data source.
>> Remaining connections: None
>> Written schema to
>> /home/venkat/leanpm/implementation/resources/database/schema-lean.xml
>> [INFO] Executed tasks
>> [INFO] [site:attach-descriptor]
>> [INFO] [install:install]
>> [INFO] Installing /home/venkat/leanpm/implementation/pom.xml to
>> /.m2/repository/com/oniryx/leanPM/LeanPM/0.1-SNAPSHOT/LeanPM-0.1-SNAPSHOT.pom
>>
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Building Applications
>> [INFO] task-segment: [install]
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] [antrun:run {execution: ddlutils-compile}]
>> [INFO] Executing tasks
>> [echo] ${db.driver}
>> [INFO]
>> ------------------------------------------------------------------------
>> [ERROR] BUILD ERROR
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] An Ant BuildException has occured: Could not read the schema
>> from the
>> specified database: Could not get a connection from the datasource
>>
>> No suitable driver
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Trace
>> org.apache.maven.lifecycle.LifecycleExecutionException: An Ant
>> BuildException has occured: Could not read the schema from the specified
>> database: Could not get a connection from the datasource
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
>>
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
>>
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
>>
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
>>
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
>>
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
>>
>> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>> at
>> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>> Caused by: org.apache.maven.plugin.MojoExecutionException: An Ant
>> BuildException has occured: Could not read the schema from the specified
>> database: Could not get a connection from the datasource
>> at
>> org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:131)
>>
>> at
>> org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:98)
>> at
>> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
>>
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
>>
>> ... 16 more
>> Caused by: Could not read the schema from the specified database:
>> Could not
>> get a connection from the datasource
>> at
>> org.apache.ddlutils.task.DatabaseToDdlTask.readModel(DatabaseToDdlTask.java:188)
>>
>> at
>> org.apache.ddlutils.task.DatabaseTaskBase.execute(DatabaseTaskBase.java:365)
>>
>> at
>> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
>>
>> at org.apache.tools.ant.Task.perform(Task.java:348)
>> at org.apache.tools.ant.Target.execute(Target.java:357)
>> at
>> org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:118)
>>
>> ... 19 more
>> Caused by: org.apache.ddlutils.DatabaseOperationException: Could not
>> get a
>> connection from the datasource
>> at
>> org.apache.ddlutils.util.JdbcSupport.borrowConnection(JdbcSupport.java:151)
>>
>> at
>> org.apache.ddlutils.platform.PlatformImplBase.readModelFromDatabase(PlatformImplBase.java:1900)
>>
>> at
>> org.apache.ddlutils.task.DatabaseToDdlTask.readModel(DatabaseToDdlTask.java:181)
>>
>> ... 29 more
>> Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create
>> JDBC
>> driver of class 'org.postgresql.Driver' for connect URL '${db.url}'
>> at
>> org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780)
>>
>> at
>> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
>>
>> at
>> org.apache.ddlutils.util.JdbcSupport.borrowConnection(JdbcSupport.java:134)
>>
>> ... 31 more
>> Caused by: java.sql.SQLException: No suitable driver
>> at java.sql.DriverManager.getDriver(DriverManager.java:264)
>> at
>> org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773)
>>
>> ... 33 more
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Total time: 17 seconds
>> [INFO] Finished at: Wed Feb 24 14:43:26 MST 2010
>> [INFO] Final Memory: 18M/81M
>> [INFO]
>> ------------------------------------------------------------------------
>> --
>> View this message in context:
>> http://old.nabble.com/Ant-%2C-maven-%2C-antrun-%2C-ddlutils-tp27714325p27714325.html
>>
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Ant , maven , antrun , ddlutils
Posted by Stephen Connolly <st...@gmail.com>.
please try with maven 3.0-alpha-6.
maven 2's plugin classloader only loads a plugin once during a reactor
build, so if you try to change the plugin's dependencies mid reactor,
it will blow up in your face... which _could_ look similar to your
issue... this would be the quickest way to confirm (maven 3 has fixed
it IIRC)
if your build works with 3.0-a-6 and fails with 2.2.1 then this is the
problem and we can tell you how to fix it... otherwise it's a
different problem, and we can ask you more questions
Sent from my [rhymes with tryPod] ;-)
On 25 Feb 2010, at 00:30, venkatRAM <ve...@gmail.com>
wrote:
>
> Hello everyone
>
> I have posted this on the ant forum. The reason for this post on
> maven forum
> is that I am not sure where the problem is originating from. I am
> trying to
> use ddlutils with maven. No ready ddlutils plugin available for
> maven. So I
> am working with ant-run plugin. When I run the maven pom file, I get
> the
> following output. You can notice here that the echo statement echoes
> the
> driver value from the properties file first time and then after that
> it does
> not. I am not sure why this is happening. Could somebody throw
> somelight on
> this.
>
> Thanks
> Venkat
>
> My config:
>
> <property file="./resources/ddlutils/Database.properties"
> prefix="db" />
> <echo>${db.driver}</echo>
> <taskdef
> classname="org.apache.ddlutils.task.DatabaseToDdlTask"
> name="databaseToDdl"
>
> classpathref="maven.compile.classpath" />
> <databaseToDdl
> usedelimitedsqlidentifiers="true" modelname="lean" verbosity="DEBUG">
> <database
> driverclassname="org.postgresql.Driver" url="${db.url}"
> username="${db.username}" password="${db.password}" />
> <writeschematofile
> outputfile="./resources/database/schema-lean.xml" />
> </databaseToDdl>
>
> Error Stack Trace:
>
> venkat@ubuntu:~/leanpm/implementation$ sudo mvn -e install
> + Error stacktraces are turned on.
> [INFO] Scanning for projects...
> [INFO] Reactor build order:
> [INFO] LeanPM
> [INFO] Applications
> [INFO] LeanPM parent
> [INFO] LeanPMJAR
> [INFO] LeanPMWAR
> [INFO] LeanPMEAR
> [INFO] AllModules
> [INFO] BuildTools
> [INFO] Delivery
> [INFO]
> ---
> ---------------------------------------------------------------------
> [INFO] Building LeanPM
> [INFO] task-segment: [install]
> [INFO]
> ---
> ---------------------------------------------------------------------
> [INFO] [antrun:run {execution: ddlutils-compile}]
> [INFO] Executing tasks
> [echo] org.postgresql.Driver
> Borrowed connection
> org.apache.commons.dbcp.PoolableConnection@19abd2b from
> data source
> Returning connection
> org.apache.commons.dbcp.PoolableConnection@19abd2b to
> data source.
> Remaining connections: None
> Written schema to
> /home/venkat/leanpm/implementation/resources/database/schema-lean.xml
> [INFO] Executed tasks
> [INFO] [site:attach-descriptor]
> [INFO] [install:install]
> [INFO] Installing /home/venkat/leanpm/implementation/pom.xml to
> /.m2/repository/com/oniryx/leanPM/LeanPM/0.1-SNAPSHOT/LeanPM-0.1-
> SNAPSHOT.pom
> [INFO]
> ---
> ---------------------------------------------------------------------
> [INFO] Building Applications
> [INFO] task-segment: [install]
> [INFO]
> ---
> ---------------------------------------------------------------------
> [INFO] [antrun:run {execution: ddlutils-compile}]
> [INFO] Executing tasks
> [echo] ${db.driver}
> [INFO]
> ---
> ---------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ---
> ---------------------------------------------------------------------
> [INFO] An Ant BuildException has occured: Could not read the schema
> from the
> specified database: Could not get a connection from the datasource
>
> No suitable driver
> [INFO]
> ---
> ---------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: An Ant
> BuildException has occured: Could not read the schema from the
> specified
> database: Could not get a connection from the datasource
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
> (DefaultLifecycleExecutor.java:583)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(
> DefaultLifecycleExecutor.java:499)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
> (DefaultLifecycleExecutor.java:478)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(
> DefaultLifecycleExecutor.java:330)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
> DefaultLifecycleExecutor.java:291)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
> (DefaultLifecycleExecutor.java:142)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:
> 336)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke
> (NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: An Ant
> BuildException has occured: Could not read the schema from the
> specified
> database: Could not get a connection from the datasource
> at
> org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks
> (AbstractAntMojo.java:131)
> at
> org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:98)
> at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo
> (DefaultPluginManager.java:451)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
> (DefaultLifecycleExecutor.java:558)
> ... 16 more
> Caused by: Could not read the schema from the specified database:
> Could not
> get a connection from the datasource
> at
> org.apache.ddlutils.task.DatabaseToDdlTask.readModel
> (DatabaseToDdlTask.java:188)
> at
> org.apache.ddlutils.task.DatabaseTaskBase.execute
> (DatabaseTaskBase.java:365)
> at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke
> (NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.apache.tools.ant.dispatch.DispatchUtils.execute
> (DispatchUtils.java:106)
> at org.apache.tools.ant.Task.perform(Task.java:348)
> at org.apache.tools.ant.Target.execute(Target.java:357)
> at
> org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks
> (AbstractAntMojo.java:118)
> ... 19 more
> Caused by: org.apache.ddlutils.DatabaseOperationException: Could not
> get a
> connection from the datasource
> at
> org.apache.ddlutils.util.JdbcSupport.borrowConnection
> (JdbcSupport.java:151)
> at
> org.apache.ddlutils.platform.PlatformImplBase.readModelFromDatabase
> (PlatformImplBase.java:1900)
> at
> org.apache.ddlutils.task.DatabaseToDdlTask.readModel
> (DatabaseToDdlTask.java:181)
> ... 29 more
> Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create
> JDBC
> driver of class 'org.postgresql.Driver' for connect URL '${db.url}'
> at
> org.apache.commons.dbcp.BasicDataSource.createDataSource
> (BasicDataSource.java:780)
> at
> org.apache.commons.dbcp.BasicDataSource.getConnection
> (BasicDataSource.java:540)
> at
> org.apache.ddlutils.util.JdbcSupport.borrowConnection
> (JdbcSupport.java:134)
> ... 31 more
> Caused by: java.sql.SQLException: No suitable driver
> at java.sql.DriverManager.getDriver(DriverManager.java:264)
> at
> org.apache.commons.dbcp.BasicDataSource.createDataSource
> (BasicDataSource.java:773)
> ... 33 more
> [INFO]
> ---
> ---------------------------------------------------------------------
> [INFO] Total time: 17 seconds
> [INFO] Finished at: Wed Feb 24 14:43:26 MST 2010
> [INFO] Final Memory: 18M/81M
> [INFO]
> ---
> ---------------------------------------------------------------------
> --
> View this message in context: http://old.nabble.com/Ant-%2C-maven-%2C-antrun-%2C-ddlutils-tp27714325p27714325.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Ant , maven , antrun , ddlutils
Posted by Siegfried Goeschl <si...@it20one.at>.
Always a pleasure to help
Siegfried Goeschl
On 25.02.10 16:32, venkatRAM wrote:
> Hello Golgradio
>
> Well I was able to figure it out last night didn't have time to post the
> reply. But here is goes. You were right about the db.url , username and
> password not getting resolved. The reason was that this part of root POM was
> being called multiple times worse yet from different locations. So my guess
> was that Maven cannot find the .properties file. So I hardcoded the file
> location into POM file. It ran like a charm.
>
> Also I did not need this to be called multiple times. So I moved the code
> into the Delivery module of the application. This solved the issue.
>
> Once again thanks for your reply
>
> Venkat
>
> golfradio wrote:
>
>> The expression ${db.driver} is getting resolved. But in your actual
>> database connection definition you have hard coded the driver class name.
>> So the driver cannot be the problem. From the stacktrace it looks like the
>> schema name is not getting resolved. It could be because your db.url or
>> username or password is not getting resolved or is plain wrong. Make sure
>> they are getting resolved and that you can connect to the database using
>> those credentials and the url from outside of your build script.
>>
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Ant , maven , antrun , ddlutils
Posted by venkatRAM <ve...@gmail.com>.
Hello Golgradio
Well I was able to figure it out last night didn't have time to post the
reply. But here is goes. You were right about the db.url , username and
password not getting resolved. The reason was that this part of root POM was
being called multiple times worse yet from different locations. So my guess
was that Maven cannot find the .properties file. So I hardcoded the file
location into POM file. It ran like a charm.
Also I did not need this to be called multiple times. So I moved the code
into the Delivery module of the application. This solved the issue.
Once again thanks for your reply
Venkat
golfradio wrote:
>
> The expression ${db.driver} is getting resolved. But in your actual
> database connection definition you have hard coded the driver class name.
> So the driver cannot be the problem. From the stacktrace it looks like the
> schema name is not getting resolved. It could be because your db.url or
> username or password is not getting resolved or is plain wrong. Make sure
> they are getting resolved and that you can connect to the database using
> those credentials and the url from outside of your build script.
>
>
--
View this message in context: http://old.nabble.com/Ant-%2C-maven-%2C-antrun-%2C-ddlutils-tp27714325p27714463.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Ant , maven , antrun , ddlutils
Posted by golfradio <gr...@gmail.com>.
The expression ${db.driver} is getting resolved. But in your actual database
connection definition you have hard coded the driver class name. So the
driver cannot be the problem. From the stacktrace it looks like the schema
name is not getting resolved. It could be because your db.url or username or
password is not getting resolved or is plain wrong. Make sure they are
getting resolved and that you can connect to the database using those
credentials and the url from outside of your build script.
--
View this message in context: http://old.nabble.com/Ant-%2C-maven-%2C-antrun-%2C-ddlutils-tp27714325p27714459.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org