+dropwizard-user, dropwizard-dev to bcc The ClassNotFoundException makes sense when you exclude the Jersey libraries, since Dropwizard presumably needs them. I think the NPE is the issue you should focus on tracking down.
Does the output of `mvn dependency:tree` indicate that any other versions of Jersey libraries are being pulled in by non-Dropwizard dependencies? Googling "nullpointerexception abstractjaxbprovider" seems to indicate that this problem tends to occur when there's version mismatches between dependencies. For instance, see this dropwizard-user post from last year: https://groups.google.com/forum/#!topic/dropwizard-user/PYOEoaYMkxc On Wed, Jul 27, 2016 at 2:18 PM, Tej K <[email protected]> wrote: > For some reason my dropward service built using 0.9.2 dropward libraries > is expecting old 1.x jersey classes even though I added maven dependency > exclusions to com.sun.jersey.jersey-core and com.sun.jersey.jersey-server > from dropwizard library dependencies. Below is the exception I see. If I > remove the exclusions I get this NPE java.lang.NullPointerException at > com.sun.jersey.core.provider.jaxb.AbstractJAXBProvider.setConfiguration(AbstractJAXBProvider.java:109) > > Any ideas? > > Exception: > at io.dropwizard.cli.Cli.run(Cli.java:70) > at io.dropwizard.Application.run(Application.java:80) > at com.bazaarvoice.lux.LuxApplication.main(LuxApplication.java:91) > Caused by: java.lang.ClassNotFoundException: > com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider > at java.net.URLClassLoader.findClass(URLClassLoader.java:381) > WARN [2016-07-27 21:17:05,395] > org.eclipse.jetty.util.component.AbstractLifeCycle: FAILED > org.eclipse.jetty.server.handler.StatisticsHandler@387bbc59: > java.lang.NoClassDefFoundError: > com/sun/jersey/core/provider/jaxb/AbstractRootElementProvider > ! java.lang.ClassNotFoundException: > com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider > ! at java.net.URLClassLoader.findClass(URLClassLoader.java:381) > ~[na:1.8.0_45] > ! at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_45] > ! at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) > ~[na:1.8.0_45] > ! at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_45] > ! ... 88 common frames omitted > ! Causing: java.lang.NoClassDefFoundError: > com/sun/jersey/core/provider/jaxb/AbstractRootElementProvider > ! at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_45] > ! at java.lang.ClassLoader.defineClass(ClassLoader.java:760) ~[na:1.8.0_45] > ! at > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) > ~[na:1.8.0_45] > ! at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) > ~[na:1.8.0_45] > ! at java.net.URLClassLoader.access$100(URLClassLoader.java:73) > ~[na:1.8.0_45] > ! at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[na:1.8.0_45] > ! at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[na:1.8.0_45] > ! at java.security.AccessController.doPrivileged(Native Method) > ~[na:1.8.0_45] > ! at java.net.URLClassLoader.findClass(URLClassLoader.java:361) > ~[na:1.8.0_45] > ! at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_45] > ! at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) > ~[na:1.8.0_45] > ! at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_45] > ! at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_45] > ! at java.lang.ClassLoader.defineClass(ClassLoader.java:760) ~[na:1.8.0_45] > ! at > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) > ~[na:1.8.0_45] > ! at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) > ~[na:1.8.0_45] > ! at java.net.URLClassLoader.access$100(URLClassLoader.java:73) > ~[na:1.8.0_45] > ! at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[na:1.8.0_45] > ! at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[na:1.8.0_45] > ! at java.security.AccessController.doPrivileged(Native Method) > ~[na:1.8.0_45] > ! at java.net.URLClassLoader.findClass(URLClassLoader.java:361) > ~[na:1.8.0_45] > ! at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_45] > ! at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) > ~[na:1.8.0_45] > ! at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_45] > ! at java.lang.Class.forName0(Native Method) ~[na:1.8.0_45] > ! at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_45] > ! at > org.glassfish.jersey.internal.util.ReflectionHelper$7.run(ReflectionHelper.java:403) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.glassfish.jersey.internal.util.ReflectionHelper$7.run(ReflectionHelper.java:398) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at java.security.AccessController.doPrivileged(Native Method) > ~[na:1.8.0_45] > ! at > org.glassfish.jersey.internal.ServiceFinder$AbstractLazyIterator.hasNext(ServiceFinder.java:577) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.glassfish.jersey.internal.ServiceFinder.toClassArray(ServiceFinder.java:418) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.glassfish.jersey.internal.ServiceFinderBinder.configure(ServiceFinderBinder.java:90) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.glassfish.hk2.utilities.binding.AbstractBinder.bind(AbstractBinder.java:172) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.glassfish.hk2.utilities.binding.AbstractBinder.install(AbstractBinder.java:330) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.glassfish.jersey.spidiscovery.internal.MetaInfServicesAutoDiscoverable$1.configure(MetaInfServicesAutoDiscoverable.java:74) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.glassfish.hk2.utilities.binding.AbstractBinder.bind(AbstractBinder.java:172) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.glassfish.jersey.model.internal.CommonConfig.configureBinders(CommonConfig.java:663) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:639) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.glassfish.jersey.server.ResourceConfig.configureMetaProviders(ResourceConfig.java:829) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:453) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:184) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:350) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:347) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at org.glassfish.jersey.internal.Errors.process(Errors.java:315) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at org.glassfish.jersey.internal.Errors.process(Errors.java:297) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.glassfish.jersey.internal.Errors.processWithException(Errors.java:255) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:347) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:390) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:172) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:364) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at javax.servlet.GenericServlet.init(GenericServlet.java:244) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:612) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:395) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:871) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:298) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > com.codahale.metrics.jetty9.InstrumentedHandler.doStart(InstrumentedHandler.java:103) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.server.handler.RequestLogHandler.doStart(RequestLogHandler.java:140) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(Abstrac at > java.lang.ClassLoader.loadClass(ClassLoader.java:424)tHandler.java:61) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.server.handler.StatisticsHandler.doStart(StatisticsHandler.java:232) > ~[lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at org.eclipse.jetty.server.Server.start(Server.java:387) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at org.eclipse.jetty.server.Server.doStart(Server.java:354) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at io.dropwizard.cli.ServerCommand.run(ServerCommand.java:43) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:41) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:77) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at io.dropwizard.cli.Cli.run(Cli.java:70) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at io.dropwizard.Application.run(Application.java:80) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > ! at com.bazaarvoice.lux.LuxApplication.main(LuxApplication.java:91) > [lux-service-0.1-SNAPSHOT.jar:0.1-SNAPSHOT] > > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) > at java.lang.ClassLoader.loadClass(ClassLoader.java:357) > ... 88 more > INFO [2016-07-27 21:17:05,402] org.eclipse.jetty.server.ServerConnector: > Started lux@7271f5f1{HTTP/1.1}{0.0.0.0:9009} > WARN [2016-07-27 21:17:05,403] > org.eclipse.jetty.util.component.AbstractLifeCycle: FAILED > org.eclipse.jetty.server.Server@5c9673da: java.lang.NoClassDefFoundError: > com/sun/jersey/core/provider/jaxb/AbstractRootElementProvider > ! java.lang.ClassNotFoundException: > com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider > ! at java.net.URLClassLoader.findClass(URLClassLoader.java:381) > ~[na:1.8.0_45] > ! at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_45] > ! at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) > ~[na:1.8.0_45] > ! at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_45] > ! ... 88 common frames omitted > ! Causing: java.lang.NoClassDefFoundError: > com/sun/jersey/core/provider/jaxb/AbstractRootElementProvider > ! at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_45] > > -- > You received this message because you are subscribed to the Google Groups > "dropwizard-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- Evan Meagher -- 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]. For more options, visit https://groups.google.com/d/optout.
