Error running Maven target: java.lang.IllegalArgumentException: driverClassName must not be empty

822 views
Skip to first unread message

jgold

unread,
Jan 2, 2008, 1:46:53 PM1/2/08
to bering
I am getting an exception when I try to run the bering:migrate target
in Maven:

java.lang.IllegalArgumentException: driverClassName must not be empty
at
org.springframework.jdbc.datasource.DriverManagerDataSource.setDriverClassName(DriverManagerDataSource.java:
144)
at
org.springframework.jdbc.datasource.DriverManagerDataSource.<init>(DriverManagerDataSource.java:
101)
at
org.springframework.jdbc.datasource.SingleConnectionDataSource.<init>(SingleConnectionDataSource.java:
98)
at
edu.northwestern.bioinformatics.bering.maven.MigrateMojo.createDataSource(MigrateMojo.java:
95)
at
edu.northwestern.bioinformatics.bering.maven.MigrateMojo.executeInternal(MigrateMojo.java:
134)
at
edu.northwestern.bioinformatics.bering.maven.AbstractBeringMojo.execute(AbstractBeringMojo.java:
27)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:
447)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:
539)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:
493)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:
463)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:
311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:
278)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:
143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
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:585)
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)


I am trying to get this to work with MySQL, so I created a MySQL
dialect class and added it to the bering build. Here is my
configuration:

<plugin>
<groupId>edu.northwestern.bioinformatics</groupId>
<artifactId>bering-maven-plugin</artifactId>
<configuration>
<url>jdbc:mysql://localhost:3306/firefly_dev2</url>
<dialect>edu.northwestern.bioinformatics.bering.dialect.MySQL</
dialect>
<driver>com.mysql.Driver</driver>
<username>root</username>
<password></password>
</configuration>
<!-- Make your JDBC driver available to the plugin -->
<dependencies>
<dependency>
<artifactId>bering</artifactId>
<groupId>edu.northwestern.bioinformatics</groupId>
<version>0.7-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.0.5</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</plugin>

Rhett Sutphin

unread,
Jan 2, 2008, 2:37:30 PM1/2/08
to ber...@googlegroups.com
Hi,

> I am getting an exception when I try to run the bering:migrate target
> in Maven:


Your configuration looks okay. Can you try executing maven with the -
X (debug) parameter? I'd like to see the breakdown of what maven
thinks it is binding to the mojo. It seems like the value for driver
isn't getting passed in. Also, what version of Maven are you using?

BTW, if you get your MySQL dialect working and are interested in
contributing it, I'd be interested in adding it to the standard
distribution.

Thanks,
Rhett

jgold

unread,
Jan 2, 2008, 3:34:32 PM1/2/08
to bering
Here is the output -- I added a System.out.println call to print the
dialect value in MigrateMojo and it looks like it is not being set (I
tried this for the driver and url as well in a previous run, and they
were both null as well). I'm pretty new to Maven, so it could be a
config issue on my side. I did find an error in the docs for the
Bering Maven plugin -- the nested dependency should be wrapped in a
'dependencies' element in the plugin element.

I will be happy to contribute a MySQL dialect if I can get it working.

[DEBUG] Building Maven user-level plugin registry from: '/Users/
jgoldstrom/.m2/plugin-registry.xml'
[DEBUG] Building Maven global-level plugin registry from: '/usr/local/
apache-maven-2.0.8/conf/plugin-registry.xml'
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] SegMgtSystem
[INFO] SegMgtSystem-ejb
[INFO] SegMgtSystem-war
[INFO] SegMgtSystem-ear
[INFO] Searching repository for plugin with prefix: 'bering'.
[DEBUG] Loading plugin prefixes from group:
edu.northwestern.bioinformatics
[DEBUG] Loading plugin prefixes from group: org.apache.maven.plugins
[DEBUG] Loading plugin prefixes from group: org.codehaus.mojo
[DEBUG] bering-maven-plugin: resolved to version 0.7-SNAPSHOTJMG from
local repository
[DEBUG] Retrieving parent-POM: edu.northwestern.bioinformatics:bering-
all::0.7-SNAPSHOTJMG for project: null:bering-maven-plugin:maven-
plugin:null from the repository.
[INFO]
------------------------------------------------------------------------
[INFO] Building SegMgtSystem
[INFO] task-segment: [bering:migrate]
[INFO]
------------------------------------------------------------------------
[DEBUG] edu.northwestern.bioinformatics:bering-maven-plugin:maven-
plugin:0.7-SNAPSHOTJMG:runtime (selected for runtime)
[DEBUG] Retrieving parent-POM: org.codehaus.plexus:plexus::1.0.4 for
project: null:plexus-utils:jar:1.1 from the repository.
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.1:runtime (selected
for runtime)
[DEBUG] edu.northwestern.bioinformatics:bering:jar:0.7-
SNAPSHOTJMG:runtime (selected for runtime)
[DEBUG] commons-logging:commons-logging:jar:1.1:runtime (selected
for runtime)
[DEBUG] log4j:log4j:jar:1.2.12:runtime (selected for runtime)
[DEBUG] logkit:logkit:jar:1.0.1:runtime (selected for runtime)
[DEBUG] avalon-framework:avalon-framework:jar:4.1.3:runtime
(selected for runtime)
[DEBUG] javax.servlet:servlet-api:jar:2.3:runtime (selected for
runtime)
[DEBUG] commons-lang:commons-lang:jar:2.1:runtime (selected for
runtime)
[DEBUG] commons-io:commons-io:jar:1.3.1:runtime (selected for
runtime)
[DEBUG] org.springframework:spring:jar:2.0.3:runtime (selected for
runtime)
[DEBUG] groovy:groovy:jar:1.0-jsr-06:runtime (selected for
runtime)
[DEBUG] antlr:antlr:jar:2.7.5:runtime (selected for runtime)
[DEBUG] asm:asm:jar:2.2:runtime (selected for runtime)
[DEBUG] org.hibernate:hibernate:jar:3.2.1.ga:runtime (selected for
runtime)
[DEBUG] net.sf.ehcache:ehcache:jar:1.2.3:runtime (selected for
runtime)
[DEBUG] commons-logging:commons-logging:jar:1.0.4:runtime
(removed - nearer found: 1.1)
[DEBUG] commons-collections:commons-collections:jar:
2.1:runtime (selected for runtime)
[DEBUG] javax.transaction:jta:jar:1.0.1B:runtime (selected for
runtime)
[DEBUG] commons-logging:commons-logging:jar:1.0.4:runtime
(removed - nearer found: 1.1)
[DEBUG] dom4j:dom4j:jar:1.6.1:runtime (selected for runtime)
[DEBUG] antlr:antlr:jar:2.7.6:runtime (removed - nearer found:
2.7.5)
[DEBUG] commons-collections:commons-collections:jar:2.1:runtime
(removed - nearer found: 2.1.1)
[DEBUG] commons-collections:commons-collections:jar:
2.1.1:runtime (selected for runtime)
[DEBUG] Retrieving parent-POM: org.apache.maven:maven::2.0.5 for
project: null:maven-plugin-api:jar:2.0.5 from the repository.
[DEBUG] Retrieving parent-POM: org.apache.maven:maven-parent::5 for
project: null:maven:pom:2.0.5 from the repository.
[DEBUG] Retrieving parent-POM: org.apache:apache::3 for project:
org.apache.maven:maven-parent:pom:5 from the repository.
[DEBUG] Adding managed dependencies for unknown:maven-plugin-api
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.1
[DEBUG] org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-2
[DEBUG] org.apache.maven.wagon:wagon-ssh:jar:1.0-beta-2
[DEBUG] org.apache.maven.wagon:wagon-ssh-external:jar:1.0-beta-2
[DEBUG] org.apache.maven.wagon:wagon-file:jar:1.0-beta-2
[DEBUG] org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-beta-2
[DEBUG] easymock:easymock:jar:1.2_Java1.3:test
[DEBUG] classworlds:classworlds:jar:1.1
[DEBUG] org.apache.maven:maven-plugin-api:jar:2.0.5:runtime
(selected for runtime)
[DEBUG] hsqldb:hsqldb:jar:1.8.0.7:runtime (selected for runtime)
[DEBUG] org.springframework:spring-beans:jar:2.0.3:runtime (selected
for runtime)
[DEBUG] org.springframework:spring-core:jar:2.0.3:runtime
(selected for runtime)
[DEBUG] commons-io:commons-io:jar:1.3.1:runtime (selected for
runtime)
[DEBUG] Configuring mojo 'edu.northwestern.bioinformatics:bering-maven-
plugin:0.7-SNAPSHOTJMG:migrate' -->
[DEBUG] (s) basedir = /Users/jgoldstrom/Documents/Work/
SmallEnergyGroup/workspace/managementsystem
[DEBUG] (s) migrationsDir = /Users/jgoldstrom/Documents/Work/
SmallEnergyGroup/workspace/managementsystem/src/main/db/migrate
[DEBUG] (s) project = MavenProject: com.seg:SegMgtSystem:1.5-
SNAPSHOT @ /Users/jgoldstrom/Documents/Work/SmallEnergyGroup/workspace/
managementsystem/pom.xml
[DEBUG] -- end configuration --
[INFO] [bering:migrate]
Dialect: null

Rhett Sutphin

unread,
Jan 2, 2008, 4:57:51 PM1/2/08
to ber...@googlegroups.com
Hi,

> [DEBUG] Configuring mojo 'edu.northwestern.bioinformatics:bering-
> maven-


> plugin:0.7-SNAPSHOTJMG:migrate' -->
> [DEBUG] (s) basedir = /Users/jgoldstrom/Documents/Work/
> SmallEnergyGroup/workspace/managementsystem
> [DEBUG] (s) migrationsDir = /Users/jgoldstrom/Documents/Work/
> SmallEnergyGroup/workspace/managementsystem/src/main/db/migrate
> [DEBUG] (s) project = MavenProject: com.seg:SegMgtSystem:1.5-
> SNAPSHOT @ /Users/jgoldstrom/Documents/Work/SmallEnergyGroup/
> workspace/
> managementsystem/pom.xml
> [DEBUG] -- end configuration --
> [INFO] [bering:migrate]

This section is where you'd expect to see the configuration parameters
(driver, url, etc.) being bound to the mojo. The three that are there
are being set to their default/computed values. One question: is the
<plugin> section you excerpted in your original message in "/Users/
jgoldstrom/Documents/Work/SmallEnergyGroup/workspace/managementsystem/
pom.xml"? (Probably is, but I include the question for completeness.)

> I did find an error in the docs for the
> Bering Maven plugin -- the nested dependency should be wrapped in a
> 'dependencies' element in the plugin element.


Thanks for catching that. Actually, going in to fix that I noticed
another problem, which is that the <plugins> element should be inside
the <build> element. If you're missing it, that might cause your
problem.

Rhett

Jeremy Goldstrom

unread,
Jan 2, 2008, 5:58:34 PM1/2/08
to ber...@googlegroups.com
Not a silly question at all, as it turns out. I am using nested
modules, and I had put the bering plugin inside the build element of a
nested module, instead of the parent module (managementsystem). When
I moved the plugin element to the parent's build element, everything
worked fine. I don't know Maven well enough to understand why this
was a problem, but I'll read the docs.

Thanks for the help! I'll keep you posted on my progress with MySQL.

Reply all
Reply to author
Forward
0 new messages