I am trying to run a very simple app patterned after the Getting Started hello world app and I am running into a ClasNotFound exception when I run the server
Exception in thread "main" java.lang.NoClassDefFoundError: javax/validation/Validation
at com.yammer.dropwizard.validation.Validator.<init>(Validator.java:24)
at com.yammer.dropwizard.cli.ConfiguredCommand.parseConfiguration(ConfiguredCommand.java:76)
at com.yammer.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:51)
at com.yammer.dropwizard.cli.Cli.run(Cli.java:53)
at com.yammer.dropwizard.Service.run(Service.java:61)
at com.xxx.xxx.atlas.core.ServiceMain.main(ServiceMain.java:18)
Caused by: java.lang.ClassNotFoundException: javax.validation.Validation
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
I noticed the Validator object in drop wizard imports the Javax validator classes, but there is no dependency that is pulled in that includes those classes. My maven dependency is basically:
<dependency>
<groupId>com.yammer.dropwizard</groupId>
<artifactId>dropwizard-core</artifactId>
<version>0.6.2</version>
</dependency>
Any idea why this may be happening? I can pull in the javax Validator myself but that causes another error where a provider can't be found.
(when I add this dependency, there is no class not found exception, but I get a missing validation error instead.)
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
</dependency>