Comments (2)
We run dropwizard with maven shade plugin. I don't have experience with
onejar
On Thursday, May 29, 2014, Maikel [email protected] wrote:
Has anyone tried to run a dropwizard project with the Guice Bundle? I'm
trying to but get the following error. It seems it can't find the
resources. I do use .enableAutoConfig(getClass().getPackage().getName()),
and this works in IntelliJ. Any suggestions?[JarClassLoader] INFO: findResource(): unable to locate
"com/sun/jersey/impl/impl_en_US.properties"
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.simontuffs.onejar.Boot.run(Boot.java:313)
at com.simontuffs.onejar.Boot.main(Boot.java:161)
Caused by: javax.servlet.ServletException:
com.hubspot.dropwizard.guice.GuiceContainer-68e8767a@e2b8174https://github.com/com.hubspot.dropwizard.guice.GuiceContainer-68e8767a/dropwizard-guice/commit/e2b81746
==com.hubspot.dropwizard.guice.GuiceContainer,1,false
at
org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:561)
at
org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:349)
at
org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:812)
at
org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:288)
at
org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:732)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
at
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:118)
at
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:100)
at
org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60)
at
com.codahale.metrics.jetty9.InstrumentedHandler.doStart(InstrumentedHandler.java:89)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
at
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:118)
at
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:100)
at
org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
at
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:118)
at
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:100)
at
org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60)
at
org.eclipse.jetty.server.handler.RequestLogHandler.doStart(RequestLogHandler.java:131)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
at
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:118)
at
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:100)
at
org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60)
at
org.eclipse.jetty.server.handler.StatisticsHandler.doStart(StatisticsHandler.java:233)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
at
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:118)
at org.eclipse.jetty.server.Server.start(Server.java:342)
at
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:100)
at
org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60)
at org.eclipse.jetty.server.Server.doStart(Server.java:290)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
at io.dropwizard.cli.ServerCommand.run(ServerCommand.java:43)
at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:43)
at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:76)
at io.dropwizard.cli.Cli.run(Cli.java:70)
at io.dropwizard.Application.run(Application.java:72)
at
nl.infosupport.autourenbackend.AutoUrenApplication.main(AutoUrenApplication.java:37)
... 6 more
Caused by: com.sun.jersey.api.container.ContainerException: The
ResourceConfig instance does not contain any root resource classes.
at
com.sun.jersey.server.impl.application.RootResourceUriRules.(RootResourceUriRules.java:99)
at
com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1359)
at
com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:180)
at
com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:799)
at
com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:795)
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
at
com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:795)
at
com.hubspot.dropwizard.guice.GuiceContainer.initiate(GuiceContainer.java:70)
at
com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:321)
at
com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:605)
at
com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:207)
at
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:376)
at
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:559)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at
org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:540)
... 42 more—
Reply to this email directly or view it on GitHubhttps://github.com//issues/28
.
from dropwizard-guice.
Thanks for the tip Elias! I switched to com.github.jengelman.gradle.plugins:shadow:0.8 (maven shade port for Gradle) and it worked!
By the way, could you remove the quote of my question? It still contains the package name of my project. I'd like to keep that of the internet ;).
For any other users:
Follow the instructions on https://github.com/johnrengelman/shadow.
After you've setup the plugin use the following according to your needs:
import com.github.jengelman.gradle.plugins.shadow.transformers.ManifestResourceTransformer
import com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer
shadow {
baseName 'myapp-standalone'
artifactAttached false
destinationDir "${project.buildDir}/distributions"
transformer(ServiceFileTransformer)
transformer(ManifestResourceTransformer) {
attributes 'Main-Class': 'my.application.class.Application'
attributes 'Test-Entry': 'PASSED'
}
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
}
from dropwizard-guice.
Related Issues (20)
- Can not register jersey client in guice
- Binding annotations on providers don't seem to work HOT 1
- AutoConfig should ignore anonymous class HOT 1
- Dropwizard Not Starting Due to HK2 Failure HOT 4
- dropwizrd-guice not working with Dropwizard-core 1.1.0
- LinkageError ... attempted duplicate class definition for name: "org/glassfish/hk2/api/ServiceLocatorState"
- jersey2-guice is defunct HOT 1
- DropWizard 0.9.1 support? HOT 10
- Are there plans to add DropWizard 1.0.0 support? HOT 5
- No License inside Jar file HOT 4
- Getting a warning at startup: "It appears jersey2-guice-spi is either not present or in conflict with some other Jar" HOT 14
- com.google.inject.OutOfScopeException on inject javax.servlet.http.HttpServletRequest HOT 11
- Binding annotations aren't being consistently honored HOT 3
- Integration Test using mocked beans HOT 1
- @BeanParam + @QueryParam don't work with Dropwizard-guice HOT 6
- when i add a filter to jersey , then Jersey error HOT 5
- Compatiblity with Dropwizard 1.0? HOT 27
- AutoConfig not honouring Guice Singleton annotation on resource classes HOT 1
- How exactly HelloWorldConfiguration and Environment get injected in the example HOT 1
- Deprecated API WARNing in v1.0.0.2 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dropwizard-guice.