Hi,

> I am using jdbi-core-3.21.0. But I have fixed the issue by including the 
> classes below on my project manually.

These files are part of io.dropwizard.metrics:metrics-jdbi3 
(https://search.maven.org/artifact/io.dropwizard.metrics/metrics-jdbi3 
<https://search.maven.org/artifact/io.dropwizard.metrics/metrics-jdbi3>).

Adding this as a dependency should do the trick.

This is also pulled in by io.dropwizard:dropwizard-jdbi3 (see 
https://github.com/dropwizard/dropwizard/blob/v2.0.24/dropwizard-jdbi3/pom.xml#L84-L87
 
<https://github.com/dropwizard/dropwizard/blob/v2.0.24/dropwizard-jdbi3/pom.xml#L84-L87>),
 so something seems to be broken with your dependency management.

Cheers,
Jochen

> On Thursday, August 5, 2021 at 5:37:45 AM UTC+8 [email protected] wrote:
> Hi,
> 
> Which version of Dropwizard are you using exactly?
> Could you share the build file for your project or at least a complete list 
> of dependencies?
> 
> Cheers,
> Jochen
> 
> 
>> Am 04.08.2021 um 11:21 schrieb Dondell Batac <[email protected] 
>> <applewebdata://D6F3AE19-A466-4242-8C73-8DF63A2E9792>>:
>> 
> 
>> JdbiFactory factory = new JdbiFactory();
>> jdbiMysql = factory.build(environment, config.database, "mysql");
>> jdbiPostgres = factory.build(environment, config.database2, "postgresql");
>> 
>> ERROR:
>> Caused by: java.lang.ClassNotFoundException: 
>> com.codahale.metrics.jdbi3.strategies.StatementNameStrategy
>> 
>> FULL ERROR:
>> java.lang.NoClassDefFoundError: 
>> com/codahale/metrics/jdbi3/strategies/StatementNameStrategy
>>     at com.fulcrumgt.tardis.TardisApplication.run(TardisApplication.java:169)
>>     at com.fulcrumgt.tardis.TardisApplication.run(TardisApplication.java:72)
>>     at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:44)
>>     at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:87)
>>     at io.dropwizard.cli.Cli.run(Cli.java:79)
>>     at io.dropwizard.Application.run(Application.java:94)
>>     at com.fulcrumgt.tardis.TardisApplication.main(TardisApplication.java:87)
>> Caused by: java.lang.ClassNotFoundException: 
>> com.codahale.metrics.jdbi3.strategies.StatementNameStrategy
>>     at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
>>     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
>>     ... 7 more

-- 
You received this message because you are subscribed to the Google Groups 
"dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dropwizard-user/94A107C1-4BB4-4CAC-AB3B-13ADD467B2D5%40schalanda.name.

Reply via email to